Skip to content

Add GaussDB Database Support #7508

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

moseszane168
Copy link

@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{})
  // ...
}

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.

1 participant