Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
feat(review): enable SQL review plan checks for BigQuery (#21610)
Danny Xu1c90ce094edc
diff --git a/backend/common/engine.go b/backend/common/engine.goindex 5b109755a7..470c49f202 100644--- a/backend/common/engine.go+++ b/backend/common/engine.go@@ -17,7 +17,8 @@ func EngineSupportSQLReview(engine storepb.Engine) bool {storepb.Engine_OCEANBASE,storepb.Engine_SNOWFLAKE,storepb.Engine_REDSHIFT,- storepb.Engine_MSSQL:+ storepb.Engine_MSSQL,+ storepb.Engine_BIGQUERY:return truecasestorepb.Engine_ENGINE_UNSPECIFIED,@@ -26,7 +27,6 @@ func EngineSupportSQLReview(engine storepb.Engine) bool {storepb.Engine_REDIS,storepb.Engine_CLICKHOUSE,storepb.Engine_SPANNER,- storepb.Engine_BIGQUERY,storepb.Engine_STARROCKS,storepb.Engine_HIVE,storepb.Engine_COCKROACHDB,@@ -209,7 +209,8 @@ func EngineSupportStatementAdvise(e storepb.Engine) bool {storepb.Engine_DYNAMODB,storepb.Engine_COCKROACHDB,storepb.Engine_REDSHIFT,- storepb.Engine_MARIADB:+ storepb.Engine_MARIADB,+ storepb.Engine_BIGQUERY:return truecasestorepb.Engine_ENGINE_UNSPECIFIED,@@ -218,7 +219,6 @@ func EngineSupportStatementAdvise(e storepb.Engine) bool {storepb.Engine_REDIS,storepb.Engine_CLICKHOUSE,storepb.Engine_SPANNER,- storepb.Engine_BIGQUERY,storepb.Engine_STARROCKS,storepb.Engine_HIVE,storepb.Engine_DORIS,diff --git a/backend/common/engine_test.go b/backend/common/engine_test.goindex c0f40084a8..6c235389e0 100644--- a/backend/common/engine_test.go+++ b/backend/common/engine_test.go@@ -38,3 +38,42 @@ func TestEngineSupportSDLExport(t *testing.T) {})}}++func TestEngineSupportSQLReview(t *testing.T) {+ tests := []struct {+ engine storepb.Engine+ want bool+ }{+ {storepb.Engine_POSTGRES, true},+ {storepb.Engine_MYSQL, true},+ {storepb.Engine_BIGQUERY, true},+ {storepb.Engine_SPANNER, false},+ {storepb.Engine_MONGODB, false},+ }+ for _, tt := range tests {+ t.Run(tt.engine.String(), func(t *testing.T) {+ require.Equal(t, tt.want, EngineSupportSQLReview(tt.engine))+ })+ }+}++// The plan-check executor reports "Statement advise is not supported" and skips+// SQL review entirely when this gate is false, so every engine with advisor+// rules must be listed here.+func TestEngineSupportStatementAdvise(t *testing.T) {+ tests := []struct {+ engine storepb.Engine+ want bool+ }{+ {storepb.Engine_POSTGRES, true},+ {storepb.Engine_MYSQL, true},+ {storepb.Engine_BIGQUERY, true},+ {storepb.Engine_SPANNER, false},+ {storepb.Engine_MONGODB, false},+ }+ for _, tt := range tests {+ t.Run(tt.engine.String(), func(t *testing.T) {+ require.Equal(t, tt.want, EngineSupportStatementAdvise(tt.engine))+ })+ }+}