v0.8.0
Added
- additional rule descriptions in
grammar.pegjs - added several array methods (e.g.:
findLast(),takeRight(),pluck()) so that I could removelodashas a dependency of the "smart error"Tracerclass
Changed
- updated grammar to remove all dependence on
modifierclause as it was being used as a catch-all clause for stray parts of statements - created
deferclause - normalized format for common clauses and nodes across different statement types
- removed
rangevariant that was part ofBETWEENexpressions - renamed several clauses to match the SQL keywords and/or SQLite manual descriptions used to define them
- for
WITHOUT ROWIDinCREATE TABLE:modifier->optimization - for
IF NOT EXISTSin all places:modifier:condition
- for
- cleaned up css in the interactive demo
- removed
lodashdependency in coreTracer.lodashis now only adevDependencyagain!
Fixed
-
fixed error reporting when there is more than one statement in the input SQL.
- still need to make sure previous tree is not used if a subsequent statement has an error at the highest level
SELECT * FROM cats; SELECT * d
-
fixed rules for double-quoted, backticked, and bracketed identifiers to allow for escapes, leading or trailing spaces, and the full character set that is legal for quoted identifiers, where allowed.
-
fixed datatype names that did not display correctly in generated AST. fixed string literal definition to allow all possible input
-
fixed value format for direction key in
PRIMARY KEYtable conatrainsts -
do not show parenthesis in error message for syntax error when there is nothing to put inside them.
-
fixes for css in demo. for example, demo layout off by 1px when at smallest resolution, did a lot of cleanup on demo styles, responsive layout, error notification. also, changed error message format for smart errors.
Notes
- to support the "smart errors" changes were made to the
pegjslibrary code inlib/compiler/passes/generate-javascript.js. this was done to allowTracerto get thedescriptionnames for the rules that are referenced in the error messages. will need to forkpegjsto get the changes topegjscore into version control so they are not accidentally overwritten. - considering removing the
promisedependency from the coresqlite-parserlibrary beforev1.0.0, as well, so that the parser can be dependency free as a standalone library. people could choose to "promisify" the parser or just use it synchronously instead of being forced to bundle thepromisedependency when bundling this package for use in the browser. It actually looks like all the evergreen browsers except IE currently support a nativePromiseimplementation, so having a non-nativePromiseimplementation as a dependency will probably be obsolete pretty soon.