feat(contrib/drivers/gaussdb): add gaussdb driver support#4563
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces comprehensive support for openGauss/GaussDB databases within the GoFrame ORM framework. The implementation includes a fully-featured driver with type conversion, SQL filtering, upsert operations, and CI integration for automated testing.
Key changes:
- New GaussDB driver implementation with PostgreSQL-compatible connection handling and SQL execution
- Comprehensive type conversion system supporting PostgreSQL/GaussDB-specific types including arrays, UUIDs, and JSONB
- Custom MERGE-based upsert implementation to handle GaussDB's limitations with ON CONFLICT syntax
Reviewed changes
Copilot reviewed 21 out of 22 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
contrib/drivers/gaussdb/gaussdb.go |
Core driver registration and initialization |
contrib/drivers/gaussdb/gaussdb_open.go |
Database connection string configuration and opening logic |
contrib/drivers/gaussdb/gaussdb_do_exec.go |
Custom SQL execution with RETURNING clause for LastInsertId support |
contrib/drivers/gaussdb/gaussdb_do_insert.go |
MERGE-based insert operations handling upsert and insert-ignore scenarios |
contrib/drivers/gaussdb/gaussdb_do_filter.go |
SQL filtering for placeholder conversion and LIMIT/OFFSET syntax |
contrib/drivers/gaussdb/gaussdb_convert.go |
Type conversion between PostgreSQL types and Go types |
contrib/drivers/gaussdb/gaussdb_tables.go |
Table metadata retrieval with schema support |
contrib/drivers/gaussdb/gaussdb_table_fields.go |
Field information retrieval with constraint detection |
contrib/drivers/gaussdb/go.mod |
Dependency configuration for openGauss connector |
contrib/drivers/gaussdb/gaussdb_z_unit_*.go |
Comprehensive test suite covering all driver features |
.github/workflows/ci-main.yml |
CI workflow updated with openGauss Docker container |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
hailaz
approved these changes
Dec 16, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new database driver for openGauss (GaussDB), integrating it into the GoFrame framework. The implementation includes connection handling, SQL execution, type conversion, and other driver-specific logic. Additionally, the CI workflow is updated to include an openGauss server for testing. The main themes are: new driver implementation, SQL and type handling, and CI integration.
GaussDB Driver Implementation:
contrib/drivers/gaussdbto support openGauss/GaussDB databases, including initialization, connection handling, and registration with GoFrame's database abstraction. (gaussdb.go,gaussdb_open.go) [1] [2]gaussdb_do_exec.go,gaussdb_result.go) [1] [2]SQL and Type Handling:
INSERT IGNOREand JSONB syntax. (gaussdb_do_filter.go)gaussdb_convert.go)ORDER BY RANDOM()) and explicitly disabled upsert/ON CONFLICT support, as GaussDB does not support this feature. (gaussdb_order.go,gaussdb_format_upsert.go) [1] [2]CI Integration:
.github/workflows/ci-main.yml)