This repository was archived by the owner on Jul 15, 2021. It is now read-only.
Release v0.14.0
Added
-
Latest version includes smart error functionality from the tracer branch that was not included in the last few versions. The latest release includes the smart syntax functionality now that it is as performant as the previous release that did not include smart errors.
-
Parser can now be invoked synchronously or asynchronously:
var sqliteParser = require('sqlite-parser'); var query = 'select pants from laundry;'; // sync var ast = sqliteParser(query); console.log(ast); // async sqliteParser(query, function (err, ast) { if (err) { console.log(err); return; } console.log(ast); });
Changed
-
Upgrade sqlite-parser to ES2015
import sqliteParser from 'sqlite-parser'; const query = 'select name, color from cats;'; const ast = JSON.stringify(sqliteParser(query), null, 2); console.log(ast);
- Process is not complete, but as of now most of the parser, tests, and demo are now in ES2015.
-
Publish the browserified bundle in the sqlite-parser npm package under
dist/folder- This includes the un-minified
sqlite-parser.jswith sourcemaps and the minifiedsqlite-parser-min.jswithout sourcemaps (the default file as defined in thepackage.json).
- This includes the un-minified
-
Do not publish the intermediate files from the build process to github
- The
lib/anddist/folders are no longer in version control as a part of this github repository. - The
demo/folder is also removed from the master branch as well and must be built usinggrunt demoto use it (orgrunt liveto build the demo and serve it locally with livereload).
- The
Fixed
- Add
--cacheflag to pegjs compiler and reduce total rule count to increase performance of tracing parser and smart error functionality.- Early results show that
--cachemakes the tracer parser just as fast as the non-tracer branch for a moderate (~150kB) increase in file size. - Removing the number of whitespace rules reduced the chance of the process running out of memory while parsing larger queries.
- Early results show that
- Massive reduction in bundled parser size
- To help combat the extra size added from the
--cacheoption of pegjs, I reduced the size of the parser from416.89 kBto86.7 kB(~20% of the original size). I did this by switching pegjs option--optimizefromspeedtosizeand modifying [my fork of pegjs)(http://github.com/nwronski/pegjs) to allow rule descriptions to be looked up by rule index instead of by rule name as theoptimizesizemode required.
- To help combat the extra size added from the