pgsql-deparser 16.0.0 → 17.1.0
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 +45 -88
- package/deparser.d.ts +253 -0
- package/{deparser/deparser.js → deparser.js} +180 -579
- package/esm/{deparser/deparser.js → deparser.js} +180 -579
- package/esm/index.js +3 -15
- package/esm/utils/index.js +90 -0
- package/esm/{deparser/utils → utils}/list-utils.js +0 -4
- package/esm/{deparser/utils → utils}/quote-utils.js +0 -34
- package/esm/utils/sql-formatter.js +23 -0
- package/esm/{deparser/visitors → visitors}/base.js +0 -4
- package/index.d.ts +3 -9
- package/index.js +4 -16
- package/package.json +27 -14
- package/utils/index.d.ts +4 -0
- package/utils/index.js +97 -0
- package/{deparser/utils → utils}/list-utils.d.ts +0 -4
- package/{deparser/utils → utils}/list-utils.js +0 -4
- package/utils/quote-utils.d.ts +5 -0
- package/{deparser/utils → utils}/quote-utils.js +0 -34
- package/{deparser/utils → utils}/sql-formatter.d.ts +1 -7
- package/{deparser/utils → utils}/sql-formatter.js +2 -15
- package/{deparser/visitors → visitors}/base.d.ts +5 -8
- package/{deparser/visitors → visitors}/base.js +0 -4
- package/deparser/deparser.d.ts +0 -301
- package/deparser/index.d.ts +0 -9
- package/deparser/index.js +0 -17
- package/deparser/utils/quote-utils.d.ts +0 -24
- package/esm/deparser/index.js +0 -13
- package/esm/deparser/utils/sql-formatter.js +0 -36
- package/esm/v16-to-v17-direct.js +0 -44
- package/esm/v16-to-v17.js +0 -1488
- package/v16-to-v17-direct.d.ts +0 -21
- package/v16-to-v17-direct.js +0 -48
- package/v16-to-v17.d.ts +0 -638
- package/v16-to-v17.js +0 -1492
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 a streamlined tool designed to convert PostgreSQL Abstract Syntax Trees (AST) back into SQL queries. It is a companion module to [`pgsql-parser`](https://github.com/launchql/pgsql-parser), which is capable of both parsing SQL queries into ASTs and deparsing these ASTs back into SQL. However, unlike `pgsql-parser`, which incorporates the full PostgreSQL parser, `pgsql-deparser` focuses solely on the deparser functionality. This makes it an excellent choice for scenarios where only AST-to-SQL conversion is needed, avoiding the extra overhead associated with the full parsing capabilities.
|
|
18
18
|
|
|
19
19
|
## Installation
|
|
20
20
|
|
|
@@ -22,12 +22,11 @@
|
|
|
22
22
|
npm install pgsql-deparser
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
## Features
|
|
25
|
+
## Key Features
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
* 🌍 **Universal Compatibility** – Runs anywhere JavaScript does - browsers, Node.js, edge functions, you name it
|
|
27
|
+
- **Lightweight and Pure TypeScript**: Built entirely in TypeScript, `pgsql-deparser` is lightweight and doesn't rely on native dependencies, facilitating easier integration and deployment across various environments.
|
|
28
|
+
- **Focused Functionality**: By concentrating on decompiling ASTs to SQL, `pgsql-deparser` offers a specialized, efficient solution for those who need to generate SQL statements from ASTs without the full parsing mechanism.
|
|
29
|
+
- **Compatibility**: Ideal for use cases where the AST is already obtained from another source or process, allowing for seamless SQL generation from AST representations.
|
|
31
30
|
|
|
32
31
|
## Deparser Example
|
|
33
32
|
|
|
@@ -36,21 +35,20 @@ The `pgsql-deparser` module serializes ASTs to SQL in pure TypeScript, avoiding
|
|
|
36
35
|
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`:
|
|
37
36
|
|
|
38
37
|
```ts
|
|
39
|
-
import
|
|
40
|
-
import {
|
|
41
|
-
import { deparseSync as deparse } from 'pgsql-deparser';
|
|
38
|
+
import ast, { SelectStmt } from '@pgsql/utils';
|
|
39
|
+
import { deparse } from 'pgsql-deparser';
|
|
42
40
|
|
|
43
41
|
// This could have been obtained from any JSON or AST, not necessarily @pgsql/utils
|
|
44
|
-
const stmt:
|
|
42
|
+
const stmt: SelectStmt = ast.selectStmt({
|
|
45
43
|
targetList: [
|
|
46
|
-
|
|
47
|
-
val:
|
|
48
|
-
fields: [
|
|
44
|
+
ast.resTarget({
|
|
45
|
+
val: ast.columnRef({
|
|
46
|
+
fields: [ast.aStar()]
|
|
49
47
|
})
|
|
50
48
|
})
|
|
51
49
|
],
|
|
52
50
|
fromClause: [
|
|
53
|
-
|
|
51
|
+
ast.rangeVar({
|
|
54
52
|
relname: 'some_table',
|
|
55
53
|
inh: true,
|
|
56
54
|
relpersistence: 'p'
|
|
@@ -60,101 +58,60 @@ const stmt: { SelectStmt: SelectStmt } = t.nodes.selectStmt({
|
|
|
60
58
|
op: 'SETOP_NONE'
|
|
61
59
|
});
|
|
62
60
|
|
|
63
|
-
// Modify the AST if needed
|
|
64
|
-
|
|
61
|
+
// Modify the AST if needed
|
|
62
|
+
stmt.SelectStmt.fromClause[0].RangeVar.relname = 'another_table';
|
|
65
63
|
|
|
66
64
|
// Deparse the modified AST back to a SQL string
|
|
67
|
-
console.log(deparse(
|
|
65
|
+
console.log(deparse(stmts));
|
|
68
66
|
|
|
69
67
|
// Output: SELECT * FROM another_table
|
|
70
68
|
```
|
|
71
69
|
|
|
72
|
-
|
|
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:
|
|
70
|
+
## Why Use `pgsql-deparser`?
|
|
81
71
|
|
|
82
|
-
|
|
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
|
-
```
|
|
72
|
+
`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.
|
|
88
73
|
|
|
89
|
-
##
|
|
74
|
+
## Versions
|
|
90
75
|
|
|
91
|
-
|
|
76
|
+
As of PG 13, PG majors versions maintained will have a matching dedicated major npm version. Only the latest Postgres stable release receives active updates.
|
|
92
77
|
|
|
93
|
-
|
|
94
|
-
import { deparseSync as deparse } from 'pgsql-deparser';
|
|
78
|
+
Our latest is built with `13-latest` branch from libpg_query
|
|
95
79
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
80
|
+
| PostgreSQL Major Version | libpg_query | Status | npm
|
|
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)) |
|
|
102
86
|
|
|
103
|
-
const sql = deparse(ast, options);
|
|
104
|
-
```
|
|
105
87
|
|
|
106
|
-
|
|
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 |
|
|
88
|
+
## Related
|
|
112
89
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
// SELECT
|
|
122
|
-
// id,
|
|
123
|
-
// name
|
|
124
|
-
// FROM users
|
|
125
|
-
// WHERE
|
|
126
|
-
// active = true;
|
|
127
|
-
```
|
|
90
|
+
* [pgsql-parser](https://github.com/launchql/pgsql-parser): The real PostgreSQL parser for Node.js, providing symmetric parsing and deparsing of SQL statements with actual PostgreSQL parser integration.
|
|
91
|
+
* [pgsql-deparser](https://github.com/launchql/pgsql-parser/tree/main/packages/deparser): A streamlined tool designed for converting PostgreSQL ASTs back into SQL queries, focusing solely on deparser functionality to complement `pgsql-parser`.
|
|
92
|
+
* [pgsql-enums](https://github.com/launchql/pgsql-parser/tree/main/packages/pgsql-enums): A utility package offering easy access to PostgreSQL enumeration types in JSON format, aiding in string and integer conversions of enums used within ASTs to compliment `pgsql-parser`
|
|
93
|
+
* [@pgsql/enums](https://github.com/launchql/pgsql-parser/tree/main/packages/enums): Provides PostgreSQL AST enums in TypeScript, enhancing type safety and usability in projects interacting with PostgreSQL AST nodes.
|
|
94
|
+
* [@pgsql/types](https://github.com/launchql/pgsql-parser/tree/main/packages/types): Offers TypeScript type definitions for PostgreSQL AST nodes, facilitating type-safe construction, analysis, and manipulation of ASTs.
|
|
95
|
+
* [@pgsql/utils](https://github.com/launchql/pgsql-parser/tree/main/packages/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.
|
|
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.
|
|
128
98
|
|
|
129
|
-
|
|
99
|
+
Thanks [@lfittl](https://github.com/lfittl) for building the core `libpg_query` suite:
|
|
130
100
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
101
|
+
* [libpg_query](https://github.com/pganalyze/libpg_query)
|
|
102
|
+
* [pg_query](https://github.com/lfittl/pg_query)
|
|
103
|
+
* [pg_query.go](https://github.com/lfittl/pg_query.go)
|
|
134
104
|
|
|
135
105
|
## Credits
|
|
136
106
|
|
|
137
|
-
|
|
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
|
|
107
|
+
Thanks to [@zhm](https://github.com/zhm) for the OG parser that started it all:
|
|
144
108
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
* [
|
|
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.
|
|
109
|
+
* [pg-query-parser](https://github.com/zhm/pg-query-parser)
|
|
110
|
+
* [pg-query-native](https://github.com/zhm/node-pg-query-native)
|
|
111
|
+
* [Original LICENSE](https://github.com/zhm/pg-query-parser/blob/master/LICENSE.md)
|
|
155
112
|
|
|
156
113
|
## Disclaimer
|
|
157
114
|
|
|
158
|
-
AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED
|
|
115
|
+
AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED “AS IS”, AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND.
|
|
159
116
|
|
|
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.
|
|
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.
|
package/deparser.d.ts
ADDED
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import { Node } from '@pgsql/types';
|
|
2
|
+
import { DeparserContext, DeparserVisitor } from './visitors/base';
|
|
3
|
+
import * as t from '@pgsql/types';
|
|
4
|
+
export interface DeparserOptions {
|
|
5
|
+
newline?: string;
|
|
6
|
+
tab?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare class Deparser implements DeparserVisitor {
|
|
9
|
+
private formatter;
|
|
10
|
+
private tree;
|
|
11
|
+
constructor(tree: Node | Node[], opts?: DeparserOptions);
|
|
12
|
+
static deparse(query: Node | Node[], opts?: DeparserOptions): string;
|
|
13
|
+
deparseQuery(): string;
|
|
14
|
+
deparse(node: Node, context?: DeparserContext): string | null;
|
|
15
|
+
visit(node: Node, context?: DeparserContext): string;
|
|
16
|
+
getNodeType(node: Node): string;
|
|
17
|
+
getNodeData(node: Node): any;
|
|
18
|
+
RawStmt(node: t.RawStmt, context: DeparserContext): string;
|
|
19
|
+
stmt(node: any, context?: DeparserContext): string;
|
|
20
|
+
SelectStmt(node: t.SelectStmt, context: DeparserContext): string;
|
|
21
|
+
A_Expr(node: t.A_Expr, context: DeparserContext): string;
|
|
22
|
+
deparseOperatorName(name: t.Node[]): string;
|
|
23
|
+
private getOperatorPrecedence;
|
|
24
|
+
private needsParentheses;
|
|
25
|
+
private isComplexExpression;
|
|
26
|
+
visitBetweenRange(rexpr: any, context: DeparserContext): string;
|
|
27
|
+
InsertStmt(node: t.InsertStmt, context: DeparserContext): string;
|
|
28
|
+
UpdateStmt(node: t.UpdateStmt, context: DeparserContext): string;
|
|
29
|
+
DeleteStmt(node: t.DeleteStmt, context: DeparserContext): string;
|
|
30
|
+
WithClause(node: t.WithClause, context: DeparserContext): string;
|
|
31
|
+
ResTarget(node: t.ResTarget, context: DeparserContext): string;
|
|
32
|
+
deparseReturningList(list: t.Node[], context: DeparserContext): string;
|
|
33
|
+
BoolExpr(node: t.BoolExpr, context: DeparserContext): string;
|
|
34
|
+
FuncCall(node: t.FuncCall, context: DeparserContext): string;
|
|
35
|
+
FuncExpr(node: t.FuncExpr, context: DeparserContext): string;
|
|
36
|
+
A_Const(node: t.A_Const, context: DeparserContext): string;
|
|
37
|
+
ColumnRef(node: t.ColumnRef, context: DeparserContext): string;
|
|
38
|
+
TypeName(node: t.TypeName, context: DeparserContext): string;
|
|
39
|
+
Alias(node: t.Alias, context: DeparserContext): string;
|
|
40
|
+
RangeVar(node: t.RangeVar, context: DeparserContext): string;
|
|
41
|
+
formatIntervalTypeMods(typmods: t.Node[], context: DeparserContext): string | null;
|
|
42
|
+
formatTypeMods(typmods: t.Node[], context: DeparserContext): string | null;
|
|
43
|
+
formatSingleTypeMod(typemod: number, typeName: string): string | null;
|
|
44
|
+
getPgCatalogTypeName(typeName: string, size: string | null): string;
|
|
45
|
+
A_ArrayExpr(node: t.A_ArrayExpr, context: DeparserContext): string;
|
|
46
|
+
A_Indices(node: t.A_Indices, context: DeparserContext): string;
|
|
47
|
+
A_Indirection(node: t.A_Indirection, context: DeparserContext): string;
|
|
48
|
+
A_Star(node: t.A_Star, context: DeparserContext): string;
|
|
49
|
+
CaseExpr(node: t.CaseExpr, context: DeparserContext): string;
|
|
50
|
+
CoalesceExpr(node: t.CoalesceExpr, context: DeparserContext): string;
|
|
51
|
+
TypeCast(node: t.TypeCast, context: DeparserContext): string;
|
|
52
|
+
CollateClause(node: t.CollateClause, context: DeparserContext): string;
|
|
53
|
+
BooleanTest(node: t.BooleanTest, context: DeparserContext): string;
|
|
54
|
+
NullTest(node: t.NullTest, context: DeparserContext): string;
|
|
55
|
+
private static readonly RESERVED_WORDS;
|
|
56
|
+
private static needsQuotes;
|
|
57
|
+
quoteIfNeeded(value: string): string;
|
|
58
|
+
preserveOperatorDefElemCase(defName: string): string;
|
|
59
|
+
String(node: t.String, context: DeparserContext): string;
|
|
60
|
+
Integer(node: t.Integer, context: DeparserContext): string;
|
|
61
|
+
Float(node: t.Float, context: DeparserContext): string;
|
|
62
|
+
Boolean(node: t.Boolean, context: DeparserContext): string;
|
|
63
|
+
BitString(node: t.BitString, context: DeparserContext): string;
|
|
64
|
+
Null(node: t.Node, context: DeparserContext): string;
|
|
65
|
+
List(node: t.List, context: DeparserContext): string;
|
|
66
|
+
CreateStmt(node: t.CreateStmt, context: DeparserContext): string;
|
|
67
|
+
ColumnDef(node: t.ColumnDef, context: DeparserContext): string;
|
|
68
|
+
Constraint(node: t.Constraint, context: DeparserContext): string;
|
|
69
|
+
SubLink(node: t.SubLink, context: DeparserContext): string;
|
|
70
|
+
CaseWhen(node: t.CaseWhen, context: DeparserContext): string;
|
|
71
|
+
WindowDef(node: t.WindowDef, context: DeparserContext): string;
|
|
72
|
+
formatWindowFrame(node: any): string | null;
|
|
73
|
+
SortBy(node: t.SortBy, context: DeparserContext): string;
|
|
74
|
+
GroupingSet(node: t.GroupingSet, context: DeparserContext): string;
|
|
75
|
+
CommonTableExpr(node: t.CommonTableExpr, context: DeparserContext): string;
|
|
76
|
+
ParamRef(node: t.ParamRef, context: DeparserContext): string;
|
|
77
|
+
LockingClause(node: any, context: DeparserContext): string;
|
|
78
|
+
MinMaxExpr(node: t.MinMaxExpr, context: DeparserContext): string;
|
|
79
|
+
RowExpr(node: t.RowExpr, context: DeparserContext): string;
|
|
80
|
+
OpExpr(node: t.OpExpr, context: DeparserContext): string;
|
|
81
|
+
DistinctExpr(node: t.DistinctExpr, context: DeparserContext): string;
|
|
82
|
+
NullIfExpr(node: t.NullIfExpr, context: DeparserContext): string;
|
|
83
|
+
ScalarArrayOpExpr(node: t.ScalarArrayOpExpr, context: DeparserContext): string;
|
|
84
|
+
Aggref(node: t.Aggref, context: DeparserContext): string;
|
|
85
|
+
WindowFunc(node: t.WindowFunc, context: DeparserContext): string;
|
|
86
|
+
FieldSelect(node: t.FieldSelect, context: DeparserContext): string;
|
|
87
|
+
RelabelType(node: t.RelabelType, context: DeparserContext): string;
|
|
88
|
+
CoerceViaIO(node: t.CoerceViaIO, context: DeparserContext): string;
|
|
89
|
+
ArrayCoerceExpr(node: t.ArrayCoerceExpr, context: DeparserContext): string;
|
|
90
|
+
ConvertRowtypeExpr(node: t.ConvertRowtypeExpr, context: DeparserContext): string;
|
|
91
|
+
NamedArgExpr(node: t.NamedArgExpr, context: DeparserContext): string;
|
|
92
|
+
ViewStmt(node: t.ViewStmt, context: DeparserContext): string;
|
|
93
|
+
IndexStmt(node: t.IndexStmt, context: DeparserContext): string;
|
|
94
|
+
IndexElem(node: t.IndexElem, context: DeparserContext): string;
|
|
95
|
+
PartitionElem(node: t.PartitionElem, context: DeparserContext): string;
|
|
96
|
+
PartitionCmd(node: t.PartitionCmd, context: DeparserContext): string;
|
|
97
|
+
private getAggFunctionName;
|
|
98
|
+
private getWindowFunctionName;
|
|
99
|
+
private getOperatorName;
|
|
100
|
+
JoinExpr(node: t.JoinExpr, context: DeparserContext): string;
|
|
101
|
+
FromExpr(node: t.FromExpr, context: DeparserContext): string;
|
|
102
|
+
TransactionStmt(node: t.TransactionStmt, context: DeparserContext): string;
|
|
103
|
+
VariableSetStmt(node: t.VariableSetStmt, context: DeparserContext): string;
|
|
104
|
+
VariableShowStmt(node: t.VariableShowStmt, context: DeparserContext): string;
|
|
105
|
+
CreateSchemaStmt(node: t.CreateSchemaStmt, context: DeparserContext): string;
|
|
106
|
+
RoleSpec(node: t.RoleSpec, context: DeparserContext): string;
|
|
107
|
+
roletype(node: any, context: DeparserContext): string;
|
|
108
|
+
DropStmt(node: t.DropStmt, context: DeparserContext): string;
|
|
109
|
+
TruncateStmt(node: t.TruncateStmt, context: DeparserContext): string;
|
|
110
|
+
ReturnStmt(node: t.ReturnStmt, context: DeparserContext): string;
|
|
111
|
+
PLAssignStmt(node: t.PLAssignStmt, context: DeparserContext): string;
|
|
112
|
+
CopyStmt(node: t.CopyStmt, context: DeparserContext): string;
|
|
113
|
+
AlterTableStmt(node: t.AlterTableStmt, context: DeparserContext): string;
|
|
114
|
+
AlterTableCmd(node: t.AlterTableCmd, context: DeparserContext): string;
|
|
115
|
+
CreateFunctionStmt(node: t.CreateFunctionStmt, context: DeparserContext): string;
|
|
116
|
+
FunctionParameter(node: t.FunctionParameter, context: DeparserContext): string;
|
|
117
|
+
CreateEnumStmt(node: t.CreateEnumStmt, context: DeparserContext): string;
|
|
118
|
+
CreateDomainStmt(node: t.CreateDomainStmt, context: DeparserContext): string;
|
|
119
|
+
CreateRoleStmt(node: t.CreateRoleStmt, context: DeparserContext): string;
|
|
120
|
+
DefElem(node: t.DefElem, context: DeparserContext): string;
|
|
121
|
+
CreateTableSpaceStmt(node: t.CreateTableSpaceStmt, context: DeparserContext): string;
|
|
122
|
+
DropTableSpaceStmt(node: t.DropTableSpaceStmt, context: DeparserContext): string;
|
|
123
|
+
AlterTableSpaceOptionsStmt(node: t.AlterTableSpaceOptionsStmt, context: DeparserContext): string;
|
|
124
|
+
CreateExtensionStmt(node: t.CreateExtensionStmt, context: DeparserContext): string;
|
|
125
|
+
AlterExtensionStmt(node: t.AlterExtensionStmt, context: DeparserContext): string;
|
|
126
|
+
CreateFdwStmt(node: t.CreateFdwStmt, context: DeparserContext): string;
|
|
127
|
+
SetOperationStmt(node: t.SetOperationStmt, context: DeparserContext): string;
|
|
128
|
+
ReplicaIdentityStmt(node: t.ReplicaIdentityStmt, context: DeparserContext): string;
|
|
129
|
+
AlterCollationStmt(node: t.AlterCollationStmt, context: DeparserContext): string;
|
|
130
|
+
AlterDomainStmt(node: t.AlterDomainStmt, context: DeparserContext): string;
|
|
131
|
+
PrepareStmt(node: t.PrepareStmt, context: DeparserContext): string;
|
|
132
|
+
ExecuteStmt(node: t.ExecuteStmt, context: DeparserContext): string;
|
|
133
|
+
DeallocateStmt(node: t.DeallocateStmt, context: DeparserContext): string;
|
|
134
|
+
NotifyStmt(node: t.NotifyStmt, context: DeparserContext): string;
|
|
135
|
+
ListenStmt(node: t.ListenStmt, context: DeparserContext): string;
|
|
136
|
+
UnlistenStmt(node: t.UnlistenStmt, context: DeparserContext): string;
|
|
137
|
+
CheckPointStmt(node: t.CheckPointStmt, context: DeparserContext): string;
|
|
138
|
+
LoadStmt(node: t.LoadStmt, context: DeparserContext): string;
|
|
139
|
+
DiscardStmt(node: t.DiscardStmt, context: DeparserContext): string;
|
|
140
|
+
CommentStmt(node: t.CommentStmt, context: DeparserContext): string;
|
|
141
|
+
LockStmt(node: t.LockStmt, context: DeparserContext): string;
|
|
142
|
+
CreatePolicyStmt(node: t.CreatePolicyStmt, context: DeparserContext): string;
|
|
143
|
+
AlterPolicyStmt(node: t.AlterPolicyStmt, context: DeparserContext): string;
|
|
144
|
+
CreateUserMappingStmt(node: t.CreateUserMappingStmt, context: DeparserContext): string;
|
|
145
|
+
CreateStatsStmt(node: t.CreateStatsStmt, context: DeparserContext): string;
|
|
146
|
+
StatsElem(node: t.StatsElem, context: DeparserContext): string;
|
|
147
|
+
CreatePublicationStmt(node: t.CreatePublicationStmt, context: DeparserContext): string;
|
|
148
|
+
CreateSubscriptionStmt(node: t.CreateSubscriptionStmt, context: DeparserContext): string;
|
|
149
|
+
AlterPublicationStmt(node: t.AlterPublicationStmt, context: DeparserContext): string;
|
|
150
|
+
AlterSubscriptionStmt(node: t.AlterSubscriptionStmt, context: DeparserContext): string;
|
|
151
|
+
DropSubscriptionStmt(node: t.DropSubscriptionStmt, context: DeparserContext): string;
|
|
152
|
+
DoStmt(node: t.DoStmt, context: DeparserContext): string;
|
|
153
|
+
private generateUniqueDollarTag;
|
|
154
|
+
InlineCodeBlock(node: t.InlineCodeBlock, context: DeparserContext): string;
|
|
155
|
+
CallContext(node: t.CallContext, context: DeparserContext): string;
|
|
156
|
+
ConstraintsSetStmt(node: t.ConstraintsSetStmt, context: DeparserContext): string;
|
|
157
|
+
AlterSystemStmt(node: t.AlterSystemStmt, context: DeparserContext): string;
|
|
158
|
+
VacuumRelation(node: t.VacuumRelation, context: DeparserContext): string;
|
|
159
|
+
DropOwnedStmt(node: t.DropOwnedStmt, context: DeparserContext): string;
|
|
160
|
+
ReassignOwnedStmt(node: t.ReassignOwnedStmt, context: DeparserContext): string;
|
|
161
|
+
AlterTSDictionaryStmt(node: t.AlterTSDictionaryStmt, context: DeparserContext): string;
|
|
162
|
+
AlterTSConfigurationStmt(node: t.AlterTSConfigurationStmt, context: DeparserContext): string;
|
|
163
|
+
ClosePortalStmt(node: t.ClosePortalStmt, context: DeparserContext): string;
|
|
164
|
+
FetchStmt(node: t.FetchStmt, context: DeparserContext): string;
|
|
165
|
+
AlterStatsStmt(node: t.AlterStatsStmt, context: DeparserContext): string;
|
|
166
|
+
ObjectWithArgs(node: t.ObjectWithArgs, context: DeparserContext): string;
|
|
167
|
+
AlterOperatorStmt(node: t.AlterOperatorStmt, context: DeparserContext): string;
|
|
168
|
+
AlterFdwStmt(node: t.AlterFdwStmt, context: DeparserContext): string;
|
|
169
|
+
CreateForeignServerStmt(node: t.CreateForeignServerStmt, context: DeparserContext): string;
|
|
170
|
+
AlterForeignServerStmt(node: t.AlterForeignServerStmt, context: DeparserContext): string;
|
|
171
|
+
AlterUserMappingStmt(node: t.AlterUserMappingStmt, context: DeparserContext): string;
|
|
172
|
+
DropUserMappingStmt(node: t.DropUserMappingStmt, context: DeparserContext): string;
|
|
173
|
+
ImportForeignSchemaStmt(node: t.ImportForeignSchemaStmt, context: DeparserContext): string;
|
|
174
|
+
ClusterStmt(node: t.ClusterStmt, context: DeparserContext): string;
|
|
175
|
+
VacuumStmt(node: t.VacuumStmt, context: DeparserContext): string;
|
|
176
|
+
ExplainStmt(node: t.ExplainStmt, context: DeparserContext): string;
|
|
177
|
+
ReindexStmt(node: t.ReindexStmt, context: DeparserContext): string;
|
|
178
|
+
CallStmt(node: t.CallStmt, context: DeparserContext): string;
|
|
179
|
+
CreatedbStmt(node: t.CreatedbStmt, context: DeparserContext): string;
|
|
180
|
+
DropdbStmt(node: t.DropdbStmt, context: DeparserContext): string;
|
|
181
|
+
RenameStmt(node: t.RenameStmt, context: DeparserContext): string;
|
|
182
|
+
AlterOwnerStmt(node: t.AlterOwnerStmt, context: DeparserContext): string;
|
|
183
|
+
GrantStmt(node: t.GrantStmt, context: DeparserContext): string;
|
|
184
|
+
GrantRoleStmt(node: t.GrantRoleStmt, context: DeparserContext): string;
|
|
185
|
+
SecLabelStmt(node: t.SecLabelStmt, context: DeparserContext): string;
|
|
186
|
+
AlterDefaultPrivilegesStmt(node: t.AlterDefaultPrivilegesStmt, context: DeparserContext): string;
|
|
187
|
+
CreateConversionStmt(node: t.CreateConversionStmt, context: DeparserContext): string;
|
|
188
|
+
CreateCastStmt(node: t.CreateCastStmt, context: DeparserContext): string;
|
|
189
|
+
CreatePLangStmt(node: t.CreatePLangStmt, context: DeparserContext): string;
|
|
190
|
+
CreateTransformStmt(node: t.CreateTransformStmt, context: DeparserContext): string;
|
|
191
|
+
CreateTrigStmt(node: t.CreateTrigStmt, context: DeparserContext): string;
|
|
192
|
+
TriggerTransition(node: t.TriggerTransition, context: DeparserContext): string;
|
|
193
|
+
CreateEventTrigStmt(node: t.CreateEventTrigStmt, context: DeparserContext): string;
|
|
194
|
+
AlterEventTrigStmt(node: t.AlterEventTrigStmt, context: DeparserContext): string;
|
|
195
|
+
CreateOpClassStmt(node: t.CreateOpClassStmt, context: DeparserContext): string;
|
|
196
|
+
CreateOpFamilyStmt(node: t.CreateOpFamilyStmt, context: DeparserContext): string;
|
|
197
|
+
AlterOpFamilyStmt(node: t.AlterOpFamilyStmt, context: DeparserContext): string;
|
|
198
|
+
MergeStmt(node: t.MergeStmt, context: DeparserContext): string;
|
|
199
|
+
AlterTableMoveAllStmt(node: t.AlterTableMoveAllStmt, context: DeparserContext): string;
|
|
200
|
+
CreateSeqStmt(node: t.CreateSeqStmt, context: DeparserContext): string;
|
|
201
|
+
AlterSeqStmt(node: t.AlterSeqStmt, context: DeparserContext): string;
|
|
202
|
+
CompositeTypeStmt(node: t.CompositeTypeStmt, context: DeparserContext): string;
|
|
203
|
+
CreateRangeStmt(node: t.CreateRangeStmt, context: DeparserContext): string;
|
|
204
|
+
AlterEnumStmt(node: t.AlterEnumStmt, context: DeparserContext): string;
|
|
205
|
+
AlterTypeStmt(node: t.AlterTypeStmt, context: DeparserContext): string;
|
|
206
|
+
AlterRoleStmt(node: t.AlterRoleStmt, context: DeparserContext): string;
|
|
207
|
+
DropRoleStmt(node: t.DropRoleStmt, context: DeparserContext): string;
|
|
208
|
+
targetList(node: any, context: DeparserContext): string;
|
|
209
|
+
CreateAggregateStmt(node: t.DefineStmt, context: DeparserContext): string;
|
|
210
|
+
CreateTableAsStmt(node: t.CreateTableAsStmt, context: DeparserContext): string;
|
|
211
|
+
RefreshMatViewStmt(node: t.RefreshMatViewStmt, context: DeparserContext): string;
|
|
212
|
+
AccessPriv(node: t.AccessPriv, context: DeparserContext): string;
|
|
213
|
+
aliasname(node: any, context: DeparserContext): string;
|
|
214
|
+
DefineStmt(node: t.DefineStmt, context: DeparserContext): string;
|
|
215
|
+
AlterDatabaseStmt(node: t.AlterDatabaseStmt, context: DeparserContext): string;
|
|
216
|
+
AlterDatabaseRefreshCollStmt(node: t.AlterDatabaseRefreshCollStmt, context: DeparserContext): string;
|
|
217
|
+
AlterDatabaseSetStmt(node: t.AlterDatabaseSetStmt, context: DeparserContext): string;
|
|
218
|
+
DeclareCursorStmt(node: t.DeclareCursorStmt, context: DeparserContext): string;
|
|
219
|
+
PublicationObjSpec(node: t.PublicationObjSpec, context: DeparserContext): string;
|
|
220
|
+
PublicationTable(node: t.PublicationTable, context: DeparserContext): string;
|
|
221
|
+
CreateAmStmt(node: t.CreateAmStmt, context: DeparserContext): string;
|
|
222
|
+
IntoClause(node: t.IntoClause, context: DeparserContext): string;
|
|
223
|
+
OnConflictExpr(node: t.OnConflictExpr, context: DeparserContext): string;
|
|
224
|
+
ScanToken(node: t.ScanToken, context: DeparserContext): string;
|
|
225
|
+
CreateOpClassItem(node: t.CreateOpClassItem, context: DeparserContext): string;
|
|
226
|
+
Var(node: t.Var, context: DeparserContext): string;
|
|
227
|
+
TableFunc(node: t.TableFunc, context: DeparserContext): string;
|
|
228
|
+
RangeTableFunc(node: t.RangeTableFunc, context: DeparserContext): string;
|
|
229
|
+
RangeTableFuncCol(node: t.RangeTableFuncCol, context: DeparserContext): string;
|
|
230
|
+
JsonArrayQueryConstructor(node: t.JsonArrayQueryConstructor, context: DeparserContext): string;
|
|
231
|
+
RangeFunction(node: t.RangeFunction, context: DeparserContext): string;
|
|
232
|
+
XmlExpr(node: t.XmlExpr, context: DeparserContext): string;
|
|
233
|
+
schemaname(node: any, context: DeparserContext): string;
|
|
234
|
+
RangeTableSample(node: t.RangeTableSample, context: DeparserContext): string;
|
|
235
|
+
XmlSerialize(node: t.XmlSerialize, context: DeparserContext): string;
|
|
236
|
+
ctes(node: any, context: DeparserContext): string;
|
|
237
|
+
RuleStmt(node: t.RuleStmt, context: DeparserContext): string;
|
|
238
|
+
RangeSubselect(node: t.RangeSubselect, context: DeparserContext): string;
|
|
239
|
+
relname(node: any, context: DeparserContext): string;
|
|
240
|
+
rel(node: any, context: DeparserContext): string;
|
|
241
|
+
objname(node: any, context: DeparserContext): string;
|
|
242
|
+
SQLValueFunction(node: t.SQLValueFunction, context: DeparserContext): string;
|
|
243
|
+
GroupingFunc(node: t.GroupingFunc, context: DeparserContext): string;
|
|
244
|
+
MultiAssignRef(node: t.MultiAssignRef, context: DeparserContext): string;
|
|
245
|
+
SetToDefault(node: t.SetToDefault, context: DeparserContext): string;
|
|
246
|
+
CurrentOfExpr(node: t.CurrentOfExpr, context: DeparserContext): string;
|
|
247
|
+
TableLikeClause(node: t.TableLikeClause, context: DeparserContext): string;
|
|
248
|
+
AlterFunctionStmt(node: t.AlterFunctionStmt, context: DeparserContext): string;
|
|
249
|
+
AlterObjectSchemaStmt(node: t.AlterObjectSchemaStmt, context: DeparserContext): string;
|
|
250
|
+
AlterRoleSetStmt(node: t.AlterRoleSetStmt, context: DeparserContext): string;
|
|
251
|
+
CreateForeignTableStmt(node: t.CreateForeignTableStmt, context: DeparserContext): string;
|
|
252
|
+
version(node: any, context: any): string;
|
|
253
|
+
}
|