@@ -253,6 +253,7 @@ type CreateQuery struct {
253253 Populate bool `json:"populate,omitempty"` // POPULATE for materialized views
254254 Columns []* ColumnDeclaration `json:"columns,omitempty"`
255255 Indexes []* IndexDefinition `json:"indexes,omitempty"`
256+ Projections []* Projection `json:"projections,omitempty"`
256257 Constraints []* Constraint `json:"constraints,omitempty"`
257258 Engine * EngineClause `json:"engine,omitempty"`
258259 OrderBy []Expression `json:"order_by,omitempty"`
@@ -467,19 +468,24 @@ func (t *TTLClause) End() token.Position { return t.Position }
467468
468469// DropQuery represents a DROP statement.
469470type DropQuery struct {
470- Position token.Position `json:"-"`
471- IfExists bool `json:"if_exists,omitempty"`
472- Database string `json:"database,omitempty"`
473- Table string `json:"table,omitempty"`
474- Tables []* TableIdentifier `json:"tables,omitempty"` // For DROP TABLE t1, t2, t3
475- View string `json:"view,omitempty"`
476- User string `json:"user,omitempty"`
477- Function string `json:"function,omitempty"` // For DROP FUNCTION
478- Dictionary string `json:"-"` // For DROP DICTIONARY (format only, not in AST JSON)
479- Temporary bool `json:"temporary,omitempty"`
480- OnCluster string `json:"on_cluster,omitempty"`
481- DropDatabase bool `json:"drop_database,omitempty"`
482- Sync bool `json:"sync,omitempty"`
471+ Position token.Position `json:"-"`
472+ IfExists bool `json:"if_exists,omitempty"`
473+ Database string `json:"database,omitempty"`
474+ Table string `json:"table,omitempty"`
475+ Tables []* TableIdentifier `json:"tables,omitempty"` // For DROP TABLE t1, t2, t3
476+ View string `json:"view,omitempty"`
477+ User string `json:"user,omitempty"`
478+ Function string `json:"function,omitempty"` // For DROP FUNCTION
479+ Dictionary string `json:"-"` // For DROP DICTIONARY (format only, not in AST JSON)
480+ Role string `json:"role,omitempty"` // For DROP ROLE
481+ Quota string `json:"quota,omitempty"` // For DROP QUOTA
482+ Policy string `json:"policy,omitempty"` // For DROP POLICY
483+ RowPolicy string `json:"row_policy,omitempty"` // For DROP ROW POLICY
484+ SettingsProfile string `json:"settings_profile,omitempty"` // For DROP SETTINGS PROFILE
485+ Temporary bool `json:"temporary,omitempty"`
486+ OnCluster string `json:"on_cluster,omitempty"`
487+ DropDatabase bool `json:"drop_database,omitempty"`
488+ Sync bool `json:"sync,omitempty"`
483489}
484490
485491func (d * DropQuery ) Pos () token.Position { return d .Position }
@@ -542,7 +548,7 @@ type ProjectionSelectQuery struct {
542548 Position token.Position `json:"-"`
543549 Columns []Expression `json:"columns"`
544550 GroupBy []Expression `json:"group_by,omitempty"`
545- OrderBy * Identifier `json:"order_by,omitempty"` // Single column for ORDER BY
551+ OrderBy [] Expression `json:"order_by,omitempty"` // ORDER BY columns
546552}
547553
548554// Assignment represents a column assignment in UPDATE.
@@ -657,14 +663,15 @@ func (d *DescribeQuery) statementNode() {}
657663
658664// ShowQuery represents a SHOW statement.
659665type ShowQuery struct {
660- Position token.Position `json:"-"`
661- ShowType ShowType `json:"show_type"`
662- Database string `json:"database,omitempty"`
663- From string `json:"from,omitempty"`
664- Like string `json:"like,omitempty"`
665- Where Expression `json:"where,omitempty"`
666- Limit Expression `json:"limit,omitempty"`
667- Format string `json:"format,omitempty"`
666+ Position token.Position `json:"-"`
667+ ShowType ShowType `json:"show_type"`
668+ Database string `json:"database,omitempty"`
669+ From string `json:"from,omitempty"`
670+ Like string `json:"like,omitempty"`
671+ Where Expression `json:"where,omitempty"`
672+ Limit Expression `json:"limit,omitempty"`
673+ Format string `json:"format,omitempty"`
674+ HasSettings bool `json:"has_settings,omitempty"` // Whether SETTINGS clause was specified
668675}
669676
670677func (s * ShowQuery ) Pos () token.Position { return s .Position }
@@ -901,6 +908,104 @@ func (s *ShowCreateSettingsProfileQuery) Pos() token.Position { return s.Positio
901908func (s * ShowCreateSettingsProfileQuery ) End () token.Position { return s .Position }
902909func (s * ShowCreateSettingsProfileQuery ) statementNode () {}
903910
911+ // CreateRowPolicyQuery represents a CREATE ROW POLICY or ALTER ROW POLICY statement.
912+ type CreateRowPolicyQuery struct {
913+ Position token.Position `json:"-"`
914+ IsAlter bool `json:"is_alter,omitempty"`
915+ }
916+
917+ func (c * CreateRowPolicyQuery ) Pos () token.Position { return c .Position }
918+ func (c * CreateRowPolicyQuery ) End () token.Position { return c .Position }
919+ func (c * CreateRowPolicyQuery ) statementNode () {}
920+
921+ // DropRowPolicyQuery represents a DROP ROW POLICY statement.
922+ type DropRowPolicyQuery struct {
923+ Position token.Position `json:"-"`
924+ IfExists bool `json:"if_exists,omitempty"`
925+ }
926+
927+ func (d * DropRowPolicyQuery ) Pos () token.Position { return d .Position }
928+ func (d * DropRowPolicyQuery ) End () token.Position { return d .Position }
929+ func (d * DropRowPolicyQuery ) statementNode () {}
930+
931+ // ShowCreateRowPolicyQuery represents a SHOW CREATE ROW POLICY statement.
932+ type ShowCreateRowPolicyQuery struct {
933+ Position token.Position `json:"-"`
934+ }
935+
936+ func (s * ShowCreateRowPolicyQuery ) Pos () token.Position { return s .Position }
937+ func (s * ShowCreateRowPolicyQuery ) End () token.Position { return s .Position }
938+ func (s * ShowCreateRowPolicyQuery ) statementNode () {}
939+
940+ // CreateRoleQuery represents a CREATE ROLE or ALTER ROLE statement.
941+ type CreateRoleQuery struct {
942+ Position token.Position `json:"-"`
943+ IsAlter bool `json:"is_alter,omitempty"`
944+ }
945+
946+ func (c * CreateRoleQuery ) Pos () token.Position { return c .Position }
947+ func (c * CreateRoleQuery ) End () token.Position { return c .Position }
948+ func (c * CreateRoleQuery ) statementNode () {}
949+
950+ // DropRoleQuery represents a DROP ROLE statement.
951+ type DropRoleQuery struct {
952+ Position token.Position `json:"-"`
953+ IfExists bool `json:"if_exists,omitempty"`
954+ }
955+
956+ func (d * DropRoleQuery ) Pos () token.Position { return d .Position }
957+ func (d * DropRoleQuery ) End () token.Position { return d .Position }
958+ func (d * DropRoleQuery ) statementNode () {}
959+
960+ // ShowCreateRoleQuery represents a SHOW CREATE ROLE statement.
961+ type ShowCreateRoleQuery struct {
962+ Position token.Position `json:"-"`
963+ RoleCount int `json:"role_count,omitempty"` // Number of roles specified
964+ }
965+
966+ func (s * ShowCreateRoleQuery ) Pos () token.Position { return s .Position }
967+ func (s * ShowCreateRoleQuery ) End () token.Position { return s .Position }
968+ func (s * ShowCreateRoleQuery ) statementNode () {}
969+
970+ // CreateResourceQuery represents a CREATE RESOURCE statement.
971+ type CreateResourceQuery struct {
972+ Position token.Position `json:"-"`
973+ Name string `json:"name"`
974+ }
975+
976+ func (c * CreateResourceQuery ) Pos () token.Position { return c .Position }
977+ func (c * CreateResourceQuery ) End () token.Position { return c .Position }
978+ func (c * CreateResourceQuery ) statementNode () {}
979+
980+ // DropResourceQuery represents a DROP RESOURCE statement.
981+ type DropResourceQuery struct {
982+ Position token.Position `json:"-"`
983+ }
984+
985+ func (d * DropResourceQuery ) Pos () token.Position { return d .Position }
986+ func (d * DropResourceQuery ) End () token.Position { return d .Position }
987+ func (d * DropResourceQuery ) statementNode () {}
988+
989+ // CreateWorkloadQuery represents a CREATE WORKLOAD statement.
990+ type CreateWorkloadQuery struct {
991+ Position token.Position `json:"-"`
992+ Name string `json:"name"`
993+ Parent string `json:"parent,omitempty"` // Parent workload name (after IN)
994+ }
995+
996+ func (c * CreateWorkloadQuery ) Pos () token.Position { return c .Position }
997+ func (c * CreateWorkloadQuery ) End () token.Position { return c .Position }
998+ func (c * CreateWorkloadQuery ) statementNode () {}
999+
1000+ // DropWorkloadQuery represents a DROP WORKLOAD statement.
1001+ type DropWorkloadQuery struct {
1002+ Position token.Position `json:"-"`
1003+ }
1004+
1005+ func (d * DropWorkloadQuery ) Pos () token.Position { return d .Position }
1006+ func (d * DropWorkloadQuery ) End () token.Position { return d .Position }
1007+ func (d * DropWorkloadQuery ) statementNode () {}
1008+
9041009// CreateIndexQuery represents a CREATE INDEX statement.
9051010type CreateIndexQuery struct {
9061011 Position token.Position `json:"-"`
@@ -959,6 +1064,7 @@ type Literal struct {
9591064 Position token.Position `json:"-"`
9601065 Type LiteralType `json:"type"`
9611066 Value interface {} `json:"value"`
1067+ Negative bool `json:"negative,omitempty"` // True if literal was explicitly negative (for -0)
9621068}
9631069
9641070func (l * Literal ) Pos () token.Position { return l .Position }
@@ -1036,11 +1142,15 @@ type ReplaceExpr struct {
10361142func (r * ReplaceExpr ) Pos () token.Position { return r .Position }
10371143func (r * ReplaceExpr ) End () token.Position { return r .Position }
10381144
1039- // ColumnsMatcher represents COLUMNS('pattern') expression.
1145+ // ColumnsMatcher represents COLUMNS('pattern') or COLUMNS(col1, col2) expression.
1146+ // When Pattern is set, it's a regex matcher (ColumnsRegexpMatcher in explain).
1147+ // When Columns is set, it's a list matcher (ColumnsListMatcher in explain).
10401148type ColumnsMatcher struct {
1041- Position token.Position `json:"-"`
1042- Pattern string `json:"pattern"`
1043- Except []string `json:"except,omitempty"`
1149+ Position token.Position `json:"-"`
1150+ Pattern string `json:"pattern,omitempty"`
1151+ Columns []Expression `json:"columns,omitempty"` // For COLUMNS(id, name) syntax
1152+ Except []string `json:"except,omitempty"`
1153+ Qualifier string `json:"qualifier,omitempty"` // For qualified matchers like table.COLUMNS(...)
10441154}
10451155
10461156func (c * ColumnsMatcher ) Pos () token.Position { return c .Position }
0 commit comments