Releases: nene/sql-parser-cst
Releases · nene/sql-parser-cst
0.25.0
Breaking changes
- Introduced
AlterTableAllInTablespaceStmt
alongsideAlterTableStmt
statement. This means the addition ofAllAlterTableNodes
andAllAlterTableStatements
types (7c546fd) - Renamed
WithStorageParametersClause
toPostgresqlWithOptions
(4052303) - Renamed
AlterActionSetOptions
toAlterActionSetBigqueryOptions
(b21538f) - All
VIEW
nodes are now exported asAllViewNodes
, theAllViewStatements
is still exported, but no more includes all
view-related nodes. (0fcf413) - Replaced
*Kw
fields inCreateViewStmt
withkinds: ViewKind[]
(c8beba7) - Renamed
CreateTableTablespaceClause
toTablespaceClause
(f2f6b79) - Renamed
CreateTableWithDataClause
toWithDataClause
(32c64f1) - Replaced
materializedKw
field withkind
inCreateViewStmt
&DropViewStmt
(b636853) - Renamed
DropSchemaStmt.name
field toschemas
(e41a9fc) AlterViewStmt.actions
now containsListExpr
(4ab708d)- Renamed
AlterActionRenameTable
toAlterActionRename
(2aa2314) - Renamed
CreateSchemaStmt.options
field toclauses
(a3aa401) CreateSchemaStmt.name
field is now optional (397b146)- Renamed
TruncateStmt.cascadeOrRestrictKw
field tobehaviorKw
(0d7eee4)
Improved PostgreSQL support
- Finalized support for
CREATE TABLE
- Full support for
CREATE FOREIGN TABLE
- Full support for
ALTER TABLE
- Full support for
CREATE/DROP/ALTER SEQUENCE
- Full support for
CREATE/ALTER/DROP VIEW
- Full support for
CREATE/ALTER/DROP MATERIALIZED VIEW
- Full support for
REFRESH MATERIALIZED VIEW
- Full support for
ALTER/DROP SCHEMA
- Nearly full support for
CREATE SCHEMA
(only missing support of nestedCREATE TRIGGER
andGRANT
statements)
0.24.0
Breaking changes
- Removed
procedure_param
node. Thefunction_param
node is now used in bothCREATE FUNCTION
andCREATE PROCEDURE
statements. function_param
node now contains themode
field that was part ofprocedure_param
.name
field offunction_param
is now optional.
Improved PostgreSQL support
- Full support for
CREATE FUNCTION
DROP FUNCTION
CREATE PROCEDURE
DROP PROCEDURE
- See #63 for details.
Other changes
block_stmt
node now contains optionalatomicKw
field. To allow for PostgreSQL-specificBEGIN ATOMIC ... END
syntax.
0.23.0
Breaking changes
- The
constraint_deferrable
node has been replaced with array ofconstraint_modifier
nodes.
Accordingly thedeferrable
field inconstraint
node has been renamed tomodifiers
. onConflict
field has been replaced withclauses
array.
The affects:constraint_primary_key
,constraint_unique
,constraint_check
,constraint_not_null
.- Various
*Kw
fields have been replaced withkind
field that containstable_kind
node:- in
create_table_stmt
:temporaryKw
,unloggedKw
,externalKw
,snapshotKw
,virtualKw
. - in
drop_table_stmt
:temporaryKw
,externalKw
,snapshotKw
. - in
into_table_clause
:temporaryKw
,unloggedKw
.
- in
- The
sort_specification
node has been replaced withindex_specification
node in places that reference indexes.
This effects:constraint_primary_key
,create_index_stmt
,upsert_clause
.
Bugfixes
- MySQL column
KEY
constraint is now parsed asconstraint_primary_key
(instead ofconstraint_index
). doKw
field inupsert_clause
now has correct type:Keyword<"DO">
(instead ofKeyword<"DOR">
).
Improved MySQL/MariaDB support
-
Improved
CREATE TABLE
support:- Support index name in
FOREIGN KEY
- Support
TABLESPACE
&STORAGE
options - Support
UNION
option - Support
[NOT] ENFORCED
modifier onCHECK()
constraint
- Support index name in
-
Improved
ALTER TABLE
support:- Support
ALTER COLUMN
(SET {VISIBLE | INVISIBLE}
) - Support
ADD CONSTRAINT
- Support
DROP CONSTRAINT
- Support
ALTER CONSTRAINT
- Support
Improved PostgreSQL support
-
Almost complete
CREATE TABLE
support:- Support
DEFAULT expr
- Support
STORAGE
constraint - Support
COMPRESSION
constraint - Support
GENERATED AS IDENTITY
- Support
UNIQUE NULLS [NOT] DISTINCT
- Support
SET NULL/DEFAULT
with columns insideREFERENCES
action - Support
GLOBAL|LOCAL TEMP TABLE
- Support
UNLOGGED TABLE
- Support
NO INHERIT
constraint modifier - Support
CREATE TABLE .. INHERITS ()
- Support
PARTITION BY
clause - Support
PARTITION OF
- Support
MINVALUE & MAXVALUE FOR VALUES
- Support
FOR VALUES WITH ... MODULUS & REMAINDER
- Support
ON COMMIT
clause - Support
TABLESPACE
clause - Support
USING
clause - Support
WITH
clause - Support
WITHOUT OIDS
clause - Support
CREATE TABLE .. OF type
- Support
EXCLUDE
constraint - Support
LIKE
clause inside columns list - Support index parameter clauses
- Support
WITH OPTIONS
column definitions - Support
CREATE TABLE AS .. WITH [NO] DATA
- Support
-
Basic
ALTER TABLE
support:- Support
[ONLY] name [*]
- Support
CASCADE|RESTRICT in ALTER TABLE .. DROP COLUMN
- Support
ALTER COLUMN .. SET NOT NULL
- Support basic
ALTER COLUMN .. SET DATA TYPE
- Support
ADD CONSTRAINT
- Support
DROP CONSTRAINT
- Support
ALTER CONSTRAINT
- Support
RENAME CONSTRAINT
- Support
VALIDATE CONSTRAINT
- Support
-
Basic
CREATE/DROP INDEX
support
0.22.1
0.22.0
Breaking changes
- Renamed
TruncateStmt.table
field totables
which now containsListExpr
- Moved
ReturningClause
andClusterByClause
types fromAllSelectClauses
toAllOtherClauses
- Renamed
UpsertClause.columns
field toconflictTarget
- Divided
MergeStmt
toMergeStmt
andMergeClause
(to accommodateWithClause
insideMergeStmt
) - Renamed
MergeActionInsert.values
field toclauses
Improved PostgreSQL support
- Full support for
UPDATE
statement- Support
[ONLY] table [*]
- Support
SET col = DEFAULT
- Support
WHERE CURRENT OF
clause
- Support
- Full support for
DELETE
statement- Support
[ONLY] table [*]
- Support
USING
clause - Support
WHERE CURRENT OF
clause
- Support
- Full support for
TRUNCATE
statement- Support
[ONLY] table [*]
- Support multiple tables
- Support
CASCADE/RESTRICT
- Support
RESTART/CONTINUE IDENTITY
- Support
- Full support for
MERGE
statement- Support
WITH
clause - Support
[ONLY] table [*]
- Support
OVERRIDING
clause - Support
INSERT DEFAULT VALUES
- Support
DO NOTHING
action
- Support
- Almost full support for
INSERT
statement- Support
ON CONFLICT
clause - Support
ON CONFLICT (expr)
- Support
ON CONFLICT ON CONSTRAINT
- Support
OVERRIDING
clause
- Support
Bugfixes
- Fixed some serious performance regressions, especially when parsing PostgreSQL (#52)
YEAR_MONTH
keyword is now case-insensitive (like all others)
0.21.2
0.21.1
0.21.0
Breaking changes
- Replace
distinctKw
,hints
andasStructOrValueKw
fields inselect_clause
withmodifiers
field- Rename
mysql_hint
tomysql_modifier
- Parse
DISTINCT
andALL
not as plain keywords, but as new separate nodes - Parse
AS STRUCT / VALUE
asselect_as_struct
/select_as_value
nodes.
- Rename
- Rename
hints
field tomodifiers
ininsert_clause
,update_clause
,delete_clause
. - Replace plain
ASC/DESC
keyword withsort_direction_*
nodes (both inorder_by_clause
andconstraint_primary_key
) - Change
tablesample_expr
to allow for custom methods, changing type oftablesampleKw
field - Remove single
ROLLUP()
inGROUP BY
restriction, changing the type ofcolumns
field
PostgreSQL support
- Query syntax:
- Support
UPDATE
,INSERT
,DELETE
insideWITH
clause - Support
GROUP BY GROUPING SETS, CUBE(), ()
- Support
CYCLE
clause inWITH
- Support
SEARCH
clause inWITH
- Support
ORDER BY .. USING
operator - Support column aliases in table aliases
- Support table function with column definitions
- Support
ROWS FROM
- Support
LATERAL
subqueries and table functions - Support
REPEATABLE
clause inTABLESAMPLE
- Support
table *
andONLY table
inheritance syntax - Support
SELECT DISTINCT ON ()
- Support
- Operators:
- Support
:=
syntax for named function arguments - Support
~
as both a unary and binary operator - Support
OPERATOR()
syntax
- Support
Bugfixes
- Properly support full table names in
TABLE
clause/statement - Restrict the type of
expr
field incommon_table_expr
node - Remove
!
operator support from SQLite - Fix
~
operator precedence in PostgreSQL
Internals
- Switch to Peggy 3
0.20.0
Breaking changes
- Removed
insert_columns_clause
node. Reintroducedcolumns
field toinsert_clause
. This effectively reverts the change done in 0.18.0. - Related to the above, PARTITION selection in MySQL INSERT and DELETE statements is now parsed as
partitioned_table
. Thepartition_clause
node has been removed. - PostgreSQL
array_bounds
node now usesempty
node instead of emptylist_expr
node to represent missing number in definition likeINT[]
. - Renamed
quantifier
field inquantifier_expr
node toquantifierKw
for consistency with other keyword-containing fields. - Dropped unused
pair_expr
node.
New Features
- Named function arguments are now supported for PostgreSQL.
Bugfixes
- The
rowsKw
field offetch_clause
node is now mandatory. It was always present already, now also correct in type definition. - Fixed parsing of PostgreSQL
GROUP BY DISTINCT
- Fixed parsing of MySQL full text match expressions.
0.19.0
Breaking changes
- Unary
+
is now parsed as an operator, not as part of a number data_type
has been renamed tonamed_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 ofExpr
type
SQLite bugfixes
- Support unicode letters in SQLite identifiers
Improved PostgreSQL support
- Use the actual Postgres reserved words list
- Nested block-comments
- Remove incorrect #-comment support from Postgres
- Strings:
- Dollar-quoted strings
- String with C-style escapes
- Unicode strings
- Repeated-quote escapes in E-strings
- Bit-string blobs
- Identifiers:
- Unicode identifiers
- Literals:
- JSON & JSONB literals
- INTERVAL literals
- ROW() constructor
- EXTRACT() expression
- Special paren-less functions
- All keywords can be used in explicit aliases
- Operators:
- IS UNKNOWN
- IS DISTINCT FROM
- ISNULL
- NOTNULL
- % operator
- ^ operator
- || operator
- Bitwise ~ and # operators
- ILIKE
- BETWEEN SYMMETRIC
- SIMILAR TO
- IS NORMALIZED
- AT TIME ZONE
- COLLATE
- Array-access operator
- Array-slice operator
- :: cast operator
- All the builtin PostgreSQL operators
- Almost fully correct PostgreSQL operator precedence
- Types:
- All builtin data types
- Special Object Identifier types
- multi-dimensional array types
- TIME types WITH/WITHOUT TIME ZONE
- INTERVAL type
- Custom data types
- SELECT support:
- Support NULLS FIRST/LAST
- LIMIT offset,count is not supported
- Support FETCH..OFFSET
- Support FOR-clause
- Support INTO TABLE clause
- Support empty SELECT
- Support GROUP BY DISTINCT
- Support LIMIT ALL
- Support basic TABLE clause
- Basic TRUNCATE support
- Basic ANALYZE support
- Basic EXPLAIN support
- Basic EXECUTE support
Improved MySQL & MariaDB support
- Support FOR-clause in MySQL and MariaDB
- Support LOCK IN SHARE MODE in MySQL/MariaDB