pgsql-deparser 13.16.0 → 14.0.1
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 +88 -45
- package/deparser/deparser.d.ts +301 -0
- package/deparser/deparser.js +10005 -0
- package/deparser/index.d.ts +9 -0
- package/deparser/index.js +17 -0
- package/deparser/utils/list-utils.d.ts +8 -0
- package/deparser/utils/list-utils.js +30 -0
- package/deparser/utils/quote-utils.d.ts +24 -0
- package/deparser/utils/quote-utils.js +89 -0
- package/deparser/utils/sql-formatter.d.ts +16 -0
- package/deparser/utils/sql-formatter.js +40 -0
- package/deparser/visitors/base.d.ts +21 -0
- package/deparser/visitors/base.js +34 -0
- package/esm/deparser/deparser.js +10001 -0
- package/esm/deparser/index.js +13 -0
- package/esm/deparser/utils/list-utils.js +26 -0
- package/esm/deparser/utils/quote-utils.js +85 -0
- package/esm/deparser/utils/sql-formatter.js +36 -0
- package/esm/deparser/visitors/base.js +30 -0
- package/esm/index.js +15 -0
- package/esm/v14-to-v15.js +1220 -0
- package/esm/v14-to-v17-direct.js +67 -0
- package/esm/v15-to-v16.js +2881 -0
- package/esm/v16-to-v17.js +1488 -0
- package/index.d.ts +9 -0
- package/index.js +19 -0
- package/package.json +26 -75
- package/v14-to-v15.d.ts +616 -0
- package/v14-to-v15.js +1224 -0
- package/v14-to-v17-direct.d.ts +23 -0
- package/v14-to-v17-direct.js +71 -0
- package/v15-to-v16.d.ts +627 -0
- package/v15-to-v16.js +2885 -0
- package/v16-to-v17.d.ts +638 -0
- package/v16-to-v17.js +1492 -0
- package/main/deparser.js +0 -3495
- package/main/index.js +0 -10
- package/main/utils/index.js +0 -97
- package/module/deparser.js +0 -3492
- package/module/index.js +0 -3
- package/module/utils/index.js +0 -90
- package/src/deparser.ts +0 -4234
- package/src/index.ts +0 -3
- package/src/utils/index.ts +0 -92
- package/types/deparser.d.ts +0 -119
- package/types/index.d.ts +0 -3
- package/types/utils/index.d.ts +0 -4
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
<a href="https://www.npmjs.com/package/pgsql-deparser"><img height="20" src="https://img.shields.io/github/package-json/v/launchql/pgsql-parser?filename=packages%2Fdeparser%2Fpackage.json"/></a>
|
|
15
15
|
</p>
|
|
16
16
|
|
|
17
|
-
`pgsql-deparser` is
|
|
17
|
+
`pgsql-deparser` is the lightning-fast, pure TypeScript solution for converting PostgreSQL ASTs back into SQL queries. Perfect companion to [`pgsql-parser`](https://github.com/launchql/pgsql-parser), this focused tool delivers SQL generation without any native dependencies or WebAssembly overhead.
|
|
18
18
|
|
|
19
19
|
## Installation
|
|
20
20
|
|
|
@@ -22,11 +22,12 @@
|
|
|
22
22
|
npm install pgsql-deparser
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
##
|
|
25
|
+
## Features
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
- **
|
|
27
|
+
* ⚡ **Pure TypeScript Performance** – Zero runtime dependencies, no WASM, no compilation - just blazing fast SQL generation
|
|
28
|
+
* 🪶 **Ultra Lightweight** – Minimal footprint with laser-focused functionality for AST-to-SQL conversion only
|
|
29
|
+
* 🧪 **Battle-Tested Reliability** – Validated against 23,000+ SQL statements ensuring production-grade stability
|
|
30
|
+
* 🌍 **Universal Compatibility** – Runs anywhere JavaScript does - browsers, Node.js, edge functions, you name it
|
|
30
31
|
|
|
31
32
|
## Deparser Example
|
|
32
33
|
|
|
@@ -35,20 +36,21 @@ The `pgsql-deparser` module serializes ASTs to SQL in pure TypeScript, avoiding
|
|
|
35
36
|
Here's how you can use the deparser in your TypeScript code, using [`@pgsql/utils`](https://github.com/launchql/pgsql-parser/tree/main/packages/utils) to create an AST for `deparse`:
|
|
36
37
|
|
|
37
38
|
```ts
|
|
38
|
-
import
|
|
39
|
-
import {
|
|
39
|
+
import * as t from '@pgsql/utils';
|
|
40
|
+
import { RangeVar, SelectStmt } from '@pgsql/types';
|
|
41
|
+
import { deparseSync as deparse } from 'pgsql-deparser';
|
|
40
42
|
|
|
41
43
|
// This could have been obtained from any JSON or AST, not necessarily @pgsql/utils
|
|
42
|
-
const stmt: SelectStmt =
|
|
44
|
+
const stmt: { SelectStmt: SelectStmt } = t.nodes.selectStmt({
|
|
43
45
|
targetList: [
|
|
44
|
-
|
|
45
|
-
val:
|
|
46
|
-
fields: [
|
|
46
|
+
t.nodes.resTarget({
|
|
47
|
+
val: t.nodes.columnRef({
|
|
48
|
+
fields: [t.nodes.aStar()]
|
|
47
49
|
})
|
|
48
50
|
})
|
|
49
51
|
],
|
|
50
52
|
fromClause: [
|
|
51
|
-
|
|
53
|
+
t.nodes.rangeVar({
|
|
52
54
|
relname: 'some_table',
|
|
53
55
|
inh: true,
|
|
54
56
|
relpersistence: 'p'
|
|
@@ -58,60 +60,101 @@ const stmt: SelectStmt = ast.selectStmt({
|
|
|
58
60
|
op: 'SETOP_NONE'
|
|
59
61
|
});
|
|
60
62
|
|
|
61
|
-
// Modify the AST if needed
|
|
62
|
-
stmt.SelectStmt.fromClause[0].RangeVar.relname = 'another_table';
|
|
63
|
+
// Modify the AST if needed
|
|
64
|
+
(stmt.SelectStmt.fromClause[0] as {RangeVar: RangeVar}).RangeVar.relname = 'another_table';
|
|
63
65
|
|
|
64
66
|
// Deparse the modified AST back to a SQL string
|
|
65
|
-
console.log(deparse(
|
|
67
|
+
console.log(deparse(stmt));
|
|
66
68
|
|
|
67
69
|
// Output: SELECT * FROM another_table
|
|
68
70
|
```
|
|
69
71
|
|
|
70
|
-
|
|
72
|
+
### Latest Version (PostgreSQL 17)
|
|
71
73
|
|
|
72
|
-
|
|
74
|
+
```sh
|
|
75
|
+
npm install pgsql-deparser
|
|
76
|
+
```
|
|
73
77
|
|
|
74
|
-
|
|
78
|
+
### Version-Specific Packages (PostgreSQL 13-16)
|
|
75
79
|
|
|
76
|
-
|
|
80
|
+
While we highly recommend using PG17, for PostgreSQL versions 13-16, use the version-specific packages:
|
|
77
81
|
|
|
78
|
-
|
|
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
|
+
```
|
|
79
88
|
|
|
80
|
-
|
|
81
|
-
|--------------------------|-------------|---------------------|---------|
|
|
82
|
-
| 13 | 13-latest | Active development | `latest`
|
|
83
|
-
| 12 | (n/a) | Not supported |
|
|
84
|
-
| 11 | (n/a) | Not supported |
|
|
85
|
-
| 10 | 10-latest | Not supported | `@1.3.1` ([tree](https://github.com/launchql/pgsql-parser/tree/39b7b1adc8914253226e286a48105785219a81ca)) |
|
|
89
|
+
## Options
|
|
86
90
|
|
|
91
|
+
The deparser accepts optional configuration for formatting and output control:
|
|
87
92
|
|
|
88
|
-
|
|
93
|
+
```ts
|
|
94
|
+
import { deparseSync as deparse } from 'pgsql-deparser';
|
|
89
95
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
* [pg-proto-parser](https://github.com/launchql/pg-proto-parser): A TypeScript tool that parses PostgreSQL Protocol Buffers definitions to generate TypeScript interfaces, utility functions, and JSON mappings for enums.
|
|
97
|
-
* [libpg-query](https://github.com/launchql/libpg-query-node): The real PostgreSQL parser exposed for Node.js, used primarily in `pgsql-parser` for parsing and deparsing SQL queries.
|
|
96
|
+
const options = {
|
|
97
|
+
pretty: true, // Enable pretty formatting (default: false)
|
|
98
|
+
newline: '\n', // Newline character (default: '\n')
|
|
99
|
+
tab: ' ', // Tab/indentation character (default: ' ')
|
|
100
|
+
semicolons: true // Add semicolons to statements (default: true)
|
|
101
|
+
};
|
|
98
102
|
|
|
99
|
-
|
|
103
|
+
const sql = deparse(ast, options);
|
|
104
|
+
```
|
|
100
105
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
106
|
+
| Option | Type | Default | Description |
|
|
107
|
+
|--------|------|---------|-------------|
|
|
108
|
+
| `pretty` | `boolean` | `false` | Enable pretty formatting with indentation and line breaks |
|
|
109
|
+
| `newline` | `string` | `'\n'` | Character(s) used for line breaks |
|
|
110
|
+
| `tab` | `string` | `' '` | Character(s) used for indentation |
|
|
111
|
+
| `semicolons` | `boolean` | `true` | Add semicolons to SQL statements |
|
|
112
|
+
|
|
113
|
+
**Pretty formatting example:**
|
|
114
|
+
```ts
|
|
115
|
+
// Without pretty formatting
|
|
116
|
+
const sql1 = deparse(selectAst, { pretty: false });
|
|
117
|
+
// "SELECT id, name FROM users WHERE active = true;"
|
|
118
|
+
|
|
119
|
+
// With pretty formatting
|
|
120
|
+
const sql2 = deparse(selectAst, { pretty: true });
|
|
121
|
+
// SELECT
|
|
122
|
+
// id,
|
|
123
|
+
// name
|
|
124
|
+
// FROM users
|
|
125
|
+
// WHERE
|
|
126
|
+
// active = true;
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
For complete documentation and advanced options, see [DEPARSER_USAGE.md](../../DEPARSER_USAGE.md).
|
|
130
|
+
|
|
131
|
+
## Why Use `pgsql-deparser`?
|
|
132
|
+
|
|
133
|
+
`pgsql-deparser` is particularly useful in development environments where native dependencies are problematic or in applications where only the deparser functionality is required. Its independence from the full `pgsql-parser` package allows for more focused and lightweight SQL generation tasks.
|
|
104
134
|
|
|
105
135
|
## Credits
|
|
106
136
|
|
|
107
|
-
|
|
137
|
+
Built on the excellent work of several contributors:
|
|
138
|
+
|
|
139
|
+
* **[Dan Lynch](https://github.com/pyramation)** — official maintainer since 2018 and architect of the current implementation
|
|
140
|
+
* **[Lukas Fittl](https://github.com/lfittl)** for [libpg_query](https://github.com/pganalyze/libpg_query) — the core PostgreSQL parser that powers this project
|
|
141
|
+
* **[Greg Richardson](https://github.com/gregnr)** for AST guidance and pushing the transition to WASM and multiple PG runtimes for better interoperability
|
|
142
|
+
* **[Ethan Resnick](https://github.com/ethanresnick)** for the original Node.js N-API bindings
|
|
143
|
+
* **[Zac McCormick](https://github.com/zhm)** for the foundational [node-pg-query-native](https://github.com/zhm/node-pg-query-native) parser
|
|
108
144
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
* [
|
|
145
|
+
## Related
|
|
146
|
+
|
|
147
|
+
* [pgsql-parser](https://www.npmjs.com/package/pgsql-parser): The real PostgreSQL parser for Node.js, providing symmetric parsing and deparsing of SQL statements with actual PostgreSQL parser integration.
|
|
148
|
+
* [pgsql-deparser](https://www.npmjs.com/package/pgsql-deparser): A streamlined tool designed for converting PostgreSQL ASTs back into SQL queries, focusing solely on deparser functionality to complement `pgsql-parser`.
|
|
149
|
+
* [@pgsql/parser](https://www.npmjs.com/package/@pgsql/parser): Multi-version PostgreSQL parser with dynamic version selection at runtime, supporting PostgreSQL 15, 16, and 17 in a single package.
|
|
150
|
+
* [@pgsql/types](https://www.npmjs.com/package/@pgsql/types): Offers TypeScript type definitions for PostgreSQL AST nodes, facilitating type-safe construction, analysis, and manipulation of ASTs.
|
|
151
|
+
* [@pgsql/enums](https://www.npmjs.com/package/@pgsql/enums): Provides TypeScript enum definitions for PostgreSQL constants, enabling type-safe usage of PostgreSQL enums and constants in your applications.
|
|
152
|
+
* [@pgsql/utils](https://www.npmjs.com/package/@pgsql/utils): A comprehensive utility library for PostgreSQL, offering type-safe AST node creation and enum value conversions, simplifying the construction and manipulation of PostgreSQL ASTs.
|
|
153
|
+
* [pg-proto-parser](https://www.npmjs.com/package/pg-proto-parser): A TypeScript tool that parses PostgreSQL Protocol Buffers definitions to generate TypeScript interfaces, utility functions, and JSON mappings for enums.
|
|
154
|
+
* [libpg-query](https://github.com/launchql/libpg-query-node): The real PostgreSQL parser exposed for Node.js, used primarily in `pgsql-parser` for parsing and deparsing SQL queries.
|
|
112
155
|
|
|
113
156
|
## Disclaimer
|
|
114
157
|
|
|
115
|
-
AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED
|
|
158
|
+
AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED "AS IS", AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND.
|
|
116
159
|
|
|
117
|
-
No developer or entity involved in creating Software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the Software code or Software CLI, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value.
|
|
160
|
+
No developer or entity involved in creating Software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the Software code or Software CLI, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value.
|
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto-generated file with types stripped for better tree-shaking
|
|
3
|
+
* DO NOT EDIT - Generated by strip-deparser-types.ts
|
|
4
|
+
*/
|
|
5
|
+
import { DeparserContext, DeparserVisitor } from './visitors/base';
|
|
6
|
+
export interface DeparserOptions {
|
|
7
|
+
newline?: string;
|
|
8
|
+
tab?: string;
|
|
9
|
+
functionDelimiter?: string;
|
|
10
|
+
functionDelimiterFallback?: string;
|
|
11
|
+
pretty?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Deparser - Converts PostgreSQL AST nodes back to SQL strings
|
|
15
|
+
*
|
|
16
|
+
* Entry Points:
|
|
17
|
+
* 1. ParseResult (from libpg-query) - The complete parse result
|
|
18
|
+
* Structure: { version: number, stmts: RawStmt[] }
|
|
19
|
+
* Note: stmts is "repeated RawStmt" in protobuf, so array contains RawStmt
|
|
20
|
+
* objects inline (not wrapped as { RawStmt: ... } nodes)
|
|
21
|
+
* Example: { version: 170004, stmts: [{ stmt: {...}, stmt_len: 32 }] }
|
|
22
|
+
*
|
|
23
|
+
* 2. Wrapped ParseResult - When explicitly wrapped as a Node
|
|
24
|
+
* Structure: { ParseResult: { version: number, stmts: RawStmt[] } }
|
|
25
|
+
*
|
|
26
|
+
* 3. Wrapped RawStmt - When explicitly wrapped as a Node
|
|
27
|
+
* Structure: { RawStmt: { stmt: Node, stmt_len?: number } }
|
|
28
|
+
*
|
|
29
|
+
* 4. Array of Nodes - Multiple statements to deparse
|
|
30
|
+
* Can be: Node[] (e.g., SelectStmt, InsertStmt, etc.)
|
|
31
|
+
*
|
|
32
|
+
* 5. Single Node - Individual statement node
|
|
33
|
+
* Example: { SelectStmt: {...} }, { InsertStmt: {...} }, etc.
|
|
34
|
+
*
|
|
35
|
+
* The deparser automatically detects bare ParseResult objects for backward
|
|
36
|
+
* compatibility and wraps them internally for consistent processing.
|
|
37
|
+
*/
|
|
38
|
+
export declare class Deparser implements DeparserVisitor {
|
|
39
|
+
private formatter;
|
|
40
|
+
private tree;
|
|
41
|
+
private options;
|
|
42
|
+
constructor(tree: any | any[] | any, opts?: DeparserOptions);
|
|
43
|
+
/**
|
|
44
|
+
* Static method to deparse PostgreSQL AST nodes to SQL
|
|
45
|
+
* @param query - Can be:
|
|
46
|
+
* - ParseResult from libpg-query (e.g., { version: 170004, stmts: [...] })
|
|
47
|
+
* - Wrapped ParseResult node (e.g., { ParseResult: {...} })
|
|
48
|
+
* - Wrapped RawStmt node (e.g., { RawStmt: {...} })
|
|
49
|
+
* - Array of Nodes
|
|
50
|
+
* - Single Node (e.g., { SelectStmt: {...} })
|
|
51
|
+
* @param opts - Deparser options for formatting
|
|
52
|
+
* @returns The deparsed SQL string
|
|
53
|
+
*/
|
|
54
|
+
static deparse(query: any | any[] | any, opts?: DeparserOptions): string;
|
|
55
|
+
deparseQuery(): string;
|
|
56
|
+
/**
|
|
57
|
+
* Get the appropriate function delimiter based on the body content
|
|
58
|
+
* @param body The function body to check
|
|
59
|
+
* @returns The delimiter to use
|
|
60
|
+
*/
|
|
61
|
+
private getFunctionDelimiter;
|
|
62
|
+
deparse(node: any, context?: DeparserContext): string | null;
|
|
63
|
+
visit(node: any, context?: DeparserContext): string;
|
|
64
|
+
getNodeType(node: any): string;
|
|
65
|
+
getNodeData(node: any): any;
|
|
66
|
+
ParseResult(node: any, context: DeparserContext): string;
|
|
67
|
+
RawStmt(node: any, context: DeparserContext): string;
|
|
68
|
+
SelectStmt(node: any, context: DeparserContext): string;
|
|
69
|
+
A_Expr(node: any, context: DeparserContext): string;
|
|
70
|
+
deparseOperatorName(name: any): string;
|
|
71
|
+
private getOperatorPrecedence;
|
|
72
|
+
private needsParentheses;
|
|
73
|
+
private isComplexExpression;
|
|
74
|
+
visitBetweenRange(rexpr: any, context: DeparserContext): string;
|
|
75
|
+
InsertStmt(node: any, context: DeparserContext): string;
|
|
76
|
+
UpdateStmt(node: any, context: DeparserContext): string;
|
|
77
|
+
DeleteStmt(node: any, context: DeparserContext): string;
|
|
78
|
+
WithClause(node: any, context: DeparserContext): string;
|
|
79
|
+
ResTarget(node: any, context: DeparserContext): string;
|
|
80
|
+
deparseReturningList(list: any, context: DeparserContext): string;
|
|
81
|
+
BoolExpr(node: any, context: DeparserContext): string;
|
|
82
|
+
FuncCall(node: any, context: DeparserContext): string;
|
|
83
|
+
FuncExpr(node: any, context: DeparserContext): string;
|
|
84
|
+
A_Const(node: any, context: DeparserContext): string;
|
|
85
|
+
ColumnRef(node: any, context: DeparserContext): string;
|
|
86
|
+
TypeName(node: any, context: DeparserContext): string;
|
|
87
|
+
Alias(node: any, context: DeparserContext): string;
|
|
88
|
+
RangeVar(node: any, context: DeparserContext): string;
|
|
89
|
+
formatIntervalTypeMods(typmods: any, context: DeparserContext): string | null;
|
|
90
|
+
formatTypeMods(typmods: any, context: DeparserContext): string | null;
|
|
91
|
+
formatSingleTypeMod(typemod: number, typeName: string): string | null;
|
|
92
|
+
getPgCatalogTypeName(typeName: string, size: string | null): string;
|
|
93
|
+
A_ArrayExpr(node: any, context: DeparserContext): string;
|
|
94
|
+
A_Indices(node: any, context: DeparserContext): string;
|
|
95
|
+
A_Indirection(node: any, context: DeparserContext): string;
|
|
96
|
+
A_Star(node: any, context: DeparserContext): string;
|
|
97
|
+
CaseExpr(node: any, context: DeparserContext): string;
|
|
98
|
+
CoalesceExpr(node: any, context: DeparserContext): string;
|
|
99
|
+
TypeCast(node: any, context: DeparserContext): string;
|
|
100
|
+
CollateClause(node: any, context: DeparserContext): string;
|
|
101
|
+
BooleanTest(node: any, context: DeparserContext): string;
|
|
102
|
+
NullTest(node: any, context: DeparserContext): string;
|
|
103
|
+
private static readonly RESERVED_WORDS;
|
|
104
|
+
private static needsQuotes;
|
|
105
|
+
quoteIfNeeded(value: string): string;
|
|
106
|
+
preserveOperatorDefElemCase(defName: string): string;
|
|
107
|
+
String(node: any, context: DeparserContext): string;
|
|
108
|
+
Integer(node: any, context: DeparserContext): string;
|
|
109
|
+
Float(node: any, context: DeparserContext): string;
|
|
110
|
+
Boolean(node: any, context: DeparserContext): string;
|
|
111
|
+
BitString(node: any, context: DeparserContext): string;
|
|
112
|
+
Null(node: any, context: DeparserContext): string;
|
|
113
|
+
List(node: any, context: DeparserContext): string;
|
|
114
|
+
CreateStmt(node: any, context: DeparserContext): string;
|
|
115
|
+
ColumnDef(node: any, context: DeparserContext): string;
|
|
116
|
+
Constraint(node: any, context: DeparserContext): string;
|
|
117
|
+
SubLink(node: any, context: DeparserContext): string;
|
|
118
|
+
CaseWhen(node: any, context: DeparserContext): string;
|
|
119
|
+
WindowDef(node: any, context: DeparserContext): string;
|
|
120
|
+
formatWindowFrame(node: any): string | null;
|
|
121
|
+
SortBy(node: any, context: DeparserContext): string;
|
|
122
|
+
GroupingSet(node: any, context: DeparserContext): string;
|
|
123
|
+
CommonTableExpr(node: any, context: DeparserContext): string;
|
|
124
|
+
ParamRef(node: any, context: DeparserContext): string;
|
|
125
|
+
LockingClause(node: any, context: DeparserContext): string;
|
|
126
|
+
MinMaxExpr(node: any, context: DeparserContext): string;
|
|
127
|
+
RowExpr(node: any, context: DeparserContext): string;
|
|
128
|
+
OpExpr(node: any, context: DeparserContext): string;
|
|
129
|
+
DistinctExpr(node: any, context: DeparserContext): string;
|
|
130
|
+
NullIfExpr(node: any, context: DeparserContext): string;
|
|
131
|
+
ScalarArrayOpExpr(node: any, context: DeparserContext): string;
|
|
132
|
+
Aggref(node: any, context: DeparserContext): string;
|
|
133
|
+
WindowFunc(node: any, context: DeparserContext): string;
|
|
134
|
+
FieldSelect(node: any, context: DeparserContext): string;
|
|
135
|
+
RelabelType(node: any, context: DeparserContext): string;
|
|
136
|
+
CoerceViaIO(node: any, context: DeparserContext): string;
|
|
137
|
+
ArrayCoerceExpr(node: any, context: DeparserContext): string;
|
|
138
|
+
ConvertRowtypeExpr(node: any, context: DeparserContext): string;
|
|
139
|
+
NamedArgExpr(node: any, context: DeparserContext): string;
|
|
140
|
+
ViewStmt(node: any, context: DeparserContext): string;
|
|
141
|
+
IndexStmt(node: any, context: DeparserContext): string;
|
|
142
|
+
IndexElem(node: any, context: DeparserContext): string;
|
|
143
|
+
PartitionElem(node: any, context: DeparserContext): string;
|
|
144
|
+
PartitionCmd(node: any, context: DeparserContext): string;
|
|
145
|
+
private getAggFunctionName;
|
|
146
|
+
private getWindowFunctionName;
|
|
147
|
+
private getOperatorName;
|
|
148
|
+
JoinExpr(node: any, context: DeparserContext): string;
|
|
149
|
+
FromExpr(node: any, context: DeparserContext): string;
|
|
150
|
+
TransactionStmt(node: any, context: DeparserContext): string;
|
|
151
|
+
VariableSetStmt(node: any, context: DeparserContext): string;
|
|
152
|
+
VariableShowStmt(node: any, context: DeparserContext): string;
|
|
153
|
+
CreateSchemaStmt(node: any, context: DeparserContext): string;
|
|
154
|
+
RoleSpec(node: any, context: DeparserContext): string;
|
|
155
|
+
roletype(node: any, context: DeparserContext): string;
|
|
156
|
+
DropStmt(node: any, context: DeparserContext): string;
|
|
157
|
+
TruncateStmt(node: any, context: DeparserContext): string;
|
|
158
|
+
ReturnStmt(node: any, context: DeparserContext): string;
|
|
159
|
+
PLAssignStmt(node: any, context: DeparserContext): string;
|
|
160
|
+
CopyStmt(node: any, context: DeparserContext): string;
|
|
161
|
+
AlterTableStmt(node: any, context: DeparserContext): string;
|
|
162
|
+
AlterTableCmd(node: any, context: DeparserContext): string;
|
|
163
|
+
CreateFunctionStmt(node: any, context: DeparserContext): string;
|
|
164
|
+
FunctionParameter(node: any, context: DeparserContext): string;
|
|
165
|
+
CreateEnumStmt(node: any, context: DeparserContext): string;
|
|
166
|
+
CreateDomainStmt(node: any, context: DeparserContext): string;
|
|
167
|
+
CreateRoleStmt(node: any, context: DeparserContext): string;
|
|
168
|
+
DefElem(node: any, context: DeparserContext): string;
|
|
169
|
+
CreateTableSpaceStmt(node: any, context: DeparserContext): string;
|
|
170
|
+
DropTableSpaceStmt(node: any, context: DeparserContext): string;
|
|
171
|
+
AlterTableSpaceOptionsStmt(node: any, context: DeparserContext): string;
|
|
172
|
+
CreateExtensionStmt(node: any, context: DeparserContext): string;
|
|
173
|
+
AlterExtensionStmt(node: any, context: DeparserContext): string;
|
|
174
|
+
CreateFdwStmt(node: any, context: DeparserContext): string;
|
|
175
|
+
SetOperationStmt(node: any, context: DeparserContext): string;
|
|
176
|
+
ReplicaIdentityStmt(node: any, context: DeparserContext): string;
|
|
177
|
+
AlterCollationStmt(node: any, context: DeparserContext): string;
|
|
178
|
+
AlterDomainStmt(node: any, context: DeparserContext): string;
|
|
179
|
+
PrepareStmt(node: any, context: DeparserContext): string;
|
|
180
|
+
ExecuteStmt(node: any, context: DeparserContext): string;
|
|
181
|
+
DeallocateStmt(node: any, context: DeparserContext): string;
|
|
182
|
+
NotifyStmt(node: any, context: DeparserContext): string;
|
|
183
|
+
ListenStmt(node: any, context: DeparserContext): string;
|
|
184
|
+
UnlistenStmt(node: any, context: DeparserContext): string;
|
|
185
|
+
CheckPointStmt(node: any, context: DeparserContext): string;
|
|
186
|
+
LoadStmt(node: any, context: DeparserContext): string;
|
|
187
|
+
DiscardStmt(node: any, context: DeparserContext): string;
|
|
188
|
+
CommentStmt(node: any, context: DeparserContext): string;
|
|
189
|
+
LockStmt(node: any, context: DeparserContext): string;
|
|
190
|
+
CreatePolicyStmt(node: any, context: DeparserContext): string;
|
|
191
|
+
AlterPolicyStmt(node: any, context: DeparserContext): string;
|
|
192
|
+
CreateUserMappingStmt(node: any, context: DeparserContext): string;
|
|
193
|
+
CreateStatsStmt(node: any, context: DeparserContext): string;
|
|
194
|
+
StatsElem(node: any, context: DeparserContext): string;
|
|
195
|
+
CreatePublicationStmt(node: any, context: DeparserContext): string;
|
|
196
|
+
CreateSubscriptionStmt(node: any, context: DeparserContext): string;
|
|
197
|
+
AlterPublicationStmt(node: any, context: DeparserContext): string;
|
|
198
|
+
AlterSubscriptionStmt(node: any, context: DeparserContext): string;
|
|
199
|
+
DropSubscriptionStmt(node: any, context: DeparserContext): string;
|
|
200
|
+
DoStmt(node: any, context: DeparserContext): string;
|
|
201
|
+
private generateUniqueDollarTag;
|
|
202
|
+
InlineCodeBlock(node: any, context: DeparserContext): string;
|
|
203
|
+
CallContext(node: any, context: DeparserContext): string;
|
|
204
|
+
ConstraintsSetStmt(node: any, context: DeparserContext): string;
|
|
205
|
+
AlterSystemStmt(node: any, context: DeparserContext): string;
|
|
206
|
+
VacuumRelation(node: any, context: DeparserContext): string;
|
|
207
|
+
DropOwnedStmt(node: any, context: DeparserContext): string;
|
|
208
|
+
ReassignOwnedStmt(node: any, context: DeparserContext): string;
|
|
209
|
+
AlterTSDictionaryStmt(node: any, context: DeparserContext): string;
|
|
210
|
+
AlterTSConfigurationStmt(node: any, context: DeparserContext): string;
|
|
211
|
+
ClosePortalStmt(node: any, context: DeparserContext): string;
|
|
212
|
+
FetchStmt(node: any, context: DeparserContext): string;
|
|
213
|
+
AlterStatsStmt(node: any, context: DeparserContext): string;
|
|
214
|
+
ObjectWithArgs(node: any, context: DeparserContext): string;
|
|
215
|
+
AlterOperatorStmt(node: any, context: DeparserContext): string;
|
|
216
|
+
AlterFdwStmt(node: any, context: DeparserContext): string;
|
|
217
|
+
CreateForeignServerStmt(node: any, context: DeparserContext): string;
|
|
218
|
+
AlterForeignServerStmt(node: any, context: DeparserContext): string;
|
|
219
|
+
AlterUserMappingStmt(node: any, context: DeparserContext): string;
|
|
220
|
+
DropUserMappingStmt(node: any, context: DeparserContext): string;
|
|
221
|
+
ImportForeignSchemaStmt(node: any, context: DeparserContext): string;
|
|
222
|
+
ClusterStmt(node: any, context: DeparserContext): string;
|
|
223
|
+
VacuumStmt(node: any, context: DeparserContext): string;
|
|
224
|
+
ExplainStmt(node: any, context: DeparserContext): string;
|
|
225
|
+
ReindexStmt(node: any, context: DeparserContext): string;
|
|
226
|
+
CallStmt(node: any, context: DeparserContext): string;
|
|
227
|
+
CreatedbStmt(node: any, context: DeparserContext): string;
|
|
228
|
+
DropdbStmt(node: any, context: DeparserContext): string;
|
|
229
|
+
RenameStmt(node: any, context: DeparserContext): string;
|
|
230
|
+
AlterOwnerStmt(node: any, context: DeparserContext): string;
|
|
231
|
+
GrantStmt(node: any, context: DeparserContext): string;
|
|
232
|
+
GrantRoleStmt(node: any, context: DeparserContext): string;
|
|
233
|
+
SecLabelStmt(node: any, context: DeparserContext): string;
|
|
234
|
+
AlterDefaultPrivilegesStmt(node: any, context: DeparserContext): string;
|
|
235
|
+
CreateConversionStmt(node: any, context: DeparserContext): string;
|
|
236
|
+
CreateCastStmt(node: any, context: DeparserContext): string;
|
|
237
|
+
CreatePLangStmt(node: any, context: DeparserContext): string;
|
|
238
|
+
CreateTransformStmt(node: any, context: DeparserContext): string;
|
|
239
|
+
CreateTrigStmt(node: any, context: DeparserContext): string;
|
|
240
|
+
TriggerTransition(node: any, context: DeparserContext): string;
|
|
241
|
+
CreateEventTrigStmt(node: any, context: DeparserContext): string;
|
|
242
|
+
AlterEventTrigStmt(node: any, context: DeparserContext): string;
|
|
243
|
+
CreateOpClassStmt(node: any, context: DeparserContext): string;
|
|
244
|
+
CreateOpFamilyStmt(node: any, context: DeparserContext): string;
|
|
245
|
+
AlterOpFamilyStmt(node: any, context: DeparserContext): string;
|
|
246
|
+
MergeStmt(node: any, context: DeparserContext): string;
|
|
247
|
+
AlterTableMoveAllStmt(node: any, context: DeparserContext): string;
|
|
248
|
+
CreateSeqStmt(node: any, context: DeparserContext): string;
|
|
249
|
+
AlterSeqStmt(node: any, context: DeparserContext): string;
|
|
250
|
+
CompositeTypeStmt(node: any, context: DeparserContext): string;
|
|
251
|
+
CreateRangeStmt(node: any, context: DeparserContext): string;
|
|
252
|
+
AlterEnumStmt(node: any, context: DeparserContext): string;
|
|
253
|
+
AlterTypeStmt(node: any, context: DeparserContext): string;
|
|
254
|
+
AlterRoleStmt(node: any, context: DeparserContext): string;
|
|
255
|
+
DropRoleStmt(node: any, context: DeparserContext): string;
|
|
256
|
+
targetList(node: any, context: DeparserContext): string;
|
|
257
|
+
CreateAggregateStmt(node: any, context: DeparserContext): string;
|
|
258
|
+
CreateTableAsStmt(node: any, context: DeparserContext): string;
|
|
259
|
+
RefreshMatViewStmt(node: any, context: DeparserContext): string;
|
|
260
|
+
AccessPriv(node: any, context: DeparserContext): string;
|
|
261
|
+
aliasname(node: any, context: DeparserContext): string;
|
|
262
|
+
DefineStmt(node: any, context: DeparserContext): string;
|
|
263
|
+
AlterDatabaseStmt(node: any, context: DeparserContext): string;
|
|
264
|
+
AlterDatabaseRefreshCollStmt(node: any, context: DeparserContext): string;
|
|
265
|
+
AlterDatabaseSetStmt(node: any, context: DeparserContext): string;
|
|
266
|
+
DeclareCursorStmt(node: any, context: DeparserContext): string;
|
|
267
|
+
PublicationObjSpec(node: any, context: DeparserContext): string;
|
|
268
|
+
PublicationTable(node: any, context: DeparserContext): string;
|
|
269
|
+
CreateAmStmt(node: any, context: DeparserContext): string;
|
|
270
|
+
IntoClause(node: any, context: DeparserContext): string;
|
|
271
|
+
OnConflictExpr(node: any, context: DeparserContext): string;
|
|
272
|
+
ScanToken(node: any, context: DeparserContext): string;
|
|
273
|
+
CreateOpClassItem(node: any, context: DeparserContext): string;
|
|
274
|
+
Var(node: any, context: DeparserContext): string;
|
|
275
|
+
TableFunc(node: any, context: DeparserContext): string;
|
|
276
|
+
RangeTableFunc(node: any, context: DeparserContext): string;
|
|
277
|
+
RangeTableFuncCol(node: any, context: DeparserContext): string;
|
|
278
|
+
JsonArrayQueryConstructor(node: any, context: DeparserContext): string;
|
|
279
|
+
RangeFunction(node: any, context: DeparserContext): string;
|
|
280
|
+
XmlExpr(node: any, context: DeparserContext): string;
|
|
281
|
+
schemaname(node: any, context: DeparserContext): string;
|
|
282
|
+
RangeTableSample(node: any, context: DeparserContext): string;
|
|
283
|
+
XmlSerialize(node: any, context: DeparserContext): string;
|
|
284
|
+
ctes(node: any, context: DeparserContext): string;
|
|
285
|
+
RuleStmt(node: any, context: DeparserContext): string;
|
|
286
|
+
RangeSubselect(node: any, context: DeparserContext): string;
|
|
287
|
+
relname(node: any, context: DeparserContext): string;
|
|
288
|
+
rel(node: any, context: DeparserContext): string;
|
|
289
|
+
objname(node: any, context: DeparserContext): string;
|
|
290
|
+
SQLValueFunction(node: any, context: DeparserContext): string;
|
|
291
|
+
GroupingFunc(node: any, context: DeparserContext): string;
|
|
292
|
+
MultiAssignRef(node: any, context: DeparserContext): string;
|
|
293
|
+
SetToDefault(node: any, context: DeparserContext): string;
|
|
294
|
+
CurrentOfExpr(node: any, context: DeparserContext): string;
|
|
295
|
+
TableLikeClause(node: any, context: DeparserContext): string;
|
|
296
|
+
AlterFunctionStmt(node: any, context: DeparserContext): string;
|
|
297
|
+
AlterObjectSchemaStmt(node: any, context: DeparserContext): string;
|
|
298
|
+
AlterRoleSetStmt(node: any, context: DeparserContext): string;
|
|
299
|
+
CreateForeignTableStmt(node: any, context: DeparserContext): string;
|
|
300
|
+
private containsMultilineStringLiteral;
|
|
301
|
+
}
|