Parses SQL into Concrete Syntax Tree (CST)
GPL-2.0 License
TriggerEventExpr
instead of plain TriggerEvent
(d5ca16d)timeKw
from TriggerEvent
(9e0d309)TriggerTarget
from TriggerEvent
(d37a94b)TriggerCondition
to WhenClause
(7cd0758)CreateTriggerStmt.eachKw
and .when
fields with .clauses
(56a69b4)FILTER()
in aggregate functionsrow_constructor
syntaxTRIGGER
syntax:
CREATE TRIGGER
REFERENCING
clause in TRIGGER
FROM
clauseFOR EACH
clauseTRUNCATE
eventALTER PROCEDURE
& ALTER FUNCTION
E'strings'
and U&'strings'
UESCAPE
in unicode strings & identifiersSYSTEM_USER
)Published by nene 8 months ago
$nr
paramTypes
option now accepts "$nr"
, to match parameters in the form of $1, $2, $3
Published by nene 9 months ago
AlterActionAddConstraint
node to support BigQuery ADD CONSTRAINT IF NOT EXISTS
syntax (72dadd1)ReindexStmt
from AllSqliteNodes
to AllIndexNodes
(79b68c2)IndexSpecification
from AllConstraintNodes
to AllIndexNodes
(2ba172f)IndexIncludeClause
from AllConstraintNodes
to AllIndexNodes
to support INCLUDE (...)
in CREATE INDEX
(bde541a)CreateIndexStmt.name
field is now optional (e90647d)CreateViewStmt.columns
field now contains list of ColumnDefinition
nodes instead of just list of Identifier
nodes. (1ba2459)PRIMARY KEY
constraintFOREIGN KEY
constraintALTER TABLE .. DROP PRIMARY KEY
ALTER TABLE .. DROP CONSTRAINT
NOT ENFORCED
modifier in PRIMARY/FOREIGN KEY
ALTER TABLE .. ADD CONSTRAINT IF NOT EXISTS
ALTER VIEW .. ALTER COLUMN .. SET OPTIONS()
OPTIONS()
in CREATE VIEW
columns listCREATE MATERIALIZED VIEW AS REPLICA OF
VECTOR_SEARCH()
functionCREATE VECTOR INDEX
GROUPING()
functionGROUP BY .. GROUPING SETS / CUBE / ROLLUP
LIKE
operatorCREATE INDEX
statementDROP INDEX
statementALTER INDEX
statementREINDEX
statementopclass
(mainly in the context of CREATE INDEX
)Published by nene 9 months ago
TableKind
, ViewKind
and SequenceKind
nodes with RelationKind
.CreateViewStmt.kind
field containing TableKind
not ViewKind
(#68)Published by nene 9 months ago
AlterTableAllInTablespaceStmt
alongsideAlterTableStmt
statement. This means the addition of AllAlterTableNodes
and AllAlterTableStatements
types (7c546fd)WithStorageParametersClause
to PostgresqlWithOptions
(4052303)AlterActionSetOptions
to AlterActionSetBigqueryOptions
(b21538f)VIEW
nodes are now exported as AllViewNodes
, the AllViewStatements
is still exported, but no more includes all*Kw
fields in CreateViewStmt
with kinds: ViewKind[]
(c8beba7)CreateTableTablespaceClause
to TablespaceClause
(f2f6b79)CreateTableWithDataClause
to WithDataClause
(32c64f1)materializedKw
field with kind
in CreateViewStmt
& DropViewStmt
(b636853)DropSchemaStmt.name
field to schemas
(e41a9fc)AlterViewStmt.actions
now contains ListExpr
(4ab708d)AlterActionRenameTable
to AlterActionRename
(2aa2314)CreateSchemaStmt.options
field to clauses
(a3aa401)CreateSchemaStmt.name
field is now optional (397b146)TruncateStmt.cascadeOrRestrictKw
field to behaviorKw
(0d7eee4)CREATE TABLE
CREATE FOREIGN TABLE
ALTER TABLE
CREATE/DROP/ALTER SEQUENCE
CREATE/ALTER/DROP VIEW
CREATE/ALTER/DROP MATERIALIZED VIEW
REFRESH MATERIALIZED VIEW
ALTER/DROP SCHEMA
CREATE SCHEMA
(only missing support of nested CREATE TRIGGER
and GRANT
statements)Published by nene 9 months ago
procedure_param
node. The function_param
node is now used in both CREATE FUNCTION
and CREATE PROCEDURE
statements.function_param
node now contains the mode
field that was part of procedure_param
.name
field of function_param
is now optional.CREATE FUNCTION
DROP FUNCTION
CREATE PROCEDURE
DROP PROCEDURE
block_stmt
node now contains optional atomicKw
field. To allow for PostgreSQL-specific BEGIN ATOMIC ... END
syntax.Published by nene 9 months ago
constraint_deferrable
node has been replaced with array of constraint_modifier
nodes.deferrable
field in constraint
node has been renamed to modifiers
.onConflict
field has been replaced with clauses
array.constraint_primary_key
, constraint_unique
, constraint_check
, constraint_not_null
.*Kw
fields have been replaced with kind
field that contains table_kind
node:
create_table_stmt
: temporaryKw
, unloggedKw
, externalKw
, snapshotKw
, virtualKw
.drop_table_stmt
: temporaryKw
, externalKw
, snapshotKw
.into_table_clause
: temporaryKw
, unloggedKw
.sort_specification
node has been replaced with index_specification
node in places that reference indexes.constraint_primary_key
, create_index_stmt
, upsert_clause
.KEY
constraint is now parsed as constraint_primary_key
(instead of constraint_index
).doKw
field in upsert_clause
now has correct type: Keyword<"DO">
(instead of Keyword<"DOR">
).Improved CREATE TABLE
support:
FOREIGN KEY
TABLESPACE
& STORAGE
optionsUNION
option[NOT] ENFORCED
modifier on CHECK()
constraintImproved ALTER TABLE
support:
ALTER COLUMN
(SET {VISIBLE | INVISIBLE}
)ADD CONSTRAINT
DROP CONSTRAINT
ALTER CONSTRAINT
Almost complete CREATE TABLE
support:
DEFAULT expr
STORAGE
constraintCOMPRESSION
constraintGENERATED AS IDENTITY
UNIQUE NULLS [NOT] DISTINCT
SET NULL/DEFAULT
with columns inside REFERENCES
actionGLOBAL|LOCAL TEMP TABLE
UNLOGGED TABLE
NO INHERIT
constraint modifierCREATE TABLE .. INHERITS ()
PARTITION BY
clausePARTITION OF
MINVALUE & MAXVALUE FOR VALUES
FOR VALUES WITH ... MODULUS & REMAINDER
ON COMMIT
clauseTABLESPACE
clauseUSING
clauseWITH
clauseWITHOUT OIDS
clauseCREATE TABLE .. OF type
EXCLUDE
constraintLIKE
clause inside columns listWITH OPTIONS
column definitionsCREATE TABLE AS .. WITH [NO] DATA
Basic ALTER TABLE
support:
[ONLY] name [*]
CASCADE|RESTRICT in ALTER TABLE .. DROP COLUMN
ALTER COLUMN .. SET NOT NULL
ALTER COLUMN .. SET DATA TYPE
ADD CONSTRAINT
DROP CONSTRAINT
ALTER CONSTRAINT
RENAME CONSTRAINT
VALIDATE CONSTRAINT
Basic CREATE/DROP INDEX
support
Published by nene 10 months ago
glob()
, like()
, replace()
#53Published by nene 10 months ago
TruncateStmt.table
field to tables
which now contains ListExpr
ReturningClause
and ClusterByClause
types from AllSelectClauses
to AllOtherClauses
UpsertClause.columns
field to conflictTarget
MergeStmt
to MergeStmt
and MergeClause
(to accommodate WithClause
inside MergeStmt
)MergeActionInsert.values
field to clauses
UPDATE
statement
[ONLY] table [*]
SET col = DEFAULT
WHERE CURRENT OF
clauseDELETE
statement
[ONLY] table [*]
USING
clauseWHERE CURRENT OF
clauseTRUNCATE
statement
[ONLY] table [*]
CASCADE/RESTRICT
RESTART/CONTINUE IDENTITY
MERGE
statement
WITH
clause[ONLY] table [*]
OVERRIDING
clauseINSERT DEFAULT VALUES
DO NOTHING
actionINSERT
statement
ON CONFLICT
clauseON CONFLICT (expr)
ON CONFLICT ON CONSTRAINT
OVERRIDING
clauseYEAR_MONTH
keyword is now case-insensitive (like all others)Published by nene 10 months ago
asKw
field in func_call_with_column_definitions
node optional and changed type of funcCall
field.Published by nene 10 months ago
Fix parsing of SQLite PRIMARY KEY { ASC | DESC }
.
Published by nene 10 months ago
distinctKw
, hints
and asStructOrValueKw
fields in select_clause
with modifiers
field
mysql_hint
to mysql_modifier
DISTINCT
and ALL
not as plain keywords, but as new separate nodesAS STRUCT / VALUE
as select_as_struct
/ select_as_value
nodes.hints
field to modifiers
in insert_clause
, update_clause
, delete_clause
.ASC/DESC
keyword with sort_direction_*
nodes (both in order_by_clause
and constraint_primary_key
)tablesample_expr
to allow for custom methods, changing type of tablesampleKw
fieldROLLUP()
in GROUP BY
restriction, changing the type of columns
fieldUPDATE
, INSERT
, DELETE
inside WITH
clauseGROUP BY GROUPING SETS, CUBE(), ()
CYCLE
clause in WITH
SEARCH
clause in WITH
ORDER BY .. USING
operatorROWS FROM
LATERAL
subqueries and table functionsREPEATABLE
clause in TABLESAMPLE
table *
and ONLY table
inheritance syntaxSELECT DISTINCT ON ()
:=
syntax for named function arguments~
as both a unary and binary operatorOPERATOR()
syntaxTABLE
clause/statementexpr
field in common_table_expr
node!
operator support from SQLite~
operator precedence in PostgreSQLPublished by nene 10 months ago
insert_columns_clause
node. Reintroduced columns
field to insert_clause
. This effectively reverts the change done in 0.18.0.partitioned_table
. The partition_clause
node has been removed.array_bounds
node now uses empty
node instead of empty list_expr
node to represent missing number in definition like INT[]
.quantifier
field in quantifier_expr
node to quantifierKw
for consistency with other keyword-containing fields.pair_expr
node.rowsKw
field of fetch_clause
node is now mandatory. It was always present already, now also correct in type definition.GROUP BY DISTINCT
Published by nene 10 months ago
+
is now parsed as an operator, not as part of a numberdata_type
has been renamed to named_data_type
select_clause
columns are now optionalSymbolOperator
type is now plain string (because it needs to accommodate custom PostgreSQL operators)RowConstructor
type is now part of Expr
typePublished by nene 12 months ago
Add experimental support for Postgres. This is really more on the level of "please don't use it".
Published by nene over 1 year ago
Published by nene over 1 year ago
common_table_expression
to common_table_expr
(for consistency with other _expr
node types).paramTypes
now supports new type "@`name`"
#37cstVisitor
now supports skipping child nodes by returning VistorAction.SKIP
.