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
+24Lines changed: 24 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -45,6 +45,30 @@ All notable changes to this project will be documented in this file.
45
45
});
46
46
```
47
47
48
+
- To pipe the output into a file that contains a single valid JSON structure, the output of the parser steam transform needs to be wrapped in statement list node where every statement is separated by a comma.
49
+
50
+
``` javascript
51
+
var fs = require('fs');
52
+
var sqliteParser = require('sqlite-parser');
53
+
var parserTransform = sqliteParser.createParser();
54
+
var singleNodeTransform = sqliteParser.createStitcher();
55
+
var readStream = fs.createReadStream('./large-input-file.sql');
56
+
var writeStream = fs.createWriteStream('./large-output-file.json');
57
+
58
+
readStream.pipe(parserTransform);
59
+
parserTransform.pipe(singleNodeTransform);
60
+
singleNodeTransform.pipe(writeStream);
61
+
62
+
parserTransform.on('error', function (err) {
63
+
console.error(err);
64
+
process.exit(1);
65
+
});
66
+
67
+
writeStream.on('finish', function () {
68
+
process.exit(0);
69
+
});
70
+
```
71
+
48
72
- Added missing `ATTACH DATABASE`statement. It will pair nicely with the existing `DETACH DATABASE` statement.
0 commit comments