Skip to content

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

chore: use github.com/bytebase/parser/postgresql (#17137)

h3n4l6cd962f5bf75
diff --git a/backend/plugin/advisor/pg/advisor_builtin_prior_backup_check.go b/backend/plugin/advisor/pg/advisor_builtin_prior_backup_check.go
index d45dd36277..35604f93df 100644
--- a/backend/plugin/advisor/pg/advisor_builtin_prior_backup_check.go
+++ b/backend/plugin/advisor/pg/advisor_builtin_prior_backup_check.go
@@ -10,7 +10,7 @@ import (
"github.com/antlr4-go/antlr/v4"
"github.com/pkg/errors"
- parser "github.com/bytebase/postgresql-parser"
+ parser "github.com/bytebase/parser/postgresql"
"github.com/bytebase/bytebase/backend/common"
"github.com/bytebase/bytebase/backend/common/log"
diff --git a/backend/plugin/db/pg/query.go b/backend/plugin/db/pg/query.go
index ff383f474b..aafe641c6d 100644
--- a/backend/plugin/db/pg/query.go
+++ b/backend/plugin/db/pg/query.go
@@ -12,7 +12,7 @@ import (
"github.com/pkg/errors"
"google.golang.org/protobuf/types/known/timestamppb"
- parser "github.com/bytebase/postgresql-parser"
+ parser "github.com/bytebase/parser/postgresql"
"github.com/jackc/pgx/v5/pgtype"
"github.com/bytebase/bytebase/backend/common/log"
diff --git a/backend/plugin/parser/pg/backup.go b/backend/plugin/parser/pg/backup.go
index da39b6e41b..b572549f4c 100644
--- a/backend/plugin/parser/pg/backup.go
+++ b/backend/plugin/parser/pg/backup.go
@@ -9,7 +9,7 @@ import (
"github.com/antlr4-go/antlr/v4"
"github.com/pkg/errors"
- parser "github.com/bytebase/postgresql-parser"
+ parser "github.com/bytebase/parser/postgresql"
"github.com/bytebase/bytebase/backend/common"
storebp "github.com/bytebase/bytebase/backend/generated-go/store"
diff --git a/backend/plugin/parser/pg/completion.go b/backend/plugin/parser/pg/completion.go
index cd3ad10881..f593aeb4cf 100644
--- a/backend/plugin/parser/pg/completion.go
+++ b/backend/plugin/parser/pg/completion.go
@@ -8,7 +8,7 @@ import (
"unicode"
"github.com/antlr4-go/antlr/v4"
- pg "github.com/bytebase/postgresql-parser"
+ pg "github.com/bytebase/parser/postgresql"
"github.com/bytebase/bytebase/backend/generated-go/store"
"github.com/bytebase/bytebase/backend/plugin/parser/base"
diff --git a/backend/plugin/parser/pg/diagnose.go b/backend/plugin/parser/pg/diagnose.go
index 44cd613da6..23007f3977 100644
--- a/backend/plugin/parser/pg/diagnose.go
+++ b/backend/plugin/parser/pg/diagnose.go
@@ -6,7 +6,7 @@ import (
"unicode"
"github.com/antlr4-go/antlr/v4"
- parser "github.com/bytebase/postgresql-parser"
+ parser "github.com/bytebase/parser/postgresql"
"github.com/bytebase/bytebase/backend/generated-go/store"
"github.com/bytebase/bytebase/backend/plugin/parser/base"
diff --git a/backend/plugin/parser/pg/pg.go b/backend/plugin/parser/pg/pg.go
index 5c02610cd2..5196848de3 100644
--- a/backend/plugin/parser/pg/pg.go
+++ b/backend/plugin/parser/pg/pg.go
@@ -4,7 +4,7 @@ import (
"strings"
"github.com/antlr4-go/antlr/v4"
- parser "github.com/bytebase/postgresql-parser"
+ parser "github.com/bytebase/parser/postgresql"
"github.com/bytebase/bytebase/backend/plugin/parser/base"
)
diff --git a/backend/plugin/parser/pg/pg_test.go b/backend/plugin/parser/pg/pg_test.go
index c0d84a5165..b60738a80e 100644
--- a/backend/plugin/parser/pg/pg_test.go
+++ b/backend/plugin/parser/pg/pg_test.go
@@ -3,7 +3,7 @@ package pg
import (
"testing"
- parser "github.com/bytebase/postgresql-parser"
+ parser "github.com/bytebase/parser/postgresql"
"github.com/stretchr/testify/require"
)
diff --git a/backend/plugin/parser/pg/query_span_extractor.go b/backend/plugin/parser/pg/query_span_extractor.go
index f5671fa303..8ca685d0fe 100644
--- a/backend/plugin/parser/pg/query_span_extractor.go
+++ b/backend/plugin/parser/pg/query_span_extractor.go
@@ -17,7 +17,7 @@ import (
"github.com/bytebase/bytebase/backend/plugin/parser/sql/ast"
pgrawparser "github.com/bytebase/bytebase/backend/plugin/parser/sql/engine/pg"
- pgparser "github.com/bytebase/postgresql-parser"
+ pgparser "github.com/bytebase/parser/postgresql"
"github.com/bytebase/bytebase/backend/plugin/parser/base"
"github.com/bytebase/bytebase/backend/store/model"
diff --git a/backend/plugin/parser/pg/resource_change.go b/backend/plugin/parser/pg/resource_change.go
index bcfb76473c..beb2ad0fd6 100644
--- a/backend/plugin/parser/pg/resource_change.go
+++ b/backend/plugin/parser/pg/resource_change.go
@@ -6,7 +6,7 @@ import (
"github.com/antlr4-go/antlr/v4"
"github.com/pkg/errors"
- parser "github.com/bytebase/postgresql-parser"
+ parser "github.com/bytebase/parser/postgresql"
"github.com/bytebase/bytebase/backend/common"
storepb "github.com/bytebase/bytebase/backend/generated-go/store"
diff --git a/backend/plugin/parser/pg/restore.go b/backend/plugin/parser/pg/restore.go
index ccec7f30d8..9a2deb1692 100644
--- a/backend/plugin/parser/pg/restore.go
+++ b/backend/plugin/parser/pg/restore.go
@@ -8,7 +8,7 @@ import (
"github.com/antlr4-go/antlr/v4"
"github.com/pkg/errors"
- parser "github.com/bytebase/postgresql-parser"
+ parser "github.com/bytebase/parser/postgresql"
"github.com/bytebase/bytebase/backend/common"
storepb "github.com/bytebase/bytebase/backend/generated-go/store"
diff --git a/backend/plugin/parser/pg/split.go b/backend/plugin/parser/pg/split.go
index 99061c74db..c34300245c 100644
--- a/backend/plugin/parser/pg/split.go
+++ b/backend/plugin/parser/pg/split.go
@@ -6,7 +6,7 @@ import (
"github.com/antlr4-go/antlr/v4"
"github.com/pkg/errors"
- parser "github.com/bytebase/postgresql-parser"
+ parser "github.com/bytebase/parser/postgresql"
"github.com/bytebase/bytebase/backend/common"
storepb "github.com/bytebase/bytebase/backend/generated-go/store"
diff --git a/backend/plugin/schema/pg/get_database_metadata.go b/backend/plugin/schema/pg/get_database_metadata.go
index d2e9970fec..e96a7cb6cc 100644
--- a/backend/plugin/schema/pg/get_database_metadata.go
+++ b/backend/plugin/schema/pg/get_database_metadata.go
@@ -6,7 +6,7 @@ import (
"strings"
"github.com/antlr4-go/antlr/v4"
- parser "github.com/bytebase/postgresql-parser"
+ parser "github.com/bytebase/parser/postgresql"
"github.com/pkg/errors"
storepb "github.com/bytebase/bytebase/backend/generated-go/store"
diff --git a/backend/plugin/schema/pg/view_comparer.go b/backend/plugin/schema/pg/view_comparer.go
index ff08ea7672..2c3a661469 100644
--- a/backend/plugin/schema/pg/view_comparer.go
+++ b/backend/plugin/schema/pg/view_comparer.go
@@ -5,7 +5,7 @@ import (
"strings"
"github.com/antlr4-go/antlr/v4"
- pgparser "github.com/bytebase/postgresql-parser"
+ pgparser "github.com/bytebase/parser/postgresql"
storepb "github.com/bytebase/bytebase/backend/generated-go/store"
"github.com/bytebase/bytebase/backend/plugin/schema"
diff --git a/go.mod b/go.mod
index 9c63efca95..4137721a87 100644
--- a/go.mod
+++ b/go.mod
@@ -34,7 +34,6 @@ require (
github.com/bytebase/lsp-protocol v0.0.0-20250324071136-1586d0c10ff0
github.com/bytebase/mysql-parser v0.0.0-20241224071214-cb9fd84811dd
github.com/bytebase/plsql-parser v0.0.0-20250218041636-9fed633593d1
- github.com/bytebase/postgresql-parser v0.0.0-20250610072402-8c3c7a857eb8
github.com/bytebase/snowsql-parser v0.0.0-20250124075214-562d62e69c35
github.com/bytebase/tidb-parser v0.0.0-20240821091609-162fffe2a839
github.com/bytebase/trino-parser v0.0.0-20250502000119-9977709a63e8
@@ -299,7 +298,7 @@ require (
github.com/aws/aws-sdk-go-v2/service/sts v1.35.1
github.com/aws/smithy-go v1.22.5 // indirect
github.com/beorn7/perks v1.0.1 // indirect
- github.com/bytebase/parser v0.0.0-20250804064707-064601e79372
+ github.com/bytebase/parser v0.0.0-20250812034117-7cd3429471fb
github.com/bytebase/partiql-parser v0.0.0-20240531101102-1962ff456f2c
github.com/bytebase/tsql-parser v0.0.0-20250704100832-7b20f2173b45
github.com/cespare/xxhash/v2 v2.3.0 // indirect
diff --git a/go.sum b/go.sum
index cc5aa3364a..46a5a2cea4 100644
--- a/go.sum
+++ b/go.sum
@@ -821,8 +821,8 @@ github.com/bytebase/lsp-protocol v0.0.0-20250324071136-1586d0c10ff0 h1:bJ8NSf2K+
github.com/bytebase/lsp-protocol v0.0.0-20250324071136-1586d0c10ff0/go.mod h1:BEWMfiZtqshdmulKJcIsWb45MUaEvDO4CROcgi8dfFg=
github.com/bytebase/mysql-parser v0.0.0-20241224071214-cb9fd84811dd h1:nKWY30Pq9y/z0+MScRm90KU1U3i0U3j0KGBLN0JL/3M=
github.com/bytebase/mysql-parser v0.0.0-20241224071214-cb9fd84811dd/go.mod h1:n22yoTeLcphIYQlV6nbufQbHMxNceOjeGDOrpaRIhiY=
-github.com/bytebase/parser v0.0.0-20250804064707-064601e79372 h1:n41t/XcYBXbLZYFRqFCKJFHpWdidhYomyMp+wtGB3eI=
-github.com/bytebase/parser v0.0.0-20250804064707-064601e79372/go.mod h1:m18BLl2+PxBG2b2SlwEt1LGVEAhCV7r0S+8pKE0BQVo=
+github.com/bytebase/parser v0.0.0-20250812034117-7cd3429471fb h1:haNlfvlFkGH9hab6HT+M0lZJn24t7q6eMLtx4ULzavA=
+github.com/bytebase/parser v0.0.0-20250812034117-7cd3429471fb/go.mod h1:m18BLl2+PxBG2b2SlwEt1LGVEAhCV7r0S+8pKE0BQVo=
github.com/bytebase/partiql-parser v0.0.0-20240531101102-1962ff456f2c h1:TMANvCCN7gpqXHrzRWeWRkPTXmFvTSEyXTZ1Fz20EvM=
github.com/bytebase/partiql-parser v0.0.0-20240531101102-1962ff456f2c/go.mod h1:hNMKtZBMCbNyhUFR47Ct9mqmpzZVtHgC0OsOIQhR27k=
github.com/bytebase/pg_query_go2/v6 v6.0.0-20250403034815-22c5b71007ed h1:5DEnBIrnxAxCTbh/tbjmg/9uw9/auyvKu8s0M+ePTOs=
@@ -833,8 +833,6 @@ github.com/bytebase/pkcs8 v0.0.0-20240612095628-fcd0a7484c94 h1:6PNsuNmSqCuR8Z61
github.com/bytebase/pkcs8 v0.0.0-20240612095628-fcd0a7484c94/go.mod h1:SQliXeA7Dhkt//vS29v3zpbEwoa+zb2Cn5xj5uO4K5U=
github.com/bytebase/plsql-parser v0.0.0-20250218041636-9fed633593d1 h1:QDmyzL8Kp/mqL53KgIRTWGYf0UUt3LdjKsIFRxW7+pE=
github.com/bytebase/plsql-parser v0.0.0-20250218041636-9fed633593d1/go.mod h1:sEtLYOfHyi8zz5vo5gKT//A8c4P8FnDZLNVSLtVPxj0=
-github.com/bytebase/postgresql-parser v0.0.0-20250610072402-8c3c7a857eb8 h1:pFo/RV1+pe3ACfAqG5ZJJ0Y/YHfHZwkhQGgFcI4A4eM=
-github.com/bytebase/postgresql-parser v0.0.0-20250610072402-8c3c7a857eb8/go.mod h1:Jft7oabwuwD+t5BYiUfTjcNVaihZ8F5KT8TsROG0EaE=
github.com/bytebase/snowsql-parser v0.0.0-20250124075214-562d62e69c35 h1:eP0Ox7IGGROy2cdvWQP6mmFOZvNnoT8dUPJBUXCakec=
github.com/bytebase/snowsql-parser v0.0.0-20250124075214-562d62e69c35/go.mod h1:gJ1aclz1e9xLArQTbCpDjL+A79Jt3Ro9+/QEw8A6vMM=
github.com/bytebase/tidb-parser v0.0.0-20240821091609-162fffe2a839 h1:OLOEfNV20wqC4nPHQllr4mrMhchAhPrgXlKn0URgum8=