Skip to content
This repository has been archived by the owner on Jul 15, 2021. It is now read-only.

v0.3.1

Compare
Choose a tag to compare
@nwronski nwronski released this 14 Jul 04:27
· 258 commits to master since this release

Added

  • rules line and block comments

  • specs for comment types

    -- Line comment
    /*
    * Block comment /* nested comment */
    */
  • rules for CREATE INDEX

  • specs for CREATE INDEX statement

  • CREATE TRIGGER syntax and AST

  • specs for CREATE TRIGGER statement

  • specs for some expression grouping issues that were experienced when using binary and unary expressions along with AND, OR

    CREATE INDEX `bees`.`hive_state`
    ON `hive` (`happiness` ASC, `anger` DESC)
    WHERE
      `happiness` ISNULL AND `anger` > 0
  • CREATE VIEW syntax and AST

  • specs for CREATE VIEW statement

  • CREATE VIRTUAL TABLE syntax and AST

  • specs for CREATE VIRTUAL TABLE statement

  • allow subquery in parenthesis within FROM clause

  • New specs: Basic Drop Table, Basic Drop Trigger, Basic Function, Basic Subquery, Basic Union, Create Check 1, Create Check 2, Create Foreign Key 1, Create Foreign Key 2, Create Primary Key 1, Create Table Alt Syntax, Expression Like, Expression Table 1, Expression Unary 1, Function Mixed Args, Insert Into Default, Join Types 1, Join Types 2, Select Parts 1, Select Qualified Table 1, Transaction Rollback

  • LICENSE file added

  • .npmignore file added

Changed

  • updated rules and specs to remove use of modifier property in AST

  • allow multiple expressions for GROUP BY clause

    SELECT color, type, name
    FROM hats
    GROUP BY type, color
  • changed AST for create table, constraints, joins, select parts, transactions, unions, triggers to pass new specs

  • INSERT statement VALUES clause AST normalized for value lists and DEFAULT VALUES

    {
      "type": "values",
      "variant": "list",
      "values": []
    },
    {
      "type": "values",
      "variant": "default",
      "values": null
    }
  • normalized AST across all column constraints and table constraints. all table constraints are {"type": "definition", "variant": "constraint"} and contain a definition array that contains the constraint. the constraint in definitions has the same format as the column constraint definition.

  • updated package dependencies

  • index.js file moved to file root, duplicate copies in lib/ and src/ removed

  • going to try and keep (most significant) version numbers synchronized between sqlite-parser and sqlite-tree to avoid confusion going forward

Fixed

  • some grouping errors for unary operators, unary null and binary concatenation

  • The CREATE VIRTUAL TABLE statement previously only worked with expression arguments. Fixed by checking for a column name followed by a type definition or column constraint before assuming the type is an expression list, if these things are found, then treat the arguments as a set of source definitions as in a creation statement for a table.

    CREATE VIRTUAL TABLE happy_table
    USING happy_module(...);
    
      id int -- treat as definitions for CREATE TABLE
      x != 2 -- treat as an expression list
  • allow for nested parenthesis

  • allow multiple binary expressions and concatenation operators within parenthesis

    SELECT *
    FROM hats
    WHERE
      hat OR (shirt AND (shoes OR wig) AND pants)

Notes

  • CREATE VIRTUAL TABLE currently only works with expression arguments and does not support passing column definitions and/or table constraint definitions as is allowed in the SQLite spec for virtual table module arguments.

    CREATE VIRTUAL TABLE vtrl_ads
    USING tbl_creator(
      id int PRIMARY KEY,
      name varchar(50),
      category varchar(15),
      cost int);