You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 15, 2021. It is now read-only.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+26Lines changed: 26 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,32 @@ All notable changes to this project will be documented in this file.
19
19
}
20
20
```
21
21
22
+
- There is now a command line version of the parser when it is installed as a global module (e.g., `npm i -g sqlite-parser`). The `sqlite-parser` command is then available to use to parse input SQL files and write the results to stdout or a JSON file. Additional usage instructions and options available through `sqlite-parser --help`.
23
+
24
+
```
25
+
sqlite-parser input.sql --output foo.json
26
+
```
27
+
28
+
- To allow users to parse arbitrarily long SQL files or other readable stream sources, there is now a stream transform that can accept a readable stream and then push (write) out JSON strings of the ASTs for individual statements.
29
+
- The AST for each statement is pushed down the stream as soon as it is read and parsed instead of reading the entire file into memory before parsing begins.
30
+
31
+
```javascript
32
+
var parserTransform =require('sqlite-parser').createParser();
33
+
var readStream =require('fs').createReadStream('./large-input-file.sql');
34
+
35
+
readStream.pipe(parserTransform);
36
+
parserTransform.pipe(process.stdout);
37
+
38
+
parserTransform.on('error', function (err) {
39
+
console.error(err);
40
+
process.exit(1);
41
+
});
42
+
43
+
parserTransform.on('finish', function () {
44
+
process.exit(0);
45
+
});
46
+
```
47
+
22
48
- Added missing `ATTACH DATABASE`statement. It will pair nicely with the existing `DETACH DATABASE` statement.
0 commit comments