@quereus/store 4.4.0 → 4.4.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 +5 -0
- package/dist/src/common/cached-kv-store.js +4 -0
- package/dist/src/common/cached-kv-store.js.map +1 -1
- package/dist/src/common/encoding.d.ts +32 -1
- package/dist/src/common/encoding.d.ts.map +1 -1
- package/dist/src/common/encoding.js +42 -10
- package/dist/src/common/encoding.js.map +1 -1
- package/dist/src/common/index.d.ts +3 -2
- package/dist/src/common/index.d.ts.map +1 -1
- package/dist/src/common/index.js +3 -1
- package/dist/src/common/index.js.map +1 -1
- package/dist/src/common/json-key.d.ts +96 -0
- package/dist/src/common/json-key.d.ts.map +1 -0
- package/dist/src/common/json-key.js +204 -0
- package/dist/src/common/json-key.js.map +1 -0
- package/dist/src/common/key-builder.d.ts +40 -5
- package/dist/src/common/key-builder.d.ts.map +1 -1
- package/dist/src/common/key-builder.js +59 -21
- package/dist/src/common/key-builder.js.map +1 -1
- package/dist/src/common/kv-store.d.ts +12 -2
- package/dist/src/common/kv-store.d.ts.map +1 -1
- package/dist/src/common/store-module.d.ts +64 -15
- package/dist/src/common/store-module.d.ts.map +1 -1
- package/dist/src/common/store-module.js +349 -125
- package/dist/src/common/store-module.js.map +1 -1
- package/dist/src/common/store-table.d.ts +125 -11
- package/dist/src/common/store-table.d.ts.map +1 -1
- package/dist/src/common/store-table.js +235 -34
- package/dist/src/common/store-table.js.map +1 -1
- package/dist/src/testing/kv-conformance.d.ts.map +1 -1
- package/dist/src/testing/kv-conformance.js +32 -0
- package/dist/src/testing/kv-conformance.js.map +1 -1
- package/package.json +5 -5
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* - Catalog store: {schema}.{table} as the key
|
|
15
15
|
*/
|
|
16
16
|
import type { SqlValue } from '@quereus/quereus';
|
|
17
|
-
import { type EncodeOptions } from './encoding.js';
|
|
17
|
+
import { type EncodeOptions, type KeyValueTransform } from './encoding.js';
|
|
18
18
|
/**
|
|
19
19
|
* Store name suffixes for different data types.
|
|
20
20
|
*/
|
|
@@ -29,11 +29,30 @@ export declare const STATS_STORE_NAME = "__stats__";
|
|
|
29
29
|
/**
|
|
30
30
|
* Build the store name for a table's data.
|
|
31
31
|
* Format: {schema}.{table}
|
|
32
|
+
*
|
|
33
|
+
* Guarded by {@link assertKeyableIdentifiers}: the physical name is handed to a provider
|
|
34
|
+
* that may encode it to bytes (`LevelDBProvider.encodeSublevelName` runs it through
|
|
35
|
+
* `TextEncoder`), which folds every unpaired surrogate to U+FFFD — so two tables whose
|
|
36
|
+
* names differ only in a lone surrogate would share one physical store. Every call site
|
|
37
|
+
* builds the name before its first side effect, so the throw always lands on a clean no-op.
|
|
38
|
+
*
|
|
39
|
+
* Refusing the identifier here is also what lets `StoreModule.assertStoreNameFree` stand in
|
|
40
|
+
* for a PHYSICAL store collision check: that guard compares names as JS strings, before any
|
|
41
|
+
* provider encoding, so distinct logical names imply distinct physical stores only where the
|
|
42
|
+
* provider's encoding is injective. With unpaired surrogates refused it is — for LevelDB
|
|
43
|
+
* (percent-escaped UTF-8) and IndexedDB (verbatim `DOMString`). It is NOT for
|
|
44
|
+
* `@quereus/plugin-nativescript-sqlite`, whose `getTableName` folds every character outside
|
|
45
|
+
* `[a-zA-Z0-9_]` to `_`; that is a lossy mapping this guard neither causes nor repairs. See
|
|
46
|
+
* `tickets/backlog/bug-mobile-provider-physical-store-name-collisions.md`.
|
|
32
47
|
*/
|
|
33
48
|
export declare function buildDataStoreName(schemaName: string, tableName: string): string;
|
|
34
49
|
/**
|
|
35
50
|
* Build the store name for a secondary index.
|
|
36
51
|
* Format: {schema}.{table}_idx_{indexName}
|
|
52
|
+
*
|
|
53
|
+
* Identifier-guarded for the same reason as {@link buildDataStoreName} — see its docstring
|
|
54
|
+
* for why refusing an unpaired surrogate is what keeps distinct logical names on distinct
|
|
55
|
+
* physical stores, and for the one provider whose encoding that still does not hold for.
|
|
37
56
|
*/
|
|
38
57
|
export declare function buildIndexStoreName(schemaName: string, tableName: string, indexName: string): string;
|
|
39
58
|
/**
|
|
@@ -56,8 +75,12 @@ export declare function buildStatsKey(schemaName: string, tableName: string): Ui
|
|
|
56
75
|
* `collations[i]`, when defined, encodes PK column i under its own key collation
|
|
57
76
|
* (overriding `options.collation`), so each text PK column honors its declared
|
|
58
77
|
* collation in the physical key bytes. Non-text members ignore it.
|
|
78
|
+
*
|
|
79
|
+
* `transforms[i]`, when defined, canonicalizes PK column i's value before encoding
|
|
80
|
+
* (see {@link KeyValueTransform}), so semantically-equal spellings of a
|
|
81
|
+
* semantic-ordering member ('PT1H' / 'PT60M') land on one key.
|
|
59
82
|
*/
|
|
60
|
-
export declare function buildDataKey(pkValues: SqlValue[], options?: EncodeOptions, directions?: ReadonlyArray<boolean>, collations?: ReadonlyArray<string | undefined>): Uint8Array;
|
|
83
|
+
export declare function buildDataKey(pkValues: SqlValue[], options?: EncodeOptions, directions?: ReadonlyArray<boolean>, collations?: ReadonlyArray<string | undefined>, transforms?: ReadonlyArray<KeyValueTransform | undefined>): Uint8Array;
|
|
61
84
|
/**
|
|
62
85
|
* Build a secondary index key.
|
|
63
86
|
* Format: {encoded_index_cols}{encoded_pk}
|
|
@@ -71,8 +94,12 @@ export declare function buildDataKey(pkValues: SqlValue[], options?: EncodeOptio
|
|
|
71
94
|
* with the same per-column collations as the data key (see `buildDataKey`), so
|
|
72
95
|
* index maintenance (delete-then-insert on UPDATE/DELETE) addresses the same
|
|
73
96
|
* bytes the data store keys by. Index columns keep `options.collation`.
|
|
97
|
+
*
|
|
98
|
+
* `indexTransforms` / `pkTransforms` canonicalize each half's values before
|
|
99
|
+
* encoding (see {@link KeyValueTransform}); the PK-suffix transforms MUST match
|
|
100
|
+
* the data key's for the same reason as the collations above.
|
|
74
101
|
*/
|
|
75
|
-
export declare function buildIndexKey(indexValues: SqlValue[], pkValues: SqlValue[], options?: EncodeOptions, indexDirections?: ReadonlyArray<boolean>, pkDirections?: ReadonlyArray<boolean>, pkCollations?: ReadonlyArray<string | undefined>): Uint8Array;
|
|
102
|
+
export declare function buildIndexKey(indexValues: SqlValue[], pkValues: SqlValue[], options?: EncodeOptions, indexDirections?: ReadonlyArray<boolean>, pkDirections?: ReadonlyArray<boolean>, pkCollations?: ReadonlyArray<string | undefined>, indexTransforms?: ReadonlyArray<KeyValueTransform | undefined>, pkTransforms?: ReadonlyArray<KeyValueTransform | undefined>): Uint8Array;
|
|
76
103
|
/**
|
|
77
104
|
* Build a catalog key for DDL storage.
|
|
78
105
|
* Format: {schema}.{table}
|
|
@@ -183,8 +210,16 @@ export declare function buildFullScanBounds(): {
|
|
|
183
210
|
* would wrongly exclude entries whose leading column is a DESC NULL (encoded
|
|
184
211
|
* with a 0xff type byte) — the same trap {@link buildFullScanBounds} documents
|
|
185
212
|
* for data stores.
|
|
213
|
+
*
|
|
214
|
+
* NOTE: both `StoreTable` callers (`analyzeIndexAccess`, `buildIndexRangeBounds`)
|
|
215
|
+
* pass NO `transforms` — sound only because both decline a semantic-ordering
|
|
216
|
+
* column before they get here (the EQ-prefix loop breaks on `hasSemanticOrdering`;
|
|
217
|
+
* the range arm is gated on `keyOrderMatchesCollation`). If backlog
|
|
218
|
+
* `feat-reopen-timespan-store-seeks` re-opens either arm, thread the column's
|
|
219
|
+
* transforms through first or the bounds will address raw-value bytes while the
|
|
220
|
+
* index holds transformed ones.
|
|
186
221
|
*/
|
|
187
|
-
export declare function buildIndexPrefixBounds(prefixValues: SqlValue[], options?: EncodeOptions, directions?: ReadonlyArray<boolean>): {
|
|
222
|
+
export declare function buildIndexPrefixBounds(prefixValues: SqlValue[], options?: EncodeOptions, directions?: ReadonlyArray<boolean>, transforms?: ReadonlyArray<KeyValueTransform | undefined>): {
|
|
188
223
|
gte: Uint8Array;
|
|
189
224
|
lt?: Uint8Array;
|
|
190
225
|
};
|
|
@@ -210,7 +245,7 @@ export declare function buildIndexPrefixBounds(prefixValues: SqlValue[], options
|
|
|
210
245
|
* those are all 0xff (so no finite increment exists), `lt` is omitted and the
|
|
211
246
|
* scan runs to the end of the store.
|
|
212
247
|
*/
|
|
213
|
-
export declare function buildPkPrefixBounds(prefixValues: SqlValue[], options?: EncodeOptions, directions?: ReadonlyArray<boolean>, collations?: ReadonlyArray<string | undefined>): {
|
|
248
|
+
export declare function buildPkPrefixBounds(prefixValues: SqlValue[], options?: EncodeOptions, directions?: ReadonlyArray<boolean>, collations?: ReadonlyArray<string | undefined>, transforms?: ReadonlyArray<KeyValueTransform | undefined>): {
|
|
214
249
|
gte: Uint8Array;
|
|
215
250
|
lt?: Uint8Array;
|
|
216
251
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"key-builder.d.ts","sourceRoot":"","sources":["../../../src/common/key-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAiD,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"key-builder.d.ts","sourceRoot":"","sources":["../../../src/common/key-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAiD,KAAK,aAAa,EAAE,KAAK,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAK1H;;GAEG;AACH,eAAO,MAAM,YAAY;;;CAGf,CAAC;AAEX,mCAAmC;AACnC,eAAO,MAAM,kBAAkB,gBAAgB,CAAC;AAEhD,iCAAiC;AACjC,eAAO,MAAM,gBAAgB,cAAc,CAAC;AAgB5C;;;;;;;;;;;;;;;;;;GAkBG;AASH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAGhF;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAClC,UAAU,EAAE,MAAM,EAClB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UAAU,CAAA;CAAE,CAErC"}
|
|
@@ -27,9 +27,37 @@ export const STORE_SUFFIX = {
|
|
|
27
27
|
export const CATALOG_STORE_NAME = '__catalog__';
|
|
28
28
|
/** Reserved stats store name. */
|
|
29
29
|
export const STATS_STORE_NAME = '__stats__';
|
|
30
|
+
/**
|
|
31
|
+
* Raise when any identifier in `names` carries an unpaired surrogate — such an identifier
|
|
32
|
+
* has no faithful UTF-8 key bytes, so encoding it straight through `TextEncoder` would fold
|
|
33
|
+
* it to U+FFFD and collide with every other identifier differing only in that respect. See
|
|
34
|
+
* {@link assertNoUnpairedSurrogate}. Shared by the physical store-name builders and every
|
|
35
|
+
* catalog-key builder below so the guard reads identically regardless of which kind of name
|
|
36
|
+
* is being built.
|
|
37
|
+
*/
|
|
38
|
+
function assertKeyableIdentifiers(...names) {
|
|
39
|
+
for (const name of names) {
|
|
40
|
+
assertNoUnpairedSurrogate(name, `the identifier "${name}"`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
30
43
|
/**
|
|
31
44
|
* Build the store name for a table's data.
|
|
32
45
|
* Format: {schema}.{table}
|
|
46
|
+
*
|
|
47
|
+
* Guarded by {@link assertKeyableIdentifiers}: the physical name is handed to a provider
|
|
48
|
+
* that may encode it to bytes (`LevelDBProvider.encodeSublevelName` runs it through
|
|
49
|
+
* `TextEncoder`), which folds every unpaired surrogate to U+FFFD — so two tables whose
|
|
50
|
+
* names differ only in a lone surrogate would share one physical store. Every call site
|
|
51
|
+
* builds the name before its first side effect, so the throw always lands on a clean no-op.
|
|
52
|
+
*
|
|
53
|
+
* Refusing the identifier here is also what lets `StoreModule.assertStoreNameFree` stand in
|
|
54
|
+
* for a PHYSICAL store collision check: that guard compares names as JS strings, before any
|
|
55
|
+
* provider encoding, so distinct logical names imply distinct physical stores only where the
|
|
56
|
+
* provider's encoding is injective. With unpaired surrogates refused it is — for LevelDB
|
|
57
|
+
* (percent-escaped UTF-8) and IndexedDB (verbatim `DOMString`). It is NOT for
|
|
58
|
+
* `@quereus/plugin-nativescript-sqlite`, whose `getTableName` folds every character outside
|
|
59
|
+
* `[a-zA-Z0-9_]` to `_`; that is a lossy mapping this guard neither causes nor repairs. See
|
|
60
|
+
* `tickets/backlog/bug-mobile-provider-physical-store-name-collisions.md`.
|
|
33
61
|
*/
|
|
34
62
|
// NOTE: composes with a literal '.' delimiter, so the schema/table boundary is
|
|
35
63
|
// not recoverable from the physical name. A lone dotted identifier round-trips
|
|
@@ -40,13 +68,19 @@ export const STATS_STORE_NAME = '__stats__';
|
|
|
40
68
|
// effectively never dotted); if dotted schema names become reachable, switch to
|
|
41
69
|
// a boundary-safe encoding (length-prefix or escape the delimiter).
|
|
42
70
|
export function buildDataStoreName(schemaName, tableName) {
|
|
71
|
+
assertKeyableIdentifiers(schemaName, tableName);
|
|
43
72
|
return `${schemaName}.${tableName}`.toLowerCase();
|
|
44
73
|
}
|
|
45
74
|
/**
|
|
46
75
|
* Build the store name for a secondary index.
|
|
47
76
|
* Format: {schema}.{table}_idx_{indexName}
|
|
77
|
+
*
|
|
78
|
+
* Identifier-guarded for the same reason as {@link buildDataStoreName} — see its docstring
|
|
79
|
+
* for why refusing an unpaired surrogate is what keeps distinct logical names on distinct
|
|
80
|
+
* physical stores, and for the one provider whose encoding that still does not hold for.
|
|
48
81
|
*/
|
|
49
82
|
export function buildIndexStoreName(schemaName, tableName, indexName) {
|
|
83
|
+
assertKeyableIdentifiers(schemaName, tableName, indexName);
|
|
50
84
|
return `${schemaName}.${tableName}_idx_${indexName}`.toLowerCase();
|
|
51
85
|
}
|
|
52
86
|
/**
|
|
@@ -57,18 +91,6 @@ export function buildIndexStoreName(schemaName, tableName, indexName) {
|
|
|
57
91
|
export function buildStatsStoreName(schemaName, tableName) {
|
|
58
92
|
return `${schemaName}.${tableName}_stats`.toLowerCase();
|
|
59
93
|
}
|
|
60
|
-
/**
|
|
61
|
-
* Raise when any identifier in `names` carries an unpaired surrogate — such an identifier
|
|
62
|
-
* has no faithful UTF-8 key bytes, so encoding it straight through `TextEncoder` would fold
|
|
63
|
-
* it to U+FFFD and collide with every other identifier differing only in that respect. See
|
|
64
|
-
* {@link assertNoUnpairedSurrogate}. Shared by every catalog-key builder below so the guard
|
|
65
|
-
* reads identically regardless of which kind of catalog object is being keyed.
|
|
66
|
-
*/
|
|
67
|
-
function assertKeyableIdentifiers(...names) {
|
|
68
|
-
for (const name of names) {
|
|
69
|
-
assertNoUnpairedSurrogate(name, `the identifier "${name}"`);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
94
|
/**
|
|
73
95
|
* Build a stats key for use in the unified __stats__ store.
|
|
74
96
|
* Format: {schema}.{table}
|
|
@@ -86,9 +108,13 @@ export function buildStatsKey(schemaName, tableName) {
|
|
|
86
108
|
* `collations[i]`, when defined, encodes PK column i under its own key collation
|
|
87
109
|
* (overriding `options.collation`), so each text PK column honors its declared
|
|
88
110
|
* collation in the physical key bytes. Non-text members ignore it.
|
|
111
|
+
*
|
|
112
|
+
* `transforms[i]`, when defined, canonicalizes PK column i's value before encoding
|
|
113
|
+
* (see {@link KeyValueTransform}), so semantically-equal spellings of a
|
|
114
|
+
* semantic-ordering member ('PT1H' / 'PT60M') land on one key.
|
|
89
115
|
*/
|
|
90
|
-
export function buildDataKey(pkValues, options, directions, collations) {
|
|
91
|
-
return encodeCompositeKey(pkValues, options, directions, collations);
|
|
116
|
+
export function buildDataKey(pkValues, options, directions, collations, transforms) {
|
|
117
|
+
return encodeCompositeKey(pkValues, options, directions, collations, transforms);
|
|
92
118
|
}
|
|
93
119
|
/**
|
|
94
120
|
* Build a secondary index key.
|
|
@@ -103,10 +129,14 @@ export function buildDataKey(pkValues, options, directions, collations) {
|
|
|
103
129
|
* with the same per-column collations as the data key (see `buildDataKey`), so
|
|
104
130
|
* index maintenance (delete-then-insert on UPDATE/DELETE) addresses the same
|
|
105
131
|
* bytes the data store keys by. Index columns keep `options.collation`.
|
|
132
|
+
*
|
|
133
|
+
* `indexTransforms` / `pkTransforms` canonicalize each half's values before
|
|
134
|
+
* encoding (see {@link KeyValueTransform}); the PK-suffix transforms MUST match
|
|
135
|
+
* the data key's for the same reason as the collations above.
|
|
106
136
|
*/
|
|
107
|
-
export function buildIndexKey(indexValues, pkValues, options, indexDirections, pkDirections, pkCollations) {
|
|
108
|
-
const indexEncoded = encodeCompositeKey(indexValues, options, indexDirections);
|
|
109
|
-
const pkEncoded = encodeCompositeKey(pkValues, options, pkDirections, pkCollations);
|
|
137
|
+
export function buildIndexKey(indexValues, pkValues, options, indexDirections, pkDirections, pkCollations, indexTransforms, pkTransforms) {
|
|
138
|
+
const indexEncoded = encodeCompositeKey(indexValues, options, indexDirections, undefined, indexTransforms);
|
|
139
|
+
const pkEncoded = encodeCompositeKey(pkValues, options, pkDirections, pkCollations, pkTransforms);
|
|
110
140
|
return concatBytes(indexEncoded, pkEncoded);
|
|
111
141
|
}
|
|
112
142
|
/**
|
|
@@ -274,12 +304,20 @@ export function buildFullScanBounds() {
|
|
|
274
304
|
* would wrongly exclude entries whose leading column is a DESC NULL (encoded
|
|
275
305
|
* with a 0xff type byte) — the same trap {@link buildFullScanBounds} documents
|
|
276
306
|
* for data stores.
|
|
307
|
+
*
|
|
308
|
+
* NOTE: both `StoreTable` callers (`analyzeIndexAccess`, `buildIndexRangeBounds`)
|
|
309
|
+
* pass NO `transforms` — sound only because both decline a semantic-ordering
|
|
310
|
+
* column before they get here (the EQ-prefix loop breaks on `hasSemanticOrdering`;
|
|
311
|
+
* the range arm is gated on `keyOrderMatchesCollation`). If backlog
|
|
312
|
+
* `feat-reopen-timespan-store-seeks` re-opens either arm, thread the column's
|
|
313
|
+
* transforms through first or the bounds will address raw-value bytes while the
|
|
314
|
+
* index holds transformed ones.
|
|
277
315
|
*/
|
|
278
|
-
export function buildIndexPrefixBounds(prefixValues, options, directions) {
|
|
316
|
+
export function buildIndexPrefixBounds(prefixValues, options, directions, transforms) {
|
|
279
317
|
if (prefixValues.length === 0) {
|
|
280
318
|
return buildFullScanBounds();
|
|
281
319
|
}
|
|
282
|
-
const prefixEncoded = encodeCompositeKey(prefixValues, options, directions);
|
|
320
|
+
const prefixEncoded = encodeCompositeKey(prefixValues, options, directions, undefined, transforms);
|
|
283
321
|
return {
|
|
284
322
|
gte: prefixEncoded,
|
|
285
323
|
lt: incrementLastByte(prefixEncoded),
|
|
@@ -307,11 +345,11 @@ export function buildIndexPrefixBounds(prefixValues, options, directions) {
|
|
|
307
345
|
* those are all 0xff (so no finite increment exists), `lt` is omitted and the
|
|
308
346
|
* scan runs to the end of the store.
|
|
309
347
|
*/
|
|
310
|
-
export function buildPkPrefixBounds(prefixValues, options, directions, collations) {
|
|
348
|
+
export function buildPkPrefixBounds(prefixValues, options, directions, collations, transforms) {
|
|
311
349
|
if (prefixValues.length === 0) {
|
|
312
350
|
return buildFullScanBounds();
|
|
313
351
|
}
|
|
314
|
-
const prefixEncoded = encodeCompositeKey(prefixValues, options, directions, collations);
|
|
352
|
+
const prefixEncoded = encodeCompositeKey(prefixValues, options, directions, collations, transforms);
|
|
315
353
|
return {
|
|
316
354
|
gte: prefixEncoded,
|
|
317
355
|
lt: incrementLastByte(prefixEncoded),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"key-builder.js","sourceRoot":"","sources":["../../../src/common/key-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,kBAAkB,EAAE,yBAAyB,
|
|
1
|
+
{"version":3,"file":"key-builder.js","sourceRoot":"","sources":["../../../src/common/key-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,kBAAkB,EAAE,yBAAyB,EAA8C,MAAM,eAAe,CAAC;AAE1H,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC;AAClC,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC3B,KAAK,EAAE,OAAO;IACd,KAA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B;IAEvB,OAAO,sBAAsB,CAAC,YAAY,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC;AAC5D,CAAC;AAED,8CAA8C;AAC9C,MAAM,UAAU,YAAY,CAC3B,SAAoC,EACpC,UAAkB,EAClB,UAAkB,EAClB,QAAiB;IAEjB,OAAO,eAAe,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;AAChD,CAAC;AAED,qDAAqD;AACrD,MAAM,UAAU,mBAAmB,CAClC,SAAoC,EACpC,UAAmB;IAEnB,OAAO,sBAAsB,CAAC,UAAU,CAAC,CAAC;AAC3C,CAAC"}
|
|
@@ -58,11 +58,16 @@ export type BatchOp = {
|
|
|
58
58
|
};
|
|
59
59
|
/**
|
|
60
60
|
* Write batch for atomic operations.
|
|
61
|
+
*
|
|
62
|
+
* Queued operations apply in the order they were queued. When two operations
|
|
63
|
+
* target the same key, the later one wins: `put(k, a); delete(k)` leaves `k`
|
|
64
|
+
* absent, and `delete(k); put(k, a)` leaves `k` set to `a`. Ordering is only
|
|
65
|
+
* defined *within* one batch; `write()` remains all-or-nothing.
|
|
61
66
|
*/
|
|
62
67
|
export interface WriteBatch {
|
|
63
|
-
/** Queue a put operation. */
|
|
68
|
+
/** Queue a put operation. On a key already queued in this batch, supersedes it. */
|
|
64
69
|
put(key: Uint8Array, value: Uint8Array): void;
|
|
65
|
-
/** Queue a delete operation. */
|
|
70
|
+
/** Queue a delete operation. On a key already queued in this batch, supersedes it. */
|
|
66
71
|
delete(key: Uint8Array): void;
|
|
67
72
|
/** Execute all queued operations atomically. */
|
|
68
73
|
write(): Promise<void>;
|
|
@@ -80,6 +85,11 @@ export interface WriteBatch {
|
|
|
80
85
|
* Stores are addressed by {@link KVStore} handle (matching how the transaction
|
|
81
86
|
* coordinator already tracks each op's target store), not by name — so it
|
|
82
87
|
* composes with the coordinator's per-store bucketing without a name lookup.
|
|
88
|
+
*
|
|
89
|
+
* Same-key ordering matches {@link WriteBatch}: queued ops apply in queue order,
|
|
90
|
+
* so for one (store, key) pair the later op wins. The coordinator replays its
|
|
91
|
+
* pending ops into one atomic batch without collapsing duplicates, so a
|
|
92
|
+
* transaction that writes then deletes the same row depends on this.
|
|
83
93
|
*/
|
|
84
94
|
export interface AtomicBatch {
|
|
85
95
|
/** Queue a put against the given store. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kv-store.d.ts","sourceRoot":"","sources":["../../../src/common/kv-store.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B,gEAAgE;IAChE,GAAG,CAAC,EAAE,UAAU,CAAC;IACjB,6BAA6B;IAC7B,EAAE,CAAC,EAAE,UAAU,CAAC;IAChB,2BAA2B;IAC3B,GAAG,CAAC,EAAE,UAAU,CAAC;IACjB,wDAAwD;IACxD,EAAE,CAAC,EAAE,UAAU,CAAC;IAChB,gCAAgC;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,OAAO;IACvB,GAAG,EAAE,UAAU,CAAC;IAChB,KAAK,EAAE,UAAU,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC5B;;;;;;;;;;;;OAYG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CACf;AAED;;GAEG;AACH,MAAM,MAAM,OAAO,GAChB;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,GAAG,EAAE,UAAU,CAAC;IAAC,KAAK,EAAE,UAAU,CAAA;CAAE,GACnD;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,GAAG,EAAE,UAAU,CAAA;CAAE,CAAC;AAEvC
|
|
1
|
+
{"version":3,"file":"kv-store.d.ts","sourceRoot":"","sources":["../../../src/common/kv-store.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B,gEAAgE;IAChE,G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AAC,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvH;;;;;;;;;;OAUG;IACH,gBAAgB,CAAC,IAAI,WAAW,GAAG,SAAS,CAAC;CAC7C"}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* - {prefix}.__stats__ - Unified stats store (row counts for all tables)
|
|
13
13
|
* - Catalog store: __catalog__ - DDL metadata keyed by {schema}.{table}
|
|
14
14
|
*/
|
|
15
|
-
import type { Database, TableSchema, TableIndexSchema, VirtualTableModule, BaseModuleConfig, BestAccessPlanRequest, BestAccessPlanResult, ModuleCapabilities, SchemaChangeInfo, Schema, MappingAdvertisement, ViewSchema, MaintainedTableSchema, BackingHost, LensDeploymentSnapshot } from '@quereus/quereus';
|
|
15
|
+
import type { Database, TableSchema, TableIndexSchema, VirtualTableModule, BaseModuleConfig, BestAccessPlanRequest, BestAccessPlanResult, ModuleCapabilities, SchemaChangeInfo, Schema, MappingAdvertisement, ViewSchema, MaintainedTableSchema, BackingHost, LensDeploymentSnapshot, CatalogObjectKind } from '@quereus/quereus';
|
|
16
16
|
import type { EffectiveRowSource } from '@quereus/quereus';
|
|
17
17
|
import type { KVStore, KVStoreProvider } from './kv-store.js';
|
|
18
18
|
import type { StoreEventEmitter } from './events.js';
|
|
@@ -406,9 +406,18 @@ export declare class StoreModule implements VirtualTableModule<StoreTable, Store
|
|
|
406
406
|
* connection's `db.getKeyNormalizerResolver()` — see {@link buildIndexEntries}.
|
|
407
407
|
*
|
|
408
408
|
* NOTE: reads the data store committed-only and writes the index stores outside the
|
|
409
|
-
* coordinator. Sound only because
|
|
410
|
-
*
|
|
411
|
-
*
|
|
409
|
+
* coordinator. Sound only because every caller calls {@link ddlCommitPendingOps}
|
|
410
|
+
* first, so this module's "committed" is "everything live". A caller that skips that
|
|
411
|
+
* flush would rebuild an index missing its transaction's pending rows.
|
|
412
|
+
*
|
|
413
|
+
* `skipDuplicateCheck` suppresses {@link buildIndexEntries}' in-pass UNIQUE check.
|
|
414
|
+
* The value-rewriting / key-transform ALTER COLUMN arm sets it: its pre-mutation
|
|
415
|
+
* UNIQUE re-validation already judged the ISSUING connection's effective rows (a
|
|
416
|
+
* wrapper's overlay included), and this rebuild sees only THIS module's committed
|
|
417
|
+
* rows — a superset that may retain a row the wrapper's transaction has deleted, so
|
|
418
|
+
* judging it here would spuriously reject a duplicate pair the probe correctly
|
|
419
|
+
* accepted. Mirrors the memory module's deliberately non-enforcing base rebuild
|
|
420
|
+
* (the probe is the only guard).
|
|
412
421
|
*/
|
|
413
422
|
private rebuildSecondaryIndexes;
|
|
414
423
|
/**
|
|
@@ -431,7 +440,7 @@ export declare class StoreModule implements VirtualTableModule<StoreTable, Store
|
|
|
431
440
|
*
|
|
432
441
|
* No index store is written — store UNIQUE enforcement is a full-scan over
|
|
433
442
|
* `uniqueConstraints` at write time. The signature is built by
|
|
434
|
-
* {@link
|
|
443
|
+
* {@link dedupeRowSignature} with one normalizer per constrained column, resolved from
|
|
435
444
|
* `tableSchema.columns[idx].collation` through the connection's
|
|
436
445
|
* `db.getKeyNormalizerResolver()`, so a per-column collation registered with
|
|
437
446
|
* `db.registerCollation` is honored (matching write-time `compareSqlValues`
|
|
@@ -536,6 +545,10 @@ export declare class StoreModule implements VirtualTableModule<StoreTable, Store
|
|
|
536
545
|
* ADD COLUMN arm of {@link alterTable}: append the new column, eagerly migrate
|
|
537
546
|
* each row (literal or per-row backfill), and persist. Behavior-preserving
|
|
538
547
|
* extraction of the former `switch` arm.
|
|
548
|
+
*
|
|
549
|
+
* The store always appends. A caller-chosen `insertAtIndex` (module-API only; SQL never
|
|
550
|
+
* produces one) is rejected unless it names the append position, rather than silently
|
|
551
|
+
* landing the column somewhere the caller did not ask for.
|
|
539
552
|
*/
|
|
540
553
|
private alterAddColumn;
|
|
541
554
|
/** DROP COLUMN arm of {@link alterTable}: drop the column slot, reindex PK / indexes /
|
|
@@ -565,8 +578,10 @@ export declare class StoreModule implements VirtualTableModule<StoreTable, Store
|
|
|
565
578
|
/**
|
|
566
579
|
* SET NOT NULL / DROP NOT NULL sub-branch of {@link alterColumnChange}. Returns the
|
|
567
580
|
* new column schema, or null when the column is already in the desired nullability
|
|
568
|
-
* (the pre-refactor `return oldSchema` no-op).
|
|
569
|
-
*
|
|
581
|
+
* (the pre-refactor `return oldSchema` no-op). Mutates nothing: the NULL-backfill
|
|
582
|
+
* probe is throw-only, and the backfill itself is returned as a deferred
|
|
583
|
+
* `valueConvert` (null → DEFAULT) the caller applies only after every throw-only
|
|
584
|
+
* check — including the UNIQUE re-validation over the backfilled values — has passed.
|
|
570
585
|
*
|
|
571
586
|
* `rows` is the wrapper-supplied effective row source (the isolation overlay). When present,
|
|
572
587
|
* the reject-vs-backfill decision scans it instead of `table.rowsWithNullAtIndex`: behind the
|
|
@@ -578,8 +593,27 @@ export declare class StoreModule implements VirtualTableModule<StoreTable, Store
|
|
|
578
593
|
private alterColumnSetNotNull;
|
|
579
594
|
/**
|
|
580
595
|
* SET DATA TYPE sub-branch of {@link alterColumnChange}. Returns the retyped column
|
|
581
|
-
* schema.
|
|
582
|
-
*
|
|
596
|
+
* schema. Mutates nothing: for every retype between DIFFERENT logical types, a
|
|
597
|
+
* throw-only convert pass over the live rows proves every value convertible, and the
|
|
598
|
+
* conversion itself is returned as a deferred `valueConvert` the caller applies only
|
|
599
|
+
* after every throw-only check — including the UNIQUE re-validation over the converted
|
|
600
|
+
* values — has passed. Gated on logical-type IDENTITY, not the physical storage class:
|
|
601
|
+
* `inferType` flattens aliases to the shared type object (`varchar(50)` IS `TEXT_TYPE`),
|
|
602
|
+
* so an alias retype is schema-only, while a same-class retype (text → date) still
|
|
603
|
+
* rejects values the new type refuses and rewrites the rest to the new type's
|
|
604
|
+
* canonical spelling ('2024-06-05T00:00:00Z' → '2024-06-05') — exactly as an INSERT
|
|
605
|
+
* would have stored them.
|
|
606
|
+
*
|
|
607
|
+
* A retype of a PRIMARY KEY member is refused here rather than converted: the rewrite
|
|
608
|
+
* below is `mapRowsAtIndex`, a payload-only rewrite that reuses `entry.key` verbatim, so
|
|
609
|
+
* a PK column's physical key bytes would stay encoded under the OLD type while the value
|
|
610
|
+
* moves to the new one — unfindable by any lookup under the new encoding, and the same
|
|
611
|
+
* `keyTransformChanged` path in the caller would re-key from the pre-rewrite values before
|
|
612
|
+
* this rewrite ever ran (see the NOTE above the `valueConvert` block in
|
|
613
|
+
* {@link alterColumnChange}). Every live SQL caller already refuses this earlier (the
|
|
614
|
+
* engine's `runAlterColumn` and the materialized-view reshape's inexpressibility check),
|
|
615
|
+
* so this only guards a direct module call — mirrors the memory backend's carve-out
|
|
616
|
+
* (`MemoryTableManager.alterColumn`).
|
|
583
617
|
*/
|
|
584
618
|
private alterColumnSetDataType;
|
|
585
619
|
/**
|
|
@@ -776,12 +810,8 @@ export declare class StoreModule implements VirtualTableModule<StoreTable, Store
|
|
|
776
810
|
private buildCatalogEntry;
|
|
777
811
|
/**
|
|
778
812
|
* Encode a bundle of persisted schema text (DDL) for the catalog store.
|
|
779
|
-
*
|
|
780
|
-
*
|
|
781
|
-
* quoted column name, a `default '…'` string literal, a `check` constraint's string
|
|
782
|
-
* constant — would otherwise fold to U+FFFD under `TextEncoder` and read back as
|
|
783
|
-
* different schema text than what was created. This does not rely on the catalog-key
|
|
784
|
-
* builders' identifier guard having already caught it; it catches it independently.
|
|
813
|
+
* The guard is {@link assertPersistableDdlText} — see it for why the FULL text
|
|
814
|
+
* is checked, not just the object's name.
|
|
785
815
|
*/
|
|
786
816
|
private encodeCatalogDDL;
|
|
787
817
|
/**
|
|
@@ -898,6 +928,25 @@ export declare class StoreModule implements VirtualTableModule<StoreTable, Store
|
|
|
898
928
|
saveMaterializedViewDDL(mv: MaintainedTableSchema): Promise<void>;
|
|
899
929
|
/** Remove a materialized view's catalog entry (on DROP MATERIALIZED VIEW). */
|
|
900
930
|
removeMaterializedViewDDL(schemaName: string, mvName: string): Promise<void>;
|
|
931
|
+
/**
|
|
932
|
+
* Pre-flight veto (see `VirtualTableModule.assertCatalogObjectPersistable`): refuse a
|
|
933
|
+
* view / materialized view whose catalog entry this module could not durably write.
|
|
934
|
+
*
|
|
935
|
+
* It runs exactly the derivation the write path runs — {@link viewCatalogEntry} /
|
|
936
|
+
* {@link maintainedViewCatalogEntry} build the key (rejecting an unencodable
|
|
937
|
+
* identifier) and {@link assertPersistableDdlText} checks the generated DDL text —
|
|
938
|
+
* so the veto and the write cannot disagree about what is persistable. It is the only
|
|
939
|
+
* synchronous path a rejection can travel: the actual save is chained onto
|
|
940
|
+
* `persistQueue` behind a `SchemaChangeNotifier` listener, and both layers swallow.
|
|
941
|
+
*
|
|
942
|
+
* Gated on `subscribedDb === db`: this module persists a view/MV only while subscribed
|
|
943
|
+
* to that `Database`'s change notifier ({@link ensureSchemaSubscription}, driven by the
|
|
944
|
+
* first `create`/`connect`/`alterTable`/`rehydrateCatalog`). A module registered but
|
|
945
|
+
* never handed a `db` writes nothing, so vetoing there would reject a definition that
|
|
946
|
+
* loses nothing. The gate becomes removable if persistence is ever made unconditional
|
|
947
|
+
* (`bug-store-untouched-table-and-early-view-never-persisted`).
|
|
948
|
+
*/
|
|
949
|
+
assertCatalogObjectPersistable(db: Database, kind: CatalogObjectKind, object: ViewSchema | TableSchema): void;
|
|
901
950
|
/**
|
|
902
951
|
* Compare-write a view/MV catalog entry: write only when the entry is absent or its
|
|
903
952
|
* DDL differs from `newDDL` (skip identical). Unlike the table path's
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store-module.d.ts","sourceRoot":"","sources":["../../../src/common/store-module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EACX,QAAQ,EAER,WAAW,EACX,gBAAgB,EAGhB,kBAAkB,EAClB,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,EAKpB,kBA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