pgsql-deparser 17.9.1 → 17.11.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 +2 -2
- package/esm/utils/sql-formatter.js +1 -1
- package/esm/visitors/base.js +1 -1
- package/package.json +3 -3
- package/utils/sql-formatter.js +1 -1
- package/visitors/base.js +1 -1
package/README.md
CHANGED
|
@@ -99,7 +99,7 @@ The deparser accepts optional configuration for formatting and output control:
|
|
|
99
99
|
import { deparseSync as deparse } from 'pgsql-deparser';
|
|
100
100
|
|
|
101
101
|
const options = {
|
|
102
|
-
pretty: true, // Enable pretty formatting (default:
|
|
102
|
+
pretty: true, // Enable pretty formatting (default: true)
|
|
103
103
|
newline: '\n', // Newline character (default: '\n')
|
|
104
104
|
tab: ' ', // Tab/indentation character (default: ' ')
|
|
105
105
|
semicolons: true // Add semicolons to statements (default: true)
|
|
@@ -110,7 +110,7 @@ const sql = deparse(ast, options);
|
|
|
110
110
|
|
|
111
111
|
| Option | Type | Default | Description |
|
|
112
112
|
|--------|------|---------|-------------|
|
|
113
|
-
| `pretty` | `boolean` | `
|
|
113
|
+
| `pretty` | `boolean` | `true` | Enable pretty formatting with indentation and line breaks |
|
|
114
114
|
| `newline` | `string` | `'\n'` | Character(s) used for line breaks |
|
|
115
115
|
| `tab` | `string` | `' '` | Character(s) used for indentation |
|
|
116
116
|
| `semicolons` | `boolean` | `true` | Add semicolons to SQL statements |
|
|
@@ -2,7 +2,7 @@ export class SqlFormatter {
|
|
|
2
2
|
newlineChar;
|
|
3
3
|
tabChar;
|
|
4
4
|
prettyMode;
|
|
5
|
-
constructor(newlineChar = '\n', tabChar = ' ', prettyMode =
|
|
5
|
+
constructor(newlineChar = '\n', tabChar = ' ', prettyMode = true) {
|
|
6
6
|
this.newlineChar = newlineChar;
|
|
7
7
|
this.tabChar = tabChar;
|
|
8
8
|
this.prettyMode = prettyMode;
|
package/esm/visitors/base.js
CHANGED
|
@@ -19,7 +19,7 @@ export class DeparserContext {
|
|
|
19
19
|
isEnumValue;
|
|
20
20
|
objtype;
|
|
21
21
|
subtype;
|
|
22
|
-
constructor({ indentLevel = 0, prettyMode =
|
|
22
|
+
constructor({ indentLevel = 0, prettyMode = true, isStringLiteral, parentNodeTypes = [], formatter, select, from, group, sort, insertColumns, update, bool, isColumnConstraint, isDomainConstraint, alterColumnOptions, alterTableOptions, isEnumValue, objtype, subtype, ...rest } = {}) {
|
|
23
23
|
this.indentLevel = indentLevel;
|
|
24
24
|
this.prettyMode = prettyMode;
|
|
25
25
|
this.isStringLiteral = isStringLiteral;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pgsql-deparser",
|
|
3
|
-
"version": "17.
|
|
3
|
+
"version": "17.11.1",
|
|
4
4
|
"author": "Dan Lynch <pyramation@gmail.com>",
|
|
5
5
|
"description": "PostgreSQL AST Deparser",
|
|
6
6
|
"main": "index.js",
|
|
@@ -53,10 +53,10 @@
|
|
|
53
53
|
"database"
|
|
54
54
|
],
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"libpg-query": "17.
|
|
56
|
+
"libpg-query": "17.6.0"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@pgsql/types": "^17.6.1"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "65507c8470015acb1b93c1ae36d470a40b89f27f"
|
|
62
62
|
}
|
package/utils/sql-formatter.js
CHANGED
|
@@ -5,7 +5,7 @@ class SqlFormatter {
|
|
|
5
5
|
newlineChar;
|
|
6
6
|
tabChar;
|
|
7
7
|
prettyMode;
|
|
8
|
-
constructor(newlineChar = '\n', tabChar = ' ', prettyMode =
|
|
8
|
+
constructor(newlineChar = '\n', tabChar = ' ', prettyMode = true) {
|
|
9
9
|
this.newlineChar = newlineChar;
|
|
10
10
|
this.tabChar = tabChar;
|
|
11
11
|
this.prettyMode = prettyMode;
|
package/visitors/base.js
CHANGED
|
@@ -22,7 +22,7 @@ class DeparserContext {
|
|
|
22
22
|
isEnumValue;
|
|
23
23
|
objtype;
|
|
24
24
|
subtype;
|
|
25
|
-
constructor({ indentLevel = 0, prettyMode =
|
|
25
|
+
constructor({ indentLevel = 0, prettyMode = true, isStringLiteral, parentNodeTypes = [], formatter, select, from, group, sort, insertColumns, update, bool, isColumnConstraint, isDomainConstraint, alterColumnOptions, alterTableOptions, isEnumValue, objtype, subtype, ...rest } = {}) {
|
|
26
26
|
this.indentLevel = indentLevel;
|
|
27
27
|
this.prettyMode = prettyMode;
|
|
28
28
|
this.isStringLiteral = isStringLiteral;
|