pgsql-deparser 13.16.0 → 14.0.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.
Files changed (62) hide show
  1. package/README.md +88 -45
  2. package/dist/README.md +160 -0
  3. package/dist/deparser/deparser.d.ts +301 -0
  4. package/dist/deparser/deparser.js +10005 -0
  5. package/dist/deparser/index.d.ts +9 -0
  6. package/dist/deparser/index.js +17 -0
  7. package/dist/deparser/utils/list-utils.d.ts +8 -0
  8. package/dist/deparser/utils/list-utils.js +30 -0
  9. package/dist/deparser/utils/quote-utils.d.ts +24 -0
  10. package/dist/deparser/utils/quote-utils.js +89 -0
  11. package/dist/deparser/utils/sql-formatter.d.ts +16 -0
  12. package/dist/deparser/utils/sql-formatter.js +40 -0
  13. package/dist/deparser/visitors/base.d.ts +21 -0
  14. package/dist/deparser/visitors/base.js +34 -0
  15. package/dist/esm/deparser/deparser.js +10001 -0
  16. package/dist/esm/deparser/index.js +13 -0
  17. package/dist/esm/deparser/utils/list-utils.js +26 -0
  18. package/dist/esm/deparser/utils/quote-utils.js +85 -0
  19. package/dist/esm/deparser/utils/sql-formatter.js +36 -0
  20. package/dist/esm/deparser/visitors/base.js +30 -0
  21. package/dist/esm/index.js +15 -0
  22. package/dist/esm/v14-to-v15.js +1220 -0
  23. package/dist/esm/v14-to-v17-direct.js +67 -0
  24. package/dist/esm/v15-to-v16.js +2881 -0
  25. package/dist/esm/v16-to-v17.js +1488 -0
  26. package/dist/index.d.ts +9 -0
  27. package/dist/index.js +19 -0
  28. package/dist/package.json +42 -0
  29. package/dist/v14-to-v15.d.ts +616 -0
  30. package/dist/v14-to-v15.js +1224 -0
  31. package/dist/v14-to-v17-direct.d.ts +23 -0
  32. package/dist/v14-to-v17-direct.js +71 -0
  33. package/dist/v15-to-v16.d.ts +627 -0
  34. package/dist/v15-to-v16.js +2885 -0
  35. package/dist/v16-to-v17.d.ts +638 -0
  36. package/dist/v16-to-v17.js +1492 -0
  37. package/package.json +27 -75
  38. package/src/deparser/deparser.ts +10026 -0
  39. package/src/deparser/index.ts +14 -0
  40. package/src/deparser/utils/list-utils.ts +27 -0
  41. package/src/deparser/utils/quote-utils.ts +86 -0
  42. package/src/deparser/utils/sql-formatter.ts +37 -0
  43. package/src/deparser/visitors/base.ts +40 -0
  44. package/src/index.ts +27 -3
  45. package/src/v14-to-v15.ts +1621 -0
  46. package/src/v14-to-v17-direct.ts +68 -0
  47. package/src/v15-to-v16.ts +3290 -0
  48. package/src/v16-to-v17.ts +1897 -0
  49. package/tsconfig.esm.json +8 -0
  50. package/tsconfig.json +26 -0
  51. package/main/deparser.js +0 -3495
  52. package/main/index.js +0 -10
  53. package/main/utils/index.js +0 -97
  54. package/module/deparser.js +0 -3492
  55. package/module/index.js +0 -3
  56. package/module/utils/index.js +0 -90
  57. package/src/deparser.ts +0 -4234
  58. package/src/utils/index.ts +0 -92
  59. package/types/deparser.d.ts +0 -119
  60. package/types/index.d.ts +0 -3
  61. package/types/utils/index.d.ts +0 -4
  62. /package/{LICENSE → dist/LICENSE} +0 -0
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 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.
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
- ## Key Features
25
+ ## Features
26
26
 
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.
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 ast, { SelectStmt } from '@pgsql/utils';
39
- import { deparse } from 'pgsql-deparser';
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 = ast.selectStmt({
44
+ const stmt: { SelectStmt: SelectStmt } = t.nodes.selectStmt({
43
45
  targetList: [
44
- ast.resTarget({
45
- val: ast.columnRef({
46
- fields: [ast.aStar()]
46
+ t.nodes.resTarget({
47
+ val: t.nodes.columnRef({
48
+ fields: [t.nodes.aStar()]
47
49
  })
48
50
  })
49
51
  ],
50
52
  fromClause: [
51
- ast.rangeVar({
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(stmts));
67
+ console.log(deparse(stmt));
66
68
 
67
69
  // Output: SELECT * FROM another_table
68
70
  ```
69
71
 
70
- ## Why Use `pgsql-deparser`?
72
+ ### Latest Version (PostgreSQL 17)
71
73
 
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.
74
+ ```sh
75
+ npm install pgsql-deparser
76
+ ```
73
77
 
74
- ## Versions
78
+ ### Version-Specific Packages (PostgreSQL 13-16)
75
79
 
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.
80
+ While we highly recommend using PG17, for PostgreSQL versions 13-16, use the version-specific packages:
77
81
 
78
- Our latest is built with `13-latest` branch from libpg_query
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
- | 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)) |
89
+ ## Options
86
90
 
91
+ The deparser accepts optional configuration for formatting and output control:
87
92
 
88
- ## Related
93
+ ```ts
94
+ import { deparseSync as deparse } from 'pgsql-deparser';
89
95
 
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.
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
- Thanks [@lfittl](https://github.com/lfittl) for building the core `libpg_query` suite:
103
+ const sql = deparse(ast, options);
104
+ ```
100
105
 
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)
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
- Thanks to [@zhm](https://github.com/zhm) for the OG parser that started it all:
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
- * [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)
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 AS IS”, AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND.
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.
package/dist/README.md ADDED
@@ -0,0 +1,160 @@
1
+ # pgsql-deparser
2
+
3
+ <p align="center" width="100%">
4
+ <img height="120" src="https://github.com/launchql/pgsql-parser/assets/545047/6440fa7d-918b-4a3b-8d1b-755d85de8bea" />
5
+ </p>
6
+
7
+ <p align="center" width="100%">
8
+ <a href="https://github.com/launchql/pgsql-parser/actions/workflows/run-tests.yaml">
9
+ <img height="20" src="https://github.com/launchql/pgsql-parser/actions/workflows/run-tests.yaml/badge.svg" />
10
+ </a>
11
+ <a href="https://www.npmjs.com/package/pgsql-deparser"><img height="20" src="https://img.shields.io/npm/dt/pgsql-deparser"></a>
12
+ <a href="https://www.npmjs.com/package/pgsql-deparser"><img height="20" src="https://img.shields.io/npm/dw/pgsql-deparser"/></a>
13
+ <a href="https://github.com/launchql/pgsql-parser/blob/main/LICENSE-MIT"><img height="20" src="https://img.shields.io/badge/license-MIT-blue.svg"/></a>
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
+ </p>
16
+
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
+
19
+ ## Installation
20
+
21
+ ```sh
22
+ npm install pgsql-deparser
23
+ ```
24
+
25
+ ## Features
26
+
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
31
+
32
+ ## Deparser Example
33
+
34
+ The `pgsql-deparser` module serializes ASTs to SQL in pure TypeScript, avoiding the full parser's native dependencies. It's useful when only SQL string conversion from ASTs is needed, and is written in pure TypeScript for easy cross-environment deployment.
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`:
37
+
38
+ ```ts
39
+ import * as t from '@pgsql/utils';
40
+ import { RangeVar, SelectStmt } from '@pgsql/types';
41
+ import { deparseSync as deparse } from 'pgsql-deparser';
42
+
43
+ // This could have been obtained from any JSON or AST, not necessarily @pgsql/utils
44
+ const stmt: { SelectStmt: SelectStmt } = t.nodes.selectStmt({
45
+ targetList: [
46
+ t.nodes.resTarget({
47
+ val: t.nodes.columnRef({
48
+ fields: [t.nodes.aStar()]
49
+ })
50
+ })
51
+ ],
52
+ fromClause: [
53
+ t.nodes.rangeVar({
54
+ relname: 'some_table',
55
+ inh: true,
56
+ relpersistence: 'p'
57
+ })
58
+ ],
59
+ limitOption: 'LIMIT_OPTION_DEFAULT',
60
+ op: 'SETOP_NONE'
61
+ });
62
+
63
+ // Modify the AST if needed
64
+ (stmt.SelectStmt.fromClause[0] as {RangeVar: RangeVar}).RangeVar.relname = 'another_table';
65
+
66
+ // Deparse the modified AST back to a SQL string
67
+ console.log(deparse(stmt));
68
+
69
+ // Output: SELECT * FROM another_table
70
+ ```
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
+
89
+ ## Options
90
+
91
+ The deparser accepts optional configuration for formatting and output control:
92
+
93
+ ```ts
94
+ import { deparseSync as deparse } from 'pgsql-deparser';
95
+
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
+ };
102
+
103
+ const sql = deparse(ast, options);
104
+ ```
105
+
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.
134
+
135
+ ## Credits
136
+
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
144
+
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.
155
+
156
+ ## Disclaimer
157
+
158
+ AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED "AS IS", AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND.
159
+
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.