Skip to content

Releases: nene/sql-parser-cst

v0.30.0

17 Nov 18:28
Compare
Choose a tag to compare

New features

  • Added acceptUnsupportedGrammar option. See README for details.

0.29.1

16 Nov 17:26
Compare
Choose a tag to compare

Expose DOMAIN and TYPE types as top-level exports.

0.29.0

16 Nov 16:46
Compare
Choose a tag to compare

Breaking changes

  • Renamed NamedDataType.nameKw field to .name (2b1e63b)
  • Changed the fields of CastOperatorExpr type: (ed61635)
    • expr -> left
    • dataType -> right
    • added operator field with single possible value "::"

PostgreSQL improvements:

  • Support CREATE/ALTER/DROP DOMAIN (fully) (#78)
  • Support CREATE/ALTER/DROP TYPE (partially) (#78)
  • Support chaining of multiple :: cast expressions (#85)
  • Support quoted identifiers as :: cast operator parameters (#85)

SQLite improvements:

  • Support COLUMN and KEY as identifiers in SQLite (#80)

Other fixes

  • Fix some mistakes in type definitions (#76)

0.28.1

05 Aug 07:30
Compare
Choose a tag to compare

Improvements

  • Support MySQL set syntax (thanks to YuMuuu) #81

Continuous integration improvements

  • Add Prettier check setting (thanks to YuMuuu) #83
  • Add Node 18 and 20 to CI (tanks to YuMuuu) #82

0.28.0

26 Mar 14:25
Compare
Choose a tag to compare

Breaking changes

  • Use TriggerEventExpr instead of plain TriggerEvent (d5ca16d)
  • Extract timeKw from TriggerEvent (9e0d309)
  • Extract TriggerTarget from TriggerEvent (d37a94b)
  • Rename TriggerCondition to WhenClause (7cd0758)
  • Replace CreateTriggerStmt.eachKw and .when fields with .clauses (56a69b4)
  • Don't parse unicode escapes in PostgreSQL unicode strings and identifiers (f715a15)

Improved PostgreSQL support

  • Support FILTER() in aggregate functions
  • Revert an accidental change to row_constructor syntax
  • Support PostgreSQL TRIGGER syntax:
    • Support CREATE TRIGGER
    • Support REFERENCING clause in TRIGGER
    • Support trigger timing clause
    • Support trigger FROM clause
    • Support FOR EACH clause
    • Support TRUNCATE event
  • Support ALTER PROCEDURE & ALTER FUNCTION
  • Support newline-separated strings, E'strings' and U&'strings'
  • Support UESCAPE in unicode strings & identifiers
  • Support underscores in number literals
  • Update keywords list for PostgreSQL 16 (add SYSTEM_USER)

0.27.1

13 Feb 19:44
Compare
Choose a tag to compare

New parameter type: $nr

  • The paramTypes option now accepts "$nr", to match parameters in the form of $1, $2, $3

0.27.0

07 Feb 16:32
Compare
Choose a tag to compare

Breaking changes

  • Various changes to AlterActionAddConstraint node to support BigQuery ADD CONSTRAINT IF NOT EXISTS syntax (72dadd1)
  • Moved ReindexStmt from AllSqliteNodes to AllIndexNodes (79b68c2)
  • Moved IndexSpecification from AllConstraintNodes to AllIndexNodes (2ba172f)
  • Moved IndexIncludeClause from AllConstraintNodes to AllIndexNodes to support INCLUDE (...) in CREATE INDEX (bde541a)
  • CreateIndexStmt.name field is now optional (e90647d)
  • The CreateViewStmt.columns field now contains list of ColumnDefinition nodes instead of just list of Identifier nodes. (1ba2459)

Support for latest BigQuery (as of 31. January 2024)

  • PRIMARY KEY constraint
  • FOREIGN KEY constraint
  • ALTER 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 list
  • CREATE MATERIALIZED VIEW AS REPLICA OF
  • VECTOR_SEARCH() function
  • CREATE VECTOR INDEX
  • GROUPING() function
  • GROUP BY .. GROUPING SETS / CUBE / ROLLUP
  • quantified LIKE operator

Improved PostgreSQL support

  • CREATE INDEX statement
  • DROP INDEX statement
  • ALTER INDEX statement
  • REINDEX statement
  • Parameters for opclass (mainly in the context of CREATE INDEX)

0.26.0

03 Feb 14:16
Compare
Choose a tag to compare

Breaking changes

  • Replace TableKind, ViewKind and SequenceKind nodes with RelationKind.

Bugfixes

  • The above also fixes the issue of CreateViewStmt.kind field containing TableKind not ViewKind (#68)

0.25.0

02 Feb 09:36
Compare
Choose a tag to compare

Breaking changes

  • Introduced AlterTableAllInTablespaceStmt alongsideAlterTableStmt statement. This means the addition of AllAlterTableNodes and AllAlterTableStatements types (7c546fd)
  • Renamed WithStorageParametersClause to PostgresqlWithOptions (4052303)
  • Renamed AlterActionSetOptions to AlterActionSetBigqueryOptions (b21538f)
  • All VIEW nodes are now exported as AllViewNodes, the AllViewStatements is still exported, but no more includes all
    view-related nodes. (0fcf413)
  • Replaced *Kw fields in CreateViewStmt with kinds: ViewKind[] (c8beba7)
  • Renamed CreateTableTablespaceClause to TablespaceClause (f2f6b79)
  • Renamed CreateTableWithDataClause to WithDataClause (32c64f1)
  • Replaced materializedKw field with kind in CreateViewStmt & DropViewStmt (b636853)
  • Renamed DropSchemaStmt.name field to schemas (e41a9fc)
  • AlterViewStmt.actions now contains ListExpr (4ab708d)
  • Renamed AlterActionRenameTable to AlterActionRename (2aa2314)
  • Renamed CreateSchemaStmt.options field to clauses (a3aa401)
  • CreateSchemaStmt.name field is now optional (397b146)
  • Renamed TruncateStmt.cascadeOrRestrictKw field to behaviorKw (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 nested CREATE TRIGGER and GRANT statements)

0.24.0

27 Jan 12:21
Compare
Choose a tag to compare

Breaking changes

  • Removed 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.

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 optional atomicKw field. To allow for PostgreSQL-specific BEGIN ATOMIC ... END syntax.