pgsql-parser 13.3.9 → 13.3.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/README.md +1 -1
- package/main/index.js +4 -2
- package/module/index.js +4 -2
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,30 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [13.3.12](https://github.com/pyramation/pgsql-parser/compare/pgsql-parser@13.3.11...pgsql-parser@13.3.12) (2022-07-29)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package pgsql-parser
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [13.3.11](https://github.com/pyramation/pgsql-parser/compare/pgsql-parser@13.3.10...pgsql-parser@13.3.11) (2022-05-20)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package pgsql-parser
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [13.3.10](https://github.com/pyramation/pgsql-parser/compare/pgsql-parser@13.3.9...pgsql-parser@13.3.10) (2022-05-19)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package pgsql-parser
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
6
30
|
## [13.3.9](https://github.com/pyramation/pgsql-parser/compare/pgsql-parser@13.3.8...pgsql-parser@13.3.9) (2022-04-19)
|
|
7
31
|
|
|
8
32
|
**Note:** Version bump only for package pgsql-parser
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# pgsql-parser [](https://github.com/pyramation/pgsql-parser/actions/workflows/run-tests.yaml)
|
|
2
2
|
|
|
3
3
|
The real PostgreSQL parser for nodejs. The primary objective of this module is to provide symmetric parsing and deparsing of SQL statements. With this module you can modify parts of a SQL query statement and serialize the query tree back into a formatted SQL statement. It uses the *real* [PostgreSQL parser](https://github.com/pganalyze/libpg_query).
|
|
4
4
|
|
package/main/index.js
CHANGED
|
@@ -40,11 +40,13 @@ var parse = function parse(sql) {
|
|
|
40
40
|
var result = (0, _libpgQuery.parseQuerySync)(sql);
|
|
41
41
|
return result.stmts.map(function (_ref) {
|
|
42
42
|
var stmt = _ref.stmt,
|
|
43
|
-
stmt_len = _ref.stmt_len
|
|
43
|
+
stmt_len = _ref.stmt_len,
|
|
44
|
+
stmt_location = _ref.stmt_location;
|
|
44
45
|
return {
|
|
45
46
|
RawStmt: {
|
|
46
47
|
stmt: stmt,
|
|
47
|
-
stmt_len: stmt_len
|
|
48
|
+
stmt_len: stmt_len,
|
|
49
|
+
stmt_location: stmt_location || 0
|
|
48
50
|
}
|
|
49
51
|
};
|
|
50
52
|
});
|
package/module/index.js
CHANGED
|
@@ -6,12 +6,14 @@ export const parse = sql => {
|
|
|
6
6
|
const result = parseQuerySync(sql);
|
|
7
7
|
return result.stmts.map(({
|
|
8
8
|
stmt,
|
|
9
|
-
stmt_len
|
|
9
|
+
stmt_len,
|
|
10
|
+
stmt_location
|
|
10
11
|
}) => {
|
|
11
12
|
return {
|
|
12
13
|
RawStmt: {
|
|
13
14
|
stmt,
|
|
14
|
-
stmt_len
|
|
15
|
+
stmt_len,
|
|
16
|
+
stmt_location: stmt_location || 0
|
|
15
17
|
}
|
|
16
18
|
};
|
|
17
19
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pgsql-parser",
|
|
3
|
-
"version": "13.3.
|
|
3
|
+
"version": "13.3.12",
|
|
4
4
|
"description": "The real PostgreSQL query parser",
|
|
5
5
|
"author": "Dan Lynch <pyramation@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/pyramation/pgsql-parser",
|
|
@@ -74,8 +74,8 @@
|
|
|
74
74
|
"@babel/runtime": "^7.11.2",
|
|
75
75
|
"libpg-query": "13.2.5",
|
|
76
76
|
"minimist": "^1.2.6",
|
|
77
|
-
"pgsql-deparser": "^13.3.
|
|
78
|
-
"pgsql-enums": "^13.1.
|
|
77
|
+
"pgsql-deparser": "^13.3.12",
|
|
78
|
+
"pgsql-enums": "^13.1.3"
|
|
79
79
|
},
|
|
80
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "b6691acf4c2c12f1285ea04f60603cf3aceee95e"
|
|
81
81
|
}
|