@minnowdb/core 0.2.1 → 0.4.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 +23 -32
- package/dist/block-format/block.d.ts +32 -13
- package/dist/block-format/block.js +179 -55
- package/dist/block-format/checksum.d.ts +2 -1
- package/dist/block-format/checksum.js +5 -2
- package/dist/block-format/codecs.d.ts +7 -2
- package/dist/block-format/codecs.js +53 -12
- package/dist/block-format/column.d.ts +3 -2
- package/dist/block-format/column.js +96 -30
- package/dist/block-format/index.d.ts +2 -2
- package/dist/block-format/index.js +2 -2
- package/dist/block-format/physical.d.ts +8 -2
- package/dist/block-format/physical.js +14 -6
- package/dist/block-format/types.d.ts +7 -3
- package/dist/block-format/types.js +0 -1
- package/dist/block-format/unicode.d.ts +11 -0
- package/dist/block-format/unicode.js +46 -0
- package/dist/date-value.d.ts +15 -0
- package/dist/date-value.js +64 -0
- package/dist/engine/artifact-cache.d.ts +2 -1
- package/dist/engine/artifact-cache.js +5 -1
- package/dist/engine/batch.d.ts +11 -3
- package/dist/engine/batch.js +17 -7
- package/dist/engine/buffered-writer.d.ts +2 -1
- package/dist/engine/buffered-writer.js +34 -9
- package/dist/engine/cache-limits.d.ts +25 -0
- package/dist/engine/cache-limits.js +25 -0
- package/dist/engine/catalog.d.ts +24 -5
- package/dist/engine/catalog.js +34 -7
- package/dist/engine/client.d.ts +29 -7
- package/dist/engine/client.js +216 -40
- package/dist/engine/database.d.ts +224 -39
- package/dist/engine/database.js +7475 -1539
- package/dist/engine/defaults.d.ts +4 -8
- package/dist/engine/defaults.js +46 -22
- package/dist/engine/errors.d.ts +19 -1
- package/dist/engine/errors.js +32 -2
- package/dist/engine/fts.d.ts +0 -6
- package/dist/engine/fts.js +41 -14
- package/dist/engine/group-index.d.ts +0 -1
- package/dist/engine/group-index.js +6 -11
- package/dist/engine/index.d.ts +16 -10
- package/dist/engine/index.js +12 -9
- package/dist/engine/join-index.d.ts +0 -1
- package/dist/engine/join-index.js +2 -2
- package/dist/engine/keyed-live.d.ts +57 -0
- package/dist/engine/keyed-live.js +226 -0
- package/dist/engine/live-api.d.ts +4 -0
- package/dist/engine/live-api.js +4 -0
- package/dist/engine/live.d.ts +43 -26
- package/dist/engine/live.js +504 -126
- package/dist/engine/memory.d.ts +2 -1
- package/dist/engine/memory.js +3 -2
- package/dist/engine/optimizer.d.ts +0 -1
- package/dist/engine/optimizer.js +262 -27
- package/dist/engine/query-api.d.ts +3 -0
- package/dist/engine/query-api.js +3 -0
- package/dist/engine/query-cache.d.ts +1 -2
- package/dist/engine/query-cache.js +7 -5
- package/dist/engine/query.d.ts +134 -29
- package/dist/engine/query.js +1668 -372
- package/dist/engine/result-wire.d.ts +0 -1
- package/dist/engine/result-wire.js +2 -2
- package/dist/engine/schema-wire.d.ts +6 -3
- package/dist/engine/schema-wire.js +40 -34
- package/dist/engine/schema.d.ts +156 -80
- package/dist/engine/schema.js +570 -108
- package/dist/engine/sort-keys.d.ts +4 -4
- package/dist/engine/sort-keys.js +44 -29
- package/dist/engine/sql-domains.d.ts +31 -0
- package/dist/engine/sql-domains.js +585 -0
- package/dist/engine/sql-driver.d.ts +19 -0
- package/dist/engine/sql-driver.js +1 -0
- package/dist/engine/sql-json.d.ts +7 -9
- package/dist/engine/sql-json.js +75 -15
- package/dist/engine/sql-semantics.d.ts +8 -3
- package/dist/engine/sql-semantics.js +458 -30
- package/dist/engine/typed-live.d.ts +67 -0
- package/dist/engine/typed-live.js +349 -0
- package/dist/engine/vector.d.ts +12 -2
- package/dist/engine/vector.js +635 -119
- package/dist/engine/worker-host.d.ts +9 -2
- package/dist/engine/worker-host.js +620 -152
- package/dist/engine/worker.d.ts +0 -1
- package/dist/engine/worker.js +3 -3
- package/dist/engine/write-block-planner.d.ts +18 -0
- package/dist/engine/write-block-planner.js +112 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/plan/index.d.ts +3 -4
- package/dist/plan/index.js +3 -4
- package/dist/storage/index.d.ts +1 -1
- package/dist/storage/index.js +1 -1
- package/dist/storage/indexeddb.d.ts +99 -51
- package/dist/storage/indexeddb.js +13448 -2660
- package/dist/storage/memory.d.ts +64 -57
- package/dist/storage/memory.js +1042 -128
- package/dist/storage/opfs/files.d.ts +18 -7
- package/dist/storage/opfs/files.js +115 -28
- package/dist/storage/opfs/index.d.ts +1 -1
- package/dist/storage/opfs/index.js +1 -1
- package/dist/storage/opfs/leader.d.ts +409 -75
- package/dist/storage/opfs/leader.js +4621 -650
- package/dist/storage/opfs/rpc.d.ts +15 -3
- package/dist/storage/opfs/rpc.js +224 -2
- package/dist/storage/opfs/snapshot-ledger.d.ts +40 -0
- package/dist/storage/opfs/snapshot-ledger.js +281 -0
- package/dist/storage/opfs/store.d.ts +33 -99
- package/dist/storage/opfs/store.js +453 -364
- package/dist/storage/persistence.d.ts +37 -0
- package/dist/storage/persistence.js +78 -0
- package/dist/storage/snapshot-stream.d.ts +24 -0
- package/dist/storage/snapshot-stream.js +897 -0
- package/dist/storage/snapshot.d.ts +9 -85
- package/dist/storage/snapshot.js +33 -265
- package/dist/storage/toolkit/extents.d.ts +41 -7
- package/dist/storage/toolkit/extents.js +402 -39
- package/dist/storage/toolkit/index.d.ts +4 -5
- package/dist/storage/toolkit/index.js +28 -4
- package/dist/storage/toolkit/record-core.d.ts +182 -55
- package/dist/storage/toolkit/record-core.js +6158 -1331
- package/dist/storage/toolkit/sync-file.d.ts +10 -1
- package/dist/storage/toolkit/sync-file.js +50 -2
- package/dist/storage/toolkit/wal.d.ts +23 -5
- package/dist/storage/toolkit/wal.js +89 -27
- package/dist/storage/toolkit/wire.d.ts +15 -2
- package/dist/storage/toolkit/wire.js +199 -10
- package/dist/storage/types.d.ts +1439 -204
- package/dist/storage/types.js +1745 -141
- package/dist/testing/block-store-conformance.d.ts +0 -1
- package/dist/testing/block-store-conformance.js +1009 -119
- package/dist/testing/index.d.ts +46 -26
- package/dist/testing/index.js +112 -57
- package/dist/testing/opfs-shim.d.ts +13 -3
- package/dist/testing/opfs-shim.js +40 -6
- package/dist/testing/simulator.d.ts +97 -0
- package/dist/testing/simulator.js +591 -0
- package/dist/testing/sqllogictest.d.ts +89 -0
- package/dist/testing/sqllogictest.js +434 -0
- package/dist/transactions/index.d.ts +92 -16
- package/dist/transactions/index.js +1074 -236
- package/dist/worker-protocol/index.d.ts +3 -2
- package/dist/worker-protocol/index.js +2 -5
- package/package.json +53 -3
- package/postgres-feature-profile.json +223 -0
- package/sql-feature-matrix.json +172 -252
- package/dist/block-format/block.d.ts.map +0 -1
- package/dist/block-format/block.js.map +0 -1
- package/dist/block-format/checksum.d.ts.map +0 -1
- package/dist/block-format/checksum.js.map +0 -1
- package/dist/block-format/codecs.d.ts.map +0 -1
- package/dist/block-format/codecs.js.map +0 -1
- package/dist/block-format/column.d.ts.map +0 -1
- package/dist/block-format/column.js.map +0 -1
- package/dist/block-format/index.d.ts.map +0 -1
- package/dist/block-format/index.js.map +0 -1
- package/dist/block-format/physical.d.ts.map +0 -1
- package/dist/block-format/physical.js.map +0 -1
- package/dist/block-format/types.d.ts.map +0 -1
- package/dist/block-format/types.js.map +0 -1
- package/dist/engine/artifact-cache.d.ts.map +0 -1
- package/dist/engine/artifact-cache.js.map +0 -1
- package/dist/engine/batch.d.ts.map +0 -1
- package/dist/engine/batch.js.map +0 -1
- package/dist/engine/buffered-writer.d.ts.map +0 -1
- package/dist/engine/buffered-writer.js.map +0 -1
- package/dist/engine/catalog.d.ts.map +0 -1
- package/dist/engine/catalog.js.map +0 -1
- package/dist/engine/client.d.ts.map +0 -1
- package/dist/engine/client.js.map +0 -1
- package/dist/engine/coordinator.d.ts +0 -17
- package/dist/engine/coordinator.d.ts.map +0 -1
- package/dist/engine/coordinator.js +0 -60
- package/dist/engine/coordinator.js.map +0 -1
- package/dist/engine/database.d.ts.map +0 -1
- package/dist/engine/database.js.map +0 -1
- package/dist/engine/defaults.d.ts.map +0 -1
- package/dist/engine/defaults.js.map +0 -1
- package/dist/engine/errors.d.ts.map +0 -1
- package/dist/engine/errors.js.map +0 -1
- package/dist/engine/fts.d.ts.map +0 -1
- package/dist/engine/fts.js.map +0 -1
- package/dist/engine/group-index.d.ts.map +0 -1
- package/dist/engine/group-index.js.map +0 -1
- package/dist/engine/index.d.ts.map +0 -1
- package/dist/engine/index.js.map +0 -1
- package/dist/engine/join-index.d.ts.map +0 -1
- package/dist/engine/join-index.js.map +0 -1
- package/dist/engine/live.d.ts.map +0 -1
- package/dist/engine/live.js.map +0 -1
- package/dist/engine/memory.d.ts.map +0 -1
- package/dist/engine/memory.js.map +0 -1
- package/dist/engine/optimizer.d.ts.map +0 -1
- package/dist/engine/optimizer.js.map +0 -1
- package/dist/engine/query-cache.d.ts.map +0 -1
- package/dist/engine/query-cache.js.map +0 -1
- package/dist/engine/query.d.ts.map +0 -1
- package/dist/engine/query.js.map +0 -1
- package/dist/engine/result-wire.d.ts.map +0 -1
- package/dist/engine/result-wire.js.map +0 -1
- package/dist/engine/schema-wire.d.ts.map +0 -1
- package/dist/engine/schema-wire.js.map +0 -1
- package/dist/engine/schema.d.ts.map +0 -1
- package/dist/engine/schema.js.map +0 -1
- package/dist/engine/sort-keys.d.ts.map +0 -1
- package/dist/engine/sort-keys.js.map +0 -1
- package/dist/engine/sql-json.d.ts.map +0 -1
- package/dist/engine/sql-json.js.map +0 -1
- package/dist/engine/sql-semantics.d.ts.map +0 -1
- package/dist/engine/sql-semantics.js.map +0 -1
- package/dist/engine/vector.d.ts.map +0 -1
- package/dist/engine/vector.js.map +0 -1
- package/dist/engine/worker-host.d.ts.map +0 -1
- package/dist/engine/worker-host.js.map +0 -1
- package/dist/engine/worker.d.ts.map +0 -1
- package/dist/engine/worker.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/plan/index.d.ts.map +0 -1
- package/dist/plan/index.js.map +0 -1
- package/dist/storage/fixture-shape.d.ts +0 -42
- package/dist/storage/fixture-shape.d.ts.map +0 -1
- package/dist/storage/fixture-shape.js +0 -146
- package/dist/storage/fixture-shape.js.map +0 -1
- package/dist/storage/index.d.ts.map +0 -1
- package/dist/storage/index.js.map +0 -1
- package/dist/storage/indexeddb.d.ts.map +0 -1
- package/dist/storage/indexeddb.js.map +0 -1
- package/dist/storage/memory.d.ts.map +0 -1
- package/dist/storage/memory.js.map +0 -1
- package/dist/storage/opfs/files.d.ts.map +0 -1
- package/dist/storage/opfs/files.js.map +0 -1
- package/dist/storage/opfs/index.d.ts.map +0 -1
- package/dist/storage/opfs/index.js.map +0 -1
- package/dist/storage/opfs/leader.d.ts.map +0 -1
- package/dist/storage/opfs/leader.js.map +0 -1
- package/dist/storage/opfs/rpc.d.ts.map +0 -1
- package/dist/storage/opfs/rpc.js.map +0 -1
- package/dist/storage/opfs/store.d.ts.map +0 -1
- package/dist/storage/opfs/store.js.map +0 -1
- package/dist/storage/snapshot.d.ts.map +0 -1
- package/dist/storage/snapshot.js.map +0 -1
- package/dist/storage/toolkit/extents.d.ts.map +0 -1
- package/dist/storage/toolkit/extents.js.map +0 -1
- package/dist/storage/toolkit/index.d.ts.map +0 -1
- package/dist/storage/toolkit/index.js.map +0 -1
- package/dist/storage/toolkit/record-core.d.ts.map +0 -1
- package/dist/storage/toolkit/record-core.js.map +0 -1
- package/dist/storage/toolkit/sync-file.d.ts.map +0 -1
- package/dist/storage/toolkit/sync-file.js.map +0 -1
- package/dist/storage/toolkit/wal.d.ts.map +0 -1
- package/dist/storage/toolkit/wal.js.map +0 -1
- package/dist/storage/toolkit/wire.d.ts.map +0 -1
- package/dist/storage/toolkit/wire.js.map +0 -1
- package/dist/storage/types.d.ts.map +0 -1
- package/dist/storage/types.js.map +0 -1
- package/dist/testing/block-store-conformance.d.ts.map +0 -1
- package/dist/testing/block-store-conformance.js.map +0 -1
- package/dist/testing/index.d.ts.map +0 -1
- package/dist/testing/index.js.map +0 -1
- package/dist/testing/opfs-shim.d.ts.map +0 -1
- package/dist/testing/opfs-shim.js.map +0 -1
- package/dist/testing/seeds.d.ts +0 -11
- package/dist/testing/seeds.d.ts.map +0 -1
- package/dist/testing/seeds.js +0 -50
- package/dist/testing/seeds.js.map +0 -1
- package/dist/transactions/index.d.ts.map +0 -1
- package/dist/transactions/index.js.map +0 -1
- package/dist/worker-protocol/index.d.ts.map +0 -1
- package/dist/worker-protocol/index.js.map +0 -1
|
@@ -21,9 +21,10 @@
|
|
|
21
21
|
*/
|
|
22
22
|
export interface SortKeyColumn {
|
|
23
23
|
/**
|
|
24
|
-
* Ascending comparison with NULL smallest
|
|
25
|
-
*
|
|
26
|
-
*
|
|
24
|
+
* Ascending comparison with NULL smallest. This is the column's raw comparison, not SQL's
|
|
25
|
+
* default placement: the sorter applies PostgreSQL's NULLS LAST for ASC and NULLS FIRST for
|
|
26
|
+
* DESC. Direction and an explicit NULLS FIRST/LAST stay with the caller because a placement is
|
|
27
|
+
* absolute, while direction negates only the non-null value comparison.
|
|
27
28
|
*
|
|
28
29
|
* Specialized when the column is built, so a comparison that runs millions of times is a
|
|
29
30
|
* closure over one representation rather than a branch on which representation it holds.
|
|
@@ -71,4 +72,3 @@ export declare function buildSortKeyColumn(count: number, valueAt: (index: numbe
|
|
|
71
72
|
* is already in order before doing anything else, since a scan often arrives sorted.
|
|
72
73
|
*/
|
|
73
74
|
export declare function sortKeyIndexes(count: number, terms: readonly SortKeyTerm[]): Uint32Array;
|
|
74
|
-
//# sourceMappingURL=sort-keys.d.ts.map
|
package/dist/engine/sort-keys.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { dateMilliseconds } from "../date-value.js";
|
|
1
2
|
import { compareSqlStrings, compareSqlValues } from "./sql-semantics.js";
|
|
2
3
|
/** Unwraps a datetime to the number the comparisons use; every other value passes through. */
|
|
3
4
|
export function comparableSortValue(value) {
|
|
4
|
-
return value instanceof Date ? value
|
|
5
|
+
return value instanceof Date ? dateMilliseconds(value) : value;
|
|
5
6
|
}
|
|
6
7
|
/**
|
|
7
8
|
* Extracts one term's values into a comparison-ready column. `valueAt` is called once per row,
|
|
@@ -33,7 +34,14 @@ export function buildSortKeyColumn(count, valueAt) {
|
|
|
33
34
|
kind = "boolean";
|
|
34
35
|
numbers[index] = value ? 1 : 0;
|
|
35
36
|
}
|
|
36
|
-
else if (typeof value === "string" &&
|
|
37
|
+
else if (typeof value === "string" &&
|
|
38
|
+
// NUL-prefixed strings are the engine's lossless internal SQL-domain values
|
|
39
|
+
// (NUMERIC, ENUM, COLLATE, and friends). Their physical encoding is deliberately
|
|
40
|
+
// stable, not lexicographically ordered, so ranking the encoded strings would make
|
|
41
|
+
// ORDER BY disagree with the SQL comparator. Keep those terms on the generic path.
|
|
42
|
+
value.charCodeAt(0) !== 0 &&
|
|
43
|
+
kind !== "number" &&
|
|
44
|
+
kind !== "boolean") {
|
|
37
45
|
kind = "string";
|
|
38
46
|
ranks ??= new Map();
|
|
39
47
|
let rank = ranks.get(value);
|
|
@@ -312,9 +320,8 @@ class KeySorter {
|
|
|
312
320
|
* for a term without unboxed keys. A float's bits already order like the float once the sign
|
|
313
321
|
* is folded (flip every bit of a negative, the sign bit of a positive); NaN is pinned just
|
|
314
322
|
* past +Infinity and signed zero collapses to +0, which is where compareSqlValues puts them.
|
|
315
|
-
* DESC inverts the non-null keys, and NULL takes the end its placement names
|
|
316
|
-
*
|
|
317
|
-
* NULLS FIRST/LAST asks for regardless of direction.
|
|
323
|
+
* DESC inverts the non-null keys, and NULL takes the end its placement names. When omitted,
|
|
324
|
+
* PostgreSQL's default supplies NULLS LAST for ASC and NULLS FIRST for DESC.
|
|
318
325
|
*/
|
|
319
326
|
#encodedKeys(term) {
|
|
320
327
|
const cached = this.#encoded[term];
|
|
@@ -329,34 +336,45 @@ class KeySorter {
|
|
|
329
336
|
const buffer = new ArrayBuffer(count * 8);
|
|
330
337
|
const floats = new Float64Array(buffer);
|
|
331
338
|
const words = new Uint32Array(buffer);
|
|
332
|
-
const
|
|
333
|
-
? 0
|
|
334
|
-
: UINT32_MAX;
|
|
339
|
+
const nullsFirst = (spec.nulls ?? (spec.descending ? "first" : "last")) === "first";
|
|
335
340
|
const flip = spec.descending ? UINT32_MAX : 0;
|
|
341
|
+
// Keep the sentinel's low word aligned with the direction's transformed values. A sentinel
|
|
342
|
+
// that differs in an otherwise constant low digit makes radix sorting run a whole extra pass.
|
|
343
|
+
// The non-null domains are bounded away from these keys: ascending runs from encoded
|
|
344
|
+
// -Infinity through pinned NaN (fff80000:00000000), and descending is its bitwise inverse.
|
|
345
|
+
const nullHi = spec.descending
|
|
346
|
+
? nullsFirst
|
|
347
|
+
? 0x0007fffe
|
|
348
|
+
: UINT32_MAX
|
|
349
|
+
: nullsFirst
|
|
350
|
+
? 0
|
|
351
|
+
: 0xfff80001;
|
|
352
|
+
const nullLo = spec.descending ? UINT32_MAX : 0;
|
|
336
353
|
for (let index = 0; index < count; index += 1) {
|
|
337
354
|
const lo = index * 2 + LO;
|
|
338
355
|
const hi = index * 2 + HI;
|
|
339
356
|
if (nulls[index] === 1) {
|
|
340
|
-
words[lo] =
|
|
341
|
-
words[hi] =
|
|
357
|
+
words[lo] = nullLo;
|
|
358
|
+
words[hi] = nullHi;
|
|
342
359
|
continue;
|
|
343
360
|
}
|
|
344
361
|
const value = numbers[index] ?? 0;
|
|
345
362
|
if (value !== value) {
|
|
346
363
|
words[lo] = flip;
|
|
347
364
|
words[hi] = (0xfff80000 ^ flip) >>> 0;
|
|
348
|
-
continue;
|
|
349
|
-
}
|
|
350
|
-
// Adding +0 turns -0 into +0 and leaves every other value alone.
|
|
351
|
-
floats[index] = value + 0;
|
|
352
|
-
const rawHi = words[hi] ?? 0;
|
|
353
|
-
if ((rawHi & 0x80000000) !== 0) {
|
|
354
|
-
words[lo] = (~(words[lo] ?? 0) ^ flip) >>> 0;
|
|
355
|
-
words[hi] = (~rawHi ^ flip) >>> 0;
|
|
356
365
|
}
|
|
357
366
|
else {
|
|
358
|
-
|
|
359
|
-
|
|
367
|
+
// Adding +0 turns -0 into +0 and leaves every other value alone.
|
|
368
|
+
floats[index] = value + 0;
|
|
369
|
+
const rawHi = words[hi] ?? 0;
|
|
370
|
+
if ((rawHi & 0x80000000) !== 0) {
|
|
371
|
+
words[lo] = (~(words[lo] ?? 0) ^ flip) >>> 0;
|
|
372
|
+
words[hi] = (~rawHi ^ flip) >>> 0;
|
|
373
|
+
}
|
|
374
|
+
else {
|
|
375
|
+
words[lo] = ((words[lo] ?? 0) ^ flip) >>> 0;
|
|
376
|
+
words[hi] = ((rawHi | 0x80000000) ^ flip) >>> 0;
|
|
377
|
+
}
|
|
360
378
|
}
|
|
361
379
|
}
|
|
362
380
|
this.#encoded[term] = words;
|
|
@@ -385,15 +403,13 @@ class KeySorter {
|
|
|
385
403
|
}
|
|
386
404
|
else {
|
|
387
405
|
const { column, descending } = spec;
|
|
388
|
-
const
|
|
406
|
+
const nulls = spec.nulls ?? (spec.descending ? "first" : "last");
|
|
389
407
|
compare = (left, right) => {
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
return leftNull && rightNull ? 0 : (leftNull ? -1 : 1) * nullPlacement;
|
|
396
|
-
}
|
|
408
|
+
// NULL placement is absolute: direction must not negate it.
|
|
409
|
+
const leftNull = column.isNull(left);
|
|
410
|
+
const rightNull = column.isNull(right);
|
|
411
|
+
if (leftNull || rightNull) {
|
|
412
|
+
return leftNull && rightNull ? 0 : (leftNull ? -1 : 1) * (nulls === "first" ? 1 : -1);
|
|
397
413
|
}
|
|
398
414
|
const comparison = column.compare(left, right);
|
|
399
415
|
return descending ? -comparison : comparison;
|
|
@@ -403,4 +419,3 @@ class KeySorter {
|
|
|
403
419
|
return compare;
|
|
404
420
|
}
|
|
405
421
|
}
|
|
406
|
-
//# sourceMappingURL=sort-keys.js.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { SqlDomain } from "../storage/types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Protects an ordinary SQL string that happens to use the internal domain namespace. Physical
|
|
4
|
+
* TEXT remains unchanged on disk; this wrapper is applied at execution boundaries so a user
|
|
5
|
+
* value can never be mistaken for NUMERIC, INTERVAL, enum, or another tagged logical value.
|
|
6
|
+
*/
|
|
7
|
+
export declare function protectedSqlTextValue(value: string): string;
|
|
8
|
+
/** Removes only the ordinary-TEXT wrapper, leaving real domain values tagged. */
|
|
9
|
+
export declare function externalSqlTextValue(value: unknown): unknown;
|
|
10
|
+
export declare function isExactNumeric(value: unknown): value is string;
|
|
11
|
+
export declare function exactNumericValue(value: unknown, precision?: number, scale?: number): string | null;
|
|
12
|
+
export declare function exactNumericBinary(operator: "+" | "-" | "*" | "/" | "%", left: unknown, right: unknown): string | null | undefined;
|
|
13
|
+
export declare function exactNumericCompare(left: unknown, right: unknown): number | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Serializes a JSON value while bounding traversal, nesting, and output before concatenation.
|
|
16
|
+
* Canonical mode sorts object names directly in the wire text (including integer-looking names,
|
|
17
|
+
* which JavaScript object enumeration would otherwise silently reorder).
|
|
18
|
+
*/
|
|
19
|
+
export declare function boundedJsonText(value: unknown, canonical: boolean, label?: string): string;
|
|
20
|
+
export declare function jsonDomainValue(value: unknown, binary: boolean): string | null;
|
|
21
|
+
export declare function uuidDomainValue(value: unknown): string | null;
|
|
22
|
+
export declare function timeDomainValue(value: unknown): string | null;
|
|
23
|
+
export declare function intervalDomainValue(value: unknown): string | null;
|
|
24
|
+
export declare function arrayDomainValue(values: readonly unknown[]): string;
|
|
25
|
+
export declare function enumDomainValue(value: unknown, name: string, values: readonly string[]): string | null;
|
|
26
|
+
export declare function enumDomainCompare(left: unknown, right: unknown): number | undefined;
|
|
27
|
+
export declare function normalizeSqlDomainValue(domain: SqlDomain, value: unknown): string | null;
|
|
28
|
+
export declare function collatedDomainValue(value: unknown, collation: unknown): string | null;
|
|
29
|
+
export declare function collatedDomainCompare(left: unknown, right: unknown): number | undefined;
|
|
30
|
+
export declare function externalSqlDomainValue(value: unknown): unknown;
|
|
31
|
+
export declare function isSqlDomainValue(value: unknown): value is string;
|