pgsql-deparser 17.9.1 → 17.10.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 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: false)
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` | `false` | Enable pretty formatting with indentation and line breaks |
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 = false) {
5
+ constructor(newlineChar = '\n', tabChar = ' ', prettyMode = true) {
6
6
  this.newlineChar = newlineChar;
7
7
  this.tabChar = tabChar;
8
8
  this.prettyMode = prettyMode;
@@ -19,7 +19,7 @@ export class DeparserContext {
19
19
  isEnumValue;
20
20
  objtype;
21
21
  subtype;
22
- constructor({ indentLevel = 0, prettyMode = false, isStringLiteral, parentNodeTypes = [], formatter, select, from, group, sort, insertColumns, update, bool, isColumnConstraint, isDomainConstraint, alterColumnOptions, alterTableOptions, isEnumValue, objtype, subtype, ...rest } = {}) {
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.9.1",
3
+ "version": "17.10.0",
4
4
  "author": "Dan Lynch <pyramation@gmail.com>",
5
5
  "description": "PostgreSQL AST Deparser",
6
6
  "main": "index.js",
@@ -58,5 +58,5 @@
58
58
  "dependencies": {
59
59
  "@pgsql/types": "^17.6.1"
60
60
  },
61
- "gitHead": "ec88c0497ed19b222655ab8dba6a2f1ca1350fee"
61
+ "gitHead": "ccaa3c5ef9104de83e8c2624706520e4a2be5e88"
62
62
  }
@@ -5,7 +5,7 @@ class SqlFormatter {
5
5
  newlineChar;
6
6
  tabChar;
7
7
  prettyMode;
8
- constructor(newlineChar = '\n', tabChar = ' ', prettyMode = false) {
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 = false, isStringLiteral, parentNodeTypes = [], formatter, select, from, group, sort, insertColumns, update, bool, isColumnConstraint, isDomainConstraint, alterColumnOptions, alterTableOptions, isEnumValue, objtype, subtype, ...rest } = {}) {
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;