pgsql-deparser 17.8.2 → 17.8.4
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/README.md +17 -0
- package/deparser.d.ts +2 -3
- package/deparser.js +304 -304
- package/esm/deparser.js +304 -304
- package/esm/visitors/base.js +87 -0
- package/package.json +11 -4
- package/visitors/base.d.ts +48 -2
- package/visitors/base.js +89 -1
- package/esm/utils/index.js +0 -90
- package/esm/utils/statement-splitter.js +0 -125
- package/utils/index.d.ts +0 -4
- package/utils/index.js +0 -97
- package/utils/statement-splitter.d.ts +0 -38
- package/utils/statement-splitter.js +0 -131
package/README.md
CHANGED
|
@@ -69,6 +69,23 @@ console.log(deparse(stmt));
|
|
|
69
69
|
// Output: SELECT * FROM another_table
|
|
70
70
|
```
|
|
71
71
|
|
|
72
|
+
### Latest Version (PostgreSQL 17)
|
|
73
|
+
|
|
74
|
+
```sh
|
|
75
|
+
npm install pgsql-deparser
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Version-Specific Packages (PostgreSQL 13-16)
|
|
79
|
+
|
|
80
|
+
While we highly recommend using PG17, for PostgreSQL versions 13-16, use the version-specific packages:
|
|
81
|
+
|
|
82
|
+
```sh
|
|
83
|
+
npm install pgsql-deparser@v13 # PostgreSQL 13
|
|
84
|
+
npm install pgsql-deparser@v14 # PostgreSQL 14
|
|
85
|
+
npm install pgsql-deparser@v15 # PostgreSQL 15
|
|
86
|
+
npm install pgsql-deparser@v16 # PostgreSQL 16
|
|
87
|
+
```
|
|
88
|
+
|
|
72
89
|
## Options
|
|
73
90
|
|
|
74
91
|
The deparser accepts optional configuration for formatting and output control:
|
package/deparser.d.ts
CHANGED
|
@@ -34,7 +34,6 @@ export interface DeparserOptions {
|
|
|
34
34
|
* compatibility and wraps them internally for consistent processing.
|
|
35
35
|
*/
|
|
36
36
|
export declare class Deparser implements DeparserVisitor {
|
|
37
|
-
private formatter;
|
|
38
37
|
private tree;
|
|
39
38
|
private options;
|
|
40
39
|
constructor(tree: Node | Node[] | t.ParseResult, opts?: DeparserOptions);
|
|
@@ -65,7 +64,7 @@ export declare class Deparser implements DeparserVisitor {
|
|
|
65
64
|
RawStmt(node: t.RawStmt, context: DeparserContext): string;
|
|
66
65
|
SelectStmt(node: t.SelectStmt, context: DeparserContext): string;
|
|
67
66
|
A_Expr(node: t.A_Expr, context: DeparserContext): string;
|
|
68
|
-
deparseOperatorName(name: t.Node[]): string;
|
|
67
|
+
deparseOperatorName(name: t.Node[], context: DeparserContext): string;
|
|
69
68
|
private getOperatorPrecedence;
|
|
70
69
|
private needsParentheses;
|
|
71
70
|
private isComplexExpression;
|
|
@@ -117,7 +116,7 @@ export declare class Deparser implements DeparserVisitor {
|
|
|
117
116
|
SubLink(node: t.SubLink, context: DeparserContext): string;
|
|
118
117
|
CaseWhen(node: t.CaseWhen, context: DeparserContext): string;
|
|
119
118
|
WindowDef(node: t.WindowDef, context: DeparserContext): string;
|
|
120
|
-
formatWindowFrame(node: any): string | null;
|
|
119
|
+
formatWindowFrame(node: any, context: DeparserContext): string | null;
|
|
121
120
|
SortBy(node: t.SortBy, context: DeparserContext): string;
|
|
122
121
|
GroupingSet(node: t.GroupingSet, context: DeparserContext): string;
|
|
123
122
|
CommonTableExpr(node: t.CommonTableExpr, context: DeparserContext): string;
|