latticesql 4.3.6 → 4.3.7
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/dist/cli.js +29 -3
- package/dist/desktop-entry.js +29 -3
- package/dist/index.cjs +28 -2
- package/dist/index.js +28 -2
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -58444,14 +58444,40 @@ async function normalizeEmptyDeletedAt(db) {
|
|
|
58444
58444
|
await db.migrate([
|
|
58445
58445
|
{
|
|
58446
58446
|
version: `${DELETED_AT_SENTINEL}:all`,
|
|
58447
|
+
// TYPE-AWARE: only a text-like deleted_at column can hold the legacy ''
|
|
58448
|
+
// sentinel. A column that is a real `timestamptz` (some clouds' deleted_at
|
|
58449
|
+
// is) MUST be skipped: the predicate `deleted_at = ''` forces Postgres to
|
|
58450
|
+
// parse `''::timestamptz` at PLAN time — invalid input that throws regardless
|
|
58451
|
+
// of data (a timestamptz column can't even hold ''), which aborted the entire
|
|
58452
|
+
// workspace open. We BLACKLIST the non-text types (timestamp/date/time,
|
|
58453
|
+
// numeric, boolean, json, uuid, bytea, xml) rather than allow-list text — so
|
|
58454
|
+
// text-like columns we don't enumerate (citext, a DOMAIN over text, a custom
|
|
58455
|
+
// text type) are still normalized instead of silently leaving '' rows that
|
|
58456
|
+
// 4.x's `deleted_at IS NULL` predicate would read as DELETED. PER-TABLE FAULT
|
|
58457
|
+
// ISOLATION is the backstop: each table's UPDATE runs in its own
|
|
58458
|
+
// subtransaction, so an exotic type that still errors on `= ''` (enum, inet,
|
|
58459
|
+
// interval, array) — or a blocking trigger/lock — is warned + skipped, never
|
|
58460
|
+
// fatal to the open.
|
|
58447
58461
|
sql: `DO $LATTICE_DAU$
|
|
58448
58462
|
DECLARE r record;
|
|
58449
58463
|
BEGIN
|
|
58450
58464
|
FOR r IN
|
|
58451
58465
|
SELECT table_name FROM information_schema.columns
|
|
58452
|
-
WHERE table_schema = current_schema()
|
|
58466
|
+
WHERE table_schema = current_schema()
|
|
58467
|
+
AND column_name = 'deleted_at'
|
|
58468
|
+
AND data_type NOT IN (
|
|
58469
|
+
'timestamp with time zone', 'timestamp without time zone',
|
|
58470
|
+
'date', 'time with time zone', 'time without time zone',
|
|
58471
|
+
'integer', 'bigint', 'smallint', 'numeric', 'decimal',
|
|
58472
|
+
'real', 'double precision', 'boolean', 'json', 'jsonb',
|
|
58473
|
+
'bytea', 'uuid', 'xml'
|
|
58474
|
+
)
|
|
58453
58475
|
LOOP
|
|
58454
|
-
|
|
58476
|
+
BEGIN
|
|
58477
|
+
EXECUTE format('UPDATE %I SET deleted_at = NULL WHERE deleted_at = ''''', r.table_name);
|
|
58478
|
+
EXCEPTION WHEN others THEN
|
|
58479
|
+
RAISE WARNING 'lattice: skipped deleted_at normalization for %: %', r.table_name, SQLERRM;
|
|
58480
|
+
END;
|
|
58455
58481
|
END LOOP;
|
|
58456
58482
|
END $LATTICE_DAU$;`
|
|
58457
58483
|
}
|
|
@@ -82106,7 +82132,7 @@ function printHelp() {
|
|
|
82106
82132
|
);
|
|
82107
82133
|
}
|
|
82108
82134
|
function getVersion() {
|
|
82109
|
-
if (true) return "4.3.
|
|
82135
|
+
if (true) return "4.3.7";
|
|
82110
82136
|
try {
|
|
82111
82137
|
const pkgPath = new URL("../package.json", import.meta.url).pathname;
|
|
82112
82138
|
const pkg = JSON.parse(readFileSync26(pkgPath, "utf-8"));
|
package/dist/desktop-entry.js
CHANGED
|
@@ -58138,14 +58138,40 @@ async function normalizeEmptyDeletedAt(db) {
|
|
|
58138
58138
|
await db.migrate([
|
|
58139
58139
|
{
|
|
58140
58140
|
version: `${DELETED_AT_SENTINEL}:all`,
|
|
58141
|
+
// TYPE-AWARE: only a text-like deleted_at column can hold the legacy ''
|
|
58142
|
+
// sentinel. A column that is a real `timestamptz` (some clouds' deleted_at
|
|
58143
|
+
// is) MUST be skipped: the predicate `deleted_at = ''` forces Postgres to
|
|
58144
|
+
// parse `''::timestamptz` at PLAN time — invalid input that throws regardless
|
|
58145
|
+
// of data (a timestamptz column can't even hold ''), which aborted the entire
|
|
58146
|
+
// workspace open. We BLACKLIST the non-text types (timestamp/date/time,
|
|
58147
|
+
// numeric, boolean, json, uuid, bytea, xml) rather than allow-list text — so
|
|
58148
|
+
// text-like columns we don't enumerate (citext, a DOMAIN over text, a custom
|
|
58149
|
+
// text type) are still normalized instead of silently leaving '' rows that
|
|
58150
|
+
// 4.x's `deleted_at IS NULL` predicate would read as DELETED. PER-TABLE FAULT
|
|
58151
|
+
// ISOLATION is the backstop: each table's UPDATE runs in its own
|
|
58152
|
+
// subtransaction, so an exotic type that still errors on `= ''` (enum, inet,
|
|
58153
|
+
// interval, array) — or a blocking trigger/lock — is warned + skipped, never
|
|
58154
|
+
// fatal to the open.
|
|
58141
58155
|
sql: `DO $LATTICE_DAU$
|
|
58142
58156
|
DECLARE r record;
|
|
58143
58157
|
BEGIN
|
|
58144
58158
|
FOR r IN
|
|
58145
58159
|
SELECT table_name FROM information_schema.columns
|
|
58146
|
-
WHERE table_schema = current_schema()
|
|
58160
|
+
WHERE table_schema = current_schema()
|
|
58161
|
+
AND column_name = 'deleted_at'
|
|
58162
|
+
AND data_type NOT IN (
|
|
58163
|
+
'timestamp with time zone', 'timestamp without time zone',
|
|
58164
|
+
'date', 'time with time zone', 'time without time zone',
|
|
58165
|
+
'integer', 'bigint', 'smallint', 'numeric', 'decimal',
|
|
58166
|
+
'real', 'double precision', 'boolean', 'json', 'jsonb',
|
|
58167
|
+
'bytea', 'uuid', 'xml'
|
|
58168
|
+
)
|
|
58147
58169
|
LOOP
|
|
58148
|
-
|
|
58170
|
+
BEGIN
|
|
58171
|
+
EXECUTE format('UPDATE %I SET deleted_at = NULL WHERE deleted_at = ''''', r.table_name);
|
|
58172
|
+
EXCEPTION WHEN others THEN
|
|
58173
|
+
RAISE WARNING 'lattice: skipped deleted_at normalization for %: %', r.table_name, SQLERRM;
|
|
58174
|
+
END;
|
|
58149
58175
|
END LOOP;
|
|
58150
58176
|
END $LATTICE_DAU$;`
|
|
58151
58177
|
}
|
|
@@ -81684,7 +81710,7 @@ ${e6.stack ?? ""}`
|
|
|
81684
81710
|
}
|
|
81685
81711
|
|
|
81686
81712
|
// src/desktop-entry.ts
|
|
81687
|
-
var VERSION2 = true ? "4.3.
|
|
81713
|
+
var VERSION2 = true ? "4.3.7" : "unknown";
|
|
81688
81714
|
export {
|
|
81689
81715
|
VERSION2 as VERSION,
|
|
81690
81716
|
ensureRootForGui,
|
package/dist/index.cjs
CHANGED
|
@@ -62675,14 +62675,40 @@ async function normalizeEmptyDeletedAt(db) {
|
|
|
62675
62675
|
await db.migrate([
|
|
62676
62676
|
{
|
|
62677
62677
|
version: `${DELETED_AT_SENTINEL}:all`,
|
|
62678
|
+
// TYPE-AWARE: only a text-like deleted_at column can hold the legacy ''
|
|
62679
|
+
// sentinel. A column that is a real `timestamptz` (some clouds' deleted_at
|
|
62680
|
+
// is) MUST be skipped: the predicate `deleted_at = ''` forces Postgres to
|
|
62681
|
+
// parse `''::timestamptz` at PLAN time — invalid input that throws regardless
|
|
62682
|
+
// of data (a timestamptz column can't even hold ''), which aborted the entire
|
|
62683
|
+
// workspace open. We BLACKLIST the non-text types (timestamp/date/time,
|
|
62684
|
+
// numeric, boolean, json, uuid, bytea, xml) rather than allow-list text — so
|
|
62685
|
+
// text-like columns we don't enumerate (citext, a DOMAIN over text, a custom
|
|
62686
|
+
// text type) are still normalized instead of silently leaving '' rows that
|
|
62687
|
+
// 4.x's `deleted_at IS NULL` predicate would read as DELETED. PER-TABLE FAULT
|
|
62688
|
+
// ISOLATION is the backstop: each table's UPDATE runs in its own
|
|
62689
|
+
// subtransaction, so an exotic type that still errors on `= ''` (enum, inet,
|
|
62690
|
+
// interval, array) — or a blocking trigger/lock — is warned + skipped, never
|
|
62691
|
+
// fatal to the open.
|
|
62678
62692
|
sql: `DO $LATTICE_DAU$
|
|
62679
62693
|
DECLARE r record;
|
|
62680
62694
|
BEGIN
|
|
62681
62695
|
FOR r IN
|
|
62682
62696
|
SELECT table_name FROM information_schema.columns
|
|
62683
|
-
WHERE table_schema = current_schema()
|
|
62697
|
+
WHERE table_schema = current_schema()
|
|
62698
|
+
AND column_name = 'deleted_at'
|
|
62699
|
+
AND data_type NOT IN (
|
|
62700
|
+
'timestamp with time zone', 'timestamp without time zone',
|
|
62701
|
+
'date', 'time with time zone', 'time without time zone',
|
|
62702
|
+
'integer', 'bigint', 'smallint', 'numeric', 'decimal',
|
|
62703
|
+
'real', 'double precision', 'boolean', 'json', 'jsonb',
|
|
62704
|
+
'bytea', 'uuid', 'xml'
|
|
62705
|
+
)
|
|
62684
62706
|
LOOP
|
|
62685
|
-
|
|
62707
|
+
BEGIN
|
|
62708
|
+
EXECUTE format('UPDATE %I SET deleted_at = NULL WHERE deleted_at = ''''', r.table_name);
|
|
62709
|
+
EXCEPTION WHEN others THEN
|
|
62710
|
+
RAISE WARNING 'lattice: skipped deleted_at normalization for %: %', r.table_name, SQLERRM;
|
|
62711
|
+
END;
|
|
62686
62712
|
END LOOP;
|
|
62687
62713
|
END $LATTICE_DAU$;`
|
|
62688
62714
|
}
|
package/dist/index.js
CHANGED
|
@@ -62375,14 +62375,40 @@ async function normalizeEmptyDeletedAt(db) {
|
|
|
62375
62375
|
await db.migrate([
|
|
62376
62376
|
{
|
|
62377
62377
|
version: `${DELETED_AT_SENTINEL}:all`,
|
|
62378
|
+
// TYPE-AWARE: only a text-like deleted_at column can hold the legacy ''
|
|
62379
|
+
// sentinel. A column that is a real `timestamptz` (some clouds' deleted_at
|
|
62380
|
+
// is) MUST be skipped: the predicate `deleted_at = ''` forces Postgres to
|
|
62381
|
+
// parse `''::timestamptz` at PLAN time — invalid input that throws regardless
|
|
62382
|
+
// of data (a timestamptz column can't even hold ''), which aborted the entire
|
|
62383
|
+
// workspace open. We BLACKLIST the non-text types (timestamp/date/time,
|
|
62384
|
+
// numeric, boolean, json, uuid, bytea, xml) rather than allow-list text — so
|
|
62385
|
+
// text-like columns we don't enumerate (citext, a DOMAIN over text, a custom
|
|
62386
|
+
// text type) are still normalized instead of silently leaving '' rows that
|
|
62387
|
+
// 4.x's `deleted_at IS NULL` predicate would read as DELETED. PER-TABLE FAULT
|
|
62388
|
+
// ISOLATION is the backstop: each table's UPDATE runs in its own
|
|
62389
|
+
// subtransaction, so an exotic type that still errors on `= ''` (enum, inet,
|
|
62390
|
+
// interval, array) — or a blocking trigger/lock — is warned + skipped, never
|
|
62391
|
+
// fatal to the open.
|
|
62378
62392
|
sql: `DO $LATTICE_DAU$
|
|
62379
62393
|
DECLARE r record;
|
|
62380
62394
|
BEGIN
|
|
62381
62395
|
FOR r IN
|
|
62382
62396
|
SELECT table_name FROM information_schema.columns
|
|
62383
|
-
WHERE table_schema = current_schema()
|
|
62397
|
+
WHERE table_schema = current_schema()
|
|
62398
|
+
AND column_name = 'deleted_at'
|
|
62399
|
+
AND data_type NOT IN (
|
|
62400
|
+
'timestamp with time zone', 'timestamp without time zone',
|
|
62401
|
+
'date', 'time with time zone', 'time without time zone',
|
|
62402
|
+
'integer', 'bigint', 'smallint', 'numeric', 'decimal',
|
|
62403
|
+
'real', 'double precision', 'boolean', 'json', 'jsonb',
|
|
62404
|
+
'bytea', 'uuid', 'xml'
|
|
62405
|
+
)
|
|
62384
62406
|
LOOP
|
|
62385
|
-
|
|
62407
|
+
BEGIN
|
|
62408
|
+
EXECUTE format('UPDATE %I SET deleted_at = NULL WHERE deleted_at = ''''', r.table_name);
|
|
62409
|
+
EXCEPTION WHEN others THEN
|
|
62410
|
+
RAISE WARNING 'lattice: skipped deleted_at normalization for %: %', r.table_name, SQLERRM;
|
|
62411
|
+
END;
|
|
62386
62412
|
END LOOP;
|
|
62387
62413
|
END $LATTICE_DAU$;`
|
|
62388
62414
|
}
|
package/package.json
CHANGED