Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: bump omni for postgres default validation (#20339)

rebelicebe5913385b90
diff --git a/backend/plugin/schema/pg/testdata/walk_through.yaml b/backend/plugin/schema/pg/testdata/walk_through.yaml
index b6d0c9c284..d52d6a2619 100644
--- a/backend/plugin/schema/pg/testdata/walk_through.yaml
+++ b/backend/plugin/schema/pg/testdata/walk_through.yaml
@@ -71,3 +71,15 @@
ignore_case_sensitive: false
want: ""
advice: null
+- statement: CREATE TABLE t_default_identifier(a text DEFAULT "status");
+ ignore_case_sensitive: false
+ want: ""
+ advice:
+ code: 260
+ content: "ERROR: cannot use column reference in DEFAULT expression (SQLSTATE 0A000)"
+- statement: CREATE TABLE t_default_column(a int, b int DEFAULT a);
+ ignore_case_sensitive: false
+ want: ""
+ advice:
+ code: 260
+ content: "ERROR: cannot use column reference in DEFAULT expression (SQLSTATE 0A000)"
diff --git a/backend/plugin/schema/pg/walk_through_test.go b/backend/plugin/schema/pg/walk_through_test.go
index be2ed4a68d..76dfa13bd5 100644
--- a/backend/plugin/schema/pg/walk_through_test.go
+++ b/backend/plugin/schema/pg/walk_through_test.go
@@ -99,12 +99,13 @@ func TestWalkThrough(t *testing.T) {
stmts, _ := sm.GetStatementsForChecks(storepb.Engine_POSTGRES, test.Statement)
asts := base.ExtractASTs(stmts)
advice := WalkThroughWithContext(schema.WalkThroughContext{RawSQL: test.Statement}, state, asts)
+ if test.Advice != nil {
+ require.NotNil(t, advice)
+ require.Equal(t, test.Advice.Code, advice.Code)
+ require.Equal(t, test.Advice.Content, advice.Content)
+ continue
+ }
if advice != nil {
- // Compare the advice fields
- if test.Advice != nil {
- require.Equal(t, test.Advice.Code, advice.Code)
- require.Equal(t, test.Advice.Content, advice.Content)
- }
continue
}
diff --git a/go.mod b/go.mod
index 84b950db7c..f6f7aa86c7 100644
--- a/go.mod
+++ b/go.mod
@@ -34,7 +34,7 @@ require (
github.com/bmatcuk/doublestar/v4 v4.10.0
github.com/bytebase/gomongo v0.0.0-20260510192859-8526a440b352
github.com/bytebase/lsp-protocol v0.0.0-20250324071136-1586d0c10ff0
- github.com/bytebase/omni v0.0.0-20260513072939-39c04c4cca0f
+ github.com/bytebase/omni v0.0.0-20260514025606-97e2637df6e9
github.com/caarlos0/env/v11 v11.4.1
github.com/cenkalti/backoff/v5 v5.0.3
github.com/cockroachdb/cockroachdb-parser v0.25.2
diff --git a/go.sum b/go.sum
index 79adc67abf..8011bec6ad 100644
--- a/go.sum
+++ b/go.sum
@@ -250,8 +250,8 @@ github.com/bytebase/gomongo v0.0.0-20260510192859-8526a440b352 h1:3sC5pdvJ7bNAhR
github.com/bytebase/gomongo v0.0.0-20260510192859-8526a440b352/go.mod h1:eyWrxE51HCbjGIChvty/mYaNcAroXshnIiR6SIqlxfY=
github.com/bytebase/lsp-protocol v0.0.0-20250324071136-1586d0c10ff0 h1:bJ8NSf2K+pccl5m/wuu97fiYjDwpJH6IzURAq/3XA2U=
github.com/bytebase/lsp-protocol v0.0.0-20250324071136-1586d0c10ff0/go.mod h1:BEWMfiZtqshdmulKJcIsWb45MUaEvDO4CROcgi8dfFg=
-github.com/bytebase/omni v0.0.0-20260513072939-39c04c4cca0f h1:HL40pxmFDr0/9iGkp1W+Zzyc257SBPiYc0ld6yZf5aM=
-github.com/bytebase/omni v0.0.0-20260513072939-39c04c4cca0f/go.mod h1:EVG8nQbNPUnUBGKn6J0niSGOs3jgfKo3TciY22R4bfo=
+github.com/bytebase/omni v0.0.0-20260514025606-97e2637df6e9 h1:0XFNGB4qxFlUrpEIfqXOlrgLsvny3gYQpIgRh0/MXtI=
+github.com/bytebase/omni v0.0.0-20260514025606-97e2637df6e9/go.mod h1:EVG8nQbNPUnUBGKn6J0niSGOs3jgfKo3TciY22R4bfo=
github.com/bytebase/parser v0.0.0-20260417075056-57b6ef7a2640 h1:g4Jed1/Jv/DHBiQmEgN5ILOQDDBjFlG4N4Lp+3B4aYE=
github.com/bytebase/parser v0.0.0-20260417075056-57b6ef7a2640/go.mod h1:jeak/EfutSOAuWKvrFIT2IZunhWprM7oTFBRgZ9RCxo=
github.com/bytebase/pgx/v5 v5.0.0-20250212161523-96ff8aed8767 h1:YuR5G3LcxpO5ScSTA+Kdirxg9RW4TRc/v1t7N2Hfmbw=