@tablecraft-app/plugin-postgres 1.21.0 → 1.24.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/index.js CHANGED
@@ -23391,13 +23391,13 @@ var AlignedPrinter = class {
23391
23391
  } else this.inline(writer, clause, false);
23392
23392
  }
23393
23393
  }
23394
- #rows(writer, nodes, column) {
23394
+ #rows(writer, nodes, column, leadSpace = true) {
23395
23395
  const { parts, commas } = splitTop(nodes, COMMA$1);
23396
23396
  const saved = writer.indent;
23397
23397
  writer.indent = column;
23398
23398
  parts.forEach((part, at) => {
23399
23399
  if (at > 0) writer.newline(column);
23400
- this.inline(writer, part, at === 0);
23400
+ this.inline(writer, part, at === 0 && leadSpace);
23401
23401
  const comma = commas[at];
23402
23402
  if (comma !== void 0) writer.tok(comma, comma.text, false);
23403
23403
  });
@@ -23432,7 +23432,8 @@ var AlignedPrinter = class {
23432
23432
  let previous = null;
23433
23433
  for (const node of nodes) {
23434
23434
  const space = previous === null ? leadSpace : this.#spaceBetween(previous, node, options);
23435
- this.node(writer, node, space, options);
23435
+ if (isWord(previous ?? void 0, "IN") && node.type === "group" && options.preserve !== true) this.#inList(writer, node, space);
23436
+ else this.node(writer, node, space, options);
23436
23437
  previous = node;
23437
23438
  }
23438
23439
  }
@@ -23447,6 +23448,16 @@ var AlignedPrinter = class {
23447
23448
  else this.inline(writer, group.children, false, { preserve: options.preserve ?? false });
23448
23449
  writer.tok(group.close, group.close.text, false);
23449
23450
  }
23451
+ /** Two or more values after `IN` go one per line under the first, whatever the width (decision 147). */
23452
+ #inList(writer, group, space) {
23453
+ if (isSubquery(group) || splitTop(group.children, COMMA$1).parts.length < 2) {
23454
+ this.#group(writer, group, space, {});
23455
+ return;
23456
+ }
23457
+ writer.tok(group.open, group.open.text, space);
23458
+ this.#rows(writer, group.children, writer.column, false);
23459
+ writer.tok(group.close, group.close.text, false);
23460
+ }
23450
23461
  /** Inline when it fits `CASE_INLINE_LIMIT`; else `WHEN` / `ELSE` one per line under `CASE`, `END` at its column (rule 14). */
23451
23462
  #case(writer, node, space) {
23452
23463
  const start = writer.column + (space ? 1 : 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tablecraft-app/plugin-postgres",
3
- "version": "1.21.0",
3
+ "version": "1.24.0",
4
4
  "description": "The PostgreSQL datasource plugin for TableCraft, downloaded by the app when a data source needs it.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "postgres",
3
3
  "name": "PostgreSQL",
4
- "version": "1.21.0",
4
+ "version": "1.24.0",
5
5
  "apiVersion": "1.9.0",
6
6
  "entry": "index.js",
7
7
  "capabilities": [