This repository was 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, andtypeshould always be lowercase, even when uppercase in the input SQL (e.g.,variantis nownatural joininstead ofNATURAL JOINin the AST). -
BREAKING CHANGE New format for
CASEexpression AST nodes:variantwhenhas aconditionand aconsequentvariantelsehas just aconsequent- the outer
expressionis nowvariantcaseinstead ofbinary - instead of taking whatever is provided between
CASEandWHEN(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
EXISTSexpression nodes. Useexpressionnode inconditionforIF NOT EXISTS.NOT EXISTS, andEXISTSmodifiers instead of a string value.-
CREATE TABLEstatementcreate 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 TABLEstatementdrop 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 EXISTSexpressionselect 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" } ] }
-