This repository has been archived by the owner on Jul 15, 2021. It is now read-only.
Release v1.0.0-rc2
Pre-release
Pre-release
Changed
-
BREAKING CHANGE All named values for properties such as
variant
,format
, andtype
should always be lowercase, even when uppercase in the input SQL (e.g.,variant
is nownatural join
instead ofNATURAL JOIN
in the AST). -
BREAKING CHANGE New format for
CASE
expression AST nodes:variant
when
has acondition
and aconsequent
variant
else
has just aconsequent
- the outer
expression
is nowvariant
case
instead ofbinary
- instead of taking whatever is provided between
CASE
andWHEN
(e.g.,CASE foo WHEN ...
) and calling that the expression, it is now added as thediscriminant
select case acc when a = 0 then a1 when a = 1 then b1 else c1 end
{ "type": "expression", "variant": "case", "expression": [ { "type": "condition", "variant": "when", "condition": { "type": "expression", "format": "binary", "variant": "operation", "operation": "=", "left": { "type": "identifier", "variant": "column", "name": "a" }, "right": { "type": "literal", "variant": "decimal", "value": "0" } }, "consequent": { "type": "identifier", "variant": "column", "name": "a1" } }, { "type": "condition", "variant": "when", "condition": { "type": "expression", "format": "binary", "variant": "operation", "operation": "=", "left": { "type": "identifier", "variant": "column", "name": "a" }, "right": { "type": "literal", "variant": "decimal", "value": "1" } }, "consequent": { "type": "identifier", "variant": "column", "name": "b1" } }, { "type": "condition", "variant": "else", "consequent": { "type": "identifier", "variant": "column", "name": "c1" } } ], "discriminant": { "type": "identifier", "variant": "column", "name": "acc" } }
-
BREAKING CHANGE New format for
EXISTS
expression nodes. Useexpression
node incondition
forIF NOT EXISTS
.NOT EXISTS
, andEXISTS
modifiers instead of a string value.-
CREATE TABLE
statementcreate table if not exists foo(id int)
{ "type": "statement", "name": { "type": "identifier", "variant": "table", "name": "foo" }, "variant": "create", "format": "table", "definition": [ { "type": "definition", "variant": "column", "name": "id", "definition": [], "datatype": { "type": "datatype", "variant": "int", "affinity": "integer" } } ], "condition": [ { "type": "condition", "variant": "if", "condition": { "type": "expression", "variant": "exists", "operator": "not exists" } } ] }
-
DROP TABLE
statementdrop table if exists foo
{ "type": "statement", "target": { "type": "identifier", "variant": "table", "name": "foo" }, "variant": "drop", "format": "table", "condition": [ { "type": "condition", "variant": "if", "condition": { "type": "expression", "variant": "exists", "operator": "exists" } } ] }
-
NOT EXISTS
expressionselect a where not exists (select b)
{ "type": "statement", "variant": "select", "result": [ { "type": "identifier", "variant": "column", "name": "a" } ], "where": [ { "type": "expression", "format": "unary", "variant": "exists", "expression": { "type": "statement", "variant": "select", "result": [ { "type": "identifier", "variant": "column", "name": "b" } ] }, "operator": "not exists" } ] }
-