This repository has been 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.js
with sourcemaps and the minifiedsqlite-parser-min.js
without 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 demo
to use it (orgrunt live
to build the demo and serve it locally with livereload).
- The
Fixed
- Add
--cache
flag to pegjs compiler and reduce total rule count to increase performance of tracing parser and smart error functionality.- Early results show that
--cache
makes 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
--cache
option of pegjs, I reduced the size of the parser from416.89 kB
to86.7 kB
(~20% of the original size). I did this by switching pegjs option--optimize
fromspeed
tosize
and 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 theoptimize
size
mode required.
- To help combat the extra size added from the