Skip to content

Add GaussDB Database Support#7508

Merged
jinzhu merged 8 commits intogo-gorm:masterfrom
moseszane168:master
Jul 21, 2025
Merged

Add GaussDB Database Support#7508
jinzhu merged 8 commits intogo-gorm:masterfrom
moseszane168:master

Conversation

@moseszane168
Copy link
Copy Markdown
Contributor

@moseszane168 moseszane168 commented Jul 8, 2025

  • Do only one thing
  • Non breaking API changes
  • Tested

Add GaussDB Database Support

This PR adds support for Huawei GaussDB as a database dialect in GORM.

What did this pull request do?

  • Implemented a new dialect for Huawei GaussDB based on the PostgreSQL dialect
  • Added proper type mappings for GaussDB specific data types
  • Implemented GaussDB specific SQL differences handling
  • Added test cases for GaussDB compatibility
  • Updated documentation to include GaussDB support

User Case Description

Many enterprises in China are using Huawei GaussDB as their primary database solution. This PR enables GORM users to seamlessly work with GaussDB while maintaining compatibility with existing PostgreSQL-oriented code.

// Example usage:
import (
  "gorm.io/driver/gaussdb"
  "gorm.io/gorm"
)

func main() {
  dsn := "host=localhost user=gorm password=gorm dbname=gorm port=8000 sslmode=disable"
  db, err := gorm.Open(gaussdb.Open(dsn), &gorm.Config{})
  // ...
}

@jinzhu jinzhu merged commit 991c2d4 into go-gorm:master Jul 21, 2025
27 checks passed
@jinzhu
Copy link
Copy Markdown
Member

jinzhu commented Jul 21, 2025

Hi @moseszane168

Could you also update the docker-compose file so that we can run ./tests/tests_all.sh successfully?

@moseszane168
Copy link
Copy Markdown
Contributor Author

Hi @moseszane168

Could you also update the docker-compose file so that we can run ./tests/tests_all.sh successfully?

Hi @jinzhu

Sure, yes https://github.com/go-gorm/gorm/blob/master/tests/compose.yml Is this file correct?

@jinzhu
Copy link
Copy Markdown
Member

jinzhu commented Jul 21, 2025

Hi @moseszane168
Could you also update the docker-compose file so that we can run ./tests/tests_all.sh successfully?

Hi @jinzhu

Sure, yes https://github.com/go-gorm/gorm/blob/master/tests/compose.yml Is this file correct?

yes

phroggyy pushed a commit to incident-io/gorm that referenced this pull request Jan 23, 2026
* support gaussdb

* use github CI

* change function name

* use gorm.io/driver/gaussdb

---------

Co-authored-by: bing.ma <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants