Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
chore: update parser with PL/SQL grammar sync (#18873)
Vincent Huang8477a14fc837
diff --git a/backend/plugin/schema/oracle/get_database_metadata.go b/backend/plugin/schema/oracle/get_database_metadata.goindex d38ed11806..37795d5c06 100644--- a/backend/plugin/schema/oracle/get_database_metadata.go+++ b/backend/plugin/schema/oracle/get_database_metadata.go@@ -448,22 +448,20 @@ func (e *metadataExtractor) EnterCreate_sequence(ctx *parser.Create_sequenceCont// extractSequenceOptions extracts sequence specification options using ANTLR parserfunc (*metadataExtractor) extractSequenceOptions(ctx *parser.Create_sequenceContext, sequence *storepb.SequenceMetadata) {- // Extract START WITH clause using ANTLR parser- startClauses := ctx.AllSequence_start_clause()- for _, startClause := range startClauses {- if startClause.START() != nil && startClause.WITH() != nil && startClause.UNSIGNED_INTEGER() != nil {- startValue := startClause.UNSIGNED_INTEGER().GetText()- if startValue != "" {- // Store all start values - Oracle metadata may not match DDL- sequence.Start = startValue- break- }- }- }-// Extract sequence specifications using ANTLR parser+ // Note: sequence_start_clause is now nested inside sequence_specsequenceSpecs := ctx.AllSequence_spec()for _, spec := range sequenceSpecs {+ // Extract START WITH clause (now nested in sequence_spec)+ if startClause := spec.Sequence_start_clause(); startClause != nil {+ if startClause.START() != nil && startClause.WITH() != nil && startClause.UNSIGNED_INTEGER() != nil {+ startValue := startClause.UNSIGNED_INTEGER().GetText()+ if startValue != "" {+ sequence.Start = startValue+ }+ }+ }+// Extract INCREMENT BY valueif spec.INCREMENT() != nil && spec.BY() != nil && spec.UNSIGNED_INTEGER() != nil {incrementValue := spec.UNSIGNED_INTEGER().GetText()diff --git a/go.mod b/go.modindex 1ca8c6f01f..4550d1593f 100644--- a/go.mod+++ b/go.mod@@ -303,7 +303,7 @@ require (github.com/aws/aws-sdk-go-v2/service/sts v1.41.5github.com/aws/smithy-go v1.24.0 // indirectgithub.com/beorn7/perks v1.0.1 // indirect- github.com/bytebase/parser v0.0.0-20260108061442-ac070dde7b29+ github.com/bytebase/parser v0.0.0-20260113041207-12c6f17e2d8egithub.com/cespare/xxhash/v2 v2.3.0 // indirectgithub.com/cncf/xds/go v0.0.0-20251022180443-0feb69152e9f // indirectgithub.com/cockroachdb/cockroach-go/v2 v2.4.3diff --git a/go.sum b/go.sumindex 6a160291d6..0e19185013 100644--- a/go.sum+++ b/go.sum@@ -861,8 +861,8 @@ github.com/bytebase/gosasl v0.0.0-20240422091407-6b7481e86f08 h1:S1GgjJLspz4E4z4github.com/bytebase/gosasl v0.0.0-20240422091407-6b7481e86f08/go.mod h1:Qx8cW6jkI8riyzmklj80kAIkv+iezFUTBiGU0qHhHes=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/parser v0.0.0-20260108061442-ac070dde7b29 h1:wFH+88YKUuM0L/u/Kwl2JvARCI5RM89I5yxyAfZNBvc=-github.com/bytebase/parser v0.0.0-20260108061442-ac070dde7b29/go.mod h1:jeak/EfutSOAuWKvrFIT2IZunhWprM7oTFBRgZ9RCxo=+github.com/bytebase/parser v0.0.0-20260113041207-12c6f17e2d8e h1:MtSRG2W59qJujPTbK8jUoQKJX4wLRYXJDWDOgtVa8kY=+github.com/bytebase/parser v0.0.0-20260113041207-12c6f17e2d8e/go.mod h1:jeak/EfutSOAuWKvrFIT2IZunhWprM7oTFBRgZ9RCxo=github.com/bytebase/pgx/v5 v5.0.0-20250212161523-96ff8aed8767 h1:YuR5G3LcxpO5ScSTA+Kdirxg9RW4TRc/v1t7N2Hfmbw=github.com/bytebase/pgx/v5 v5.0.0-20250212161523-96ff8aed8767/go.mod h1:ncY89UGWxg82EykZUwSpUKEfccBGGYq1xjrOpsbsfGQ=github.com/bytebase/pkcs8 v0.0.0-20240612095628-fcd0a7484c94 h1:6PNsuNmSqCuR8Z616uQLzDIvujWCFsKzeVc3ECmVubk=