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

Commit dba0692

Browse files
committed
Release v0.14.0.
1 parent 82856a5 commit dba0692

File tree

3 files changed

+59
-15
lines changed

3 files changed

+59
-15
lines changed

CHANGELOG.md

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,51 @@ All notable changes to this project will be documented in this file.
33

44
## [Unreleased][unreleased]
55

6+
## [v0.14.0] - 2016-03-11
7+
### Added
8+
- 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.
9+
- Parser can now be invoke synchronously or asynchronously:
10+
``` javascript
11+
var sqliteParser = require('sqlite-parser');
12+
var query = 'select pants from laundry;';
13+
// sync
14+
var ast = sqliteParser(query);
15+
console.log(ast);
16+
17+
// async
18+
sqliteParser(query, function (err, ast) {
19+
if (err) {
20+
console.log(err);
21+
return;
22+
}
23+
console.log(ast);
24+
});
25+
```
26+
27+
### Changed
28+
- Upgrade sqlite-parser to ES2015
29+
30+
``` javascript
31+
import sqliteParser from 'sqlite-parser';
32+
const query = 'select name, color from cats;';
33+
const ast = JSON.stringify(sqliteParser(query), null, 2);
34+
console.log(ast);
35+
```
36+
37+
- Process is not complete, but as of now most of the parser, tests, and demo are now in ES2015.
38+
- Publish the browserified bundle in the [sqlite-parser npm package](https://www.npmjs.com/package/sqlite-parser) under `dist/` folder
39+
- This includes the un-minified `sqlite-parser.js` with sourcemaps and the minified `sqlite-parser-min.js` without sourcemaps (the default file as defined in the `package.json`).
40+
- Do not publish the intermediate files from the build process to github
41+
- The `lib/` and `dist/` folders are no longer in version control as a part of this github repository.
42+
- The `demo/` folder is also removed from the master branch as well and must be built using `grunt demo` to use it (or `grunt live` to build the demo and serve it locally with livereload).
43+
44+
### Fixed
45+
- Add `--cache` flag to pegjs compiler and reduce total rule count to increase performance of tracing parser and smart error functionality.
46+
- 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.
47+
- Removing the number of whitespace rules reduced the chance of the process running out of memory while parsing larger queries.
48+
- Massive reduction in bundled parser size
49+
- To help combat the extra size added from the `--cache` option of pegjs, I reduced the size of the parser from `416.89 kB` to `86.7 kB` (~20% of the original size). I did this by switching pegjs option `--optimize` from `speed` to `size` 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 the `optimize` `size` mode required.
50+
651
## [v0.11.3] - 2016-02-02
752
### Fixed
853
- Added missing binary division operator so that things like this will now correctly parse.
@@ -484,7 +529,8 @@ part of table names, column names, aliases, etc... This also addresses issues th
484529
### Added
485530
- First working version of sqlite-parser
486531

487-
[unreleased]: https://github.com/codeschool/sqlite-parser/compare/v0.11.3...HEAD
532+
[unreleased]: https://github.com/codeschool/sqlite-parser/compare/v0.14.0...HEAD
533+
[v0.14.0]: https://github.com/codeschool/sqlite-parser/compare/v0.11.3...v0.14.0
488534
[v0.11.3]: https://github.com/codeschool/sqlite-parser/compare/v0.11.2...v0.11.3
489535
[v0.11.2]: https://github.com/codeschool/sqlite-parser/compare/v0.11.0...v0.11.2
490536
[v0.11.0]: https://github.com/codeschool/sqlite-parser/compare/v0.10.2...v0.11.0

README.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
[![devDependencies Status Image](https://img.shields.io/david/dev/codeschool/sqlite-parser.svg)](https://github.com/codeschool/sqlite-parser/)
66
[![License Type Image](https://img.shields.io/github/license/codeschool/sqlite-parser.svg)](https://github.com/codeschool/sqlite-parser/blob/master/LICENSE)
77

8-
## This branch is a work-in-progress
9-
_Note: There is a currently a significant performance penalty (14x) to using this branch for the smart-error functionality._
10-
118
This library parses SQLite queries, using JavaScript, and generates
129
_abstract syntax tree_ (AST) representations of the input strings. A
1310
syntax error is produced if an AST cannot be generated.
@@ -37,18 +34,19 @@ containing SQL to parse and a callback function. The function will invoke
3734
the callback function with the AST object generated from the source string.
3835

3936
``` javascript
40-
// Standard usage
41-
var sqliteParser = require('sqlite-parser'),
42-
sampleSQL = "SELECT type, quantity FROM apples WHERE amount > 1";
43-
44-
sqliteParser(sampleSQL, function (err, res) {
37+
var sqliteParser = require('sqlite-parser');
38+
var query = 'select pants from laundry;';
39+
// sync
40+
var ast = sqliteParser(query);
41+
console.log(ast);
42+
43+
// async
44+
sqliteParser(query, function (err, ast) {
4545
if (err) {
46-
// Error
4746
console.log(err);
48-
} else {
49-
// Result AST
50-
console.log(res);
47+
return;
5148
}
49+
console.log(ast);
5250
});
5351
```
5452

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "sqlite-parser",
33
"description": "JavaScript implentation of SQLite 3 query parser",
4-
"author": "Code School (http://codeschool.com)",
5-
"version": "0.11.3",
4+
"author": "Nick Wronski <nick@javascript.com>",
5+
"version": "0.14.0",
66
"contributors": [
77
"Nick Wronski <nick@javascript.com>"
88
],

0 commit comments

Comments
 (0)