@@ -25,6 +25,7 @@ func Test_convertDBType(t *testing.T) {
2525 "TDSQL For InnoDB" : {input : "TDSQL For InnoDB" , expected : "MYSQL" },
2626 "GoldenDB" : {input : "GoldenDB" , expected : "MYSQL" },
2727 "PolarDB For MySQL" : {input : "PolarDB For MySQL" , expected : "MYSQL" },
28+ "GaussDB" : {input : "GaussDB" , expected : "GAUSSDB" },
2829 "MongoDB" : {input : "MongoDB" , expected : "MONGODB" },
2930 "Unknown passthrough" : {input : "UnknownDB" , expected : "UnknownDB" },
3031 }
@@ -52,9 +53,11 @@ func Test_SupportDBType(t *testing.T) {
5253 "TDSQL supported" : {input : pkgConst .DBTypeTDSQLForInnoDB , expected : true },
5354 "GoldenDB supported" : {input : pkgConst .DBTypeGoldenDB , expected : true },
5455 "MongoDB unsupported" : {input : pkgConst .DBTypeMongoDB , expected : false },
55- "PostgreSQL unsupported " : {input : pkgConst .DBTypePostgreSQL , expected : false },
56+ "PostgreSQL supported " : {input : pkgConst .DBTypePostgreSQL , expected : true },
5657 "SQL Server unsupported" : {input : pkgConst .DBTypeSQLServer , expected : false },
5758 "PolarDB For MySQL supported" : {input : pkgConst .DBTypePolarDBForMySQL , expected : true },
59+ "GaussDB supported" : {input : pkgConst .DBTypeGaussDB , expected : true },
60+ "GaussDBForMySQL unsupported" : {input : pkgConst .DBTypeGaussDBForMySQL , expected : false },
5861 }
5962 for name , tc := range cases {
6063 t .Run (name , func (t * testing.T ) {
@@ -66,6 +69,18 @@ func Test_SupportDBType(t *testing.T) {
6669 }
6770}
6871
72+ func Test_SupportDBType_GaussDB_PG_family_consistency (t * testing.T ) {
73+ svc := & SqlWorkbenchService {}
74+ // CR-13: design §1.2 decision-3 locks PG family (PostgreSQL + GaussDB)
75+ // must be whitelisted together; SQL workbench routing assumes the pair.
76+ if got := svc .SupportDBType (pkgConst .DBTypePostgreSQL ); ! got {
77+ t .Errorf ("PostgreSQL must be supported (CR-13 / EARS-1.2)" )
78+ }
79+ if got := svc .SupportDBType (pkgConst .DBTypeGaussDB ); ! got {
80+ t .Errorf ("GaussDB must be supported (EARS-1.2 / decision-3)" )
81+ }
82+ }
83+
6984func Test_buildMongoDatasourceOptions (t * testing.T ) {
7085 defaultDB := "appdb"
7186 defaultSchema , propertiesValue , jdbcParams := buildMongoDatasourceOptions (& biz.DBService {
0 commit comments