@lunora/shard-engine 1.0.0-alpha.10 → 1.0.0-alpha.101
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 +1 -1
- package/dist/conformance/index.mjs +1 -1
- package/dist/index.d.mts +671 -149
- package/dist/index.d.ts +671 -149
- package/dist/index.mjs +1 -1
- package/dist/packem_shared/ADMIN_FUNCTIONS-CZiYkV6K.mjs +1 -0
- package/dist/packem_shared/AGGREGATE_SQL_FUNCTION-DDEoMnJR.mjs +1 -0
- package/dist/packem_shared/AGG_COUNT-DNnEXtyM.mjs +1 -0
- package/dist/packem_shared/AUDIT_LOG_TABLE-CZNxCRLv.mjs +8 -0
- package/dist/packem_shared/BIGINT_KEY_DIGITS-C9a7Ix7k.mjs +1 -0
- package/dist/packem_shared/CDC_LOG_TABLE-QaBxSIZM.mjs +18 -0
- package/dist/packem_shared/CLIENT_WATERMARK_TABLE-vLjfNhBR.mjs +7 -0
- package/dist/packem_shared/COMMIT_SEQ_FIELD-BY_vc9bw.mjs +4 -0
- package/dist/packem_shared/CURSOR_PREFIX-BX8jkMJa.mjs +1 -0
- package/dist/packem_shared/CountRlsUnsupportedError-BvsDqfO2.mjs +1 -0
- package/dist/packem_shared/DATA_MIGRATION_STATE_TABLE-BMbxLEaN.mjs +31 -0
- package/dist/packem_shared/DEFAULT_MAX_RELATION_KEYS-CYPZfQH9.mjs +1 -0
- package/dist/packem_shared/DEFAULT_MAX_RELAYS-B-yt9l6-.mjs +8 -0
- package/dist/packem_shared/DEFAULT_PROMOTION_THRESHOLDS-91RH_llq.mjs +1 -0
- package/dist/packem_shared/DEFAULT_TRANSACTION_LIMITS-DiR5z5EX.mjs +1 -0
- package/dist/packem_shared/DurableStreamRunner-Dk9Pn-B8.mjs +1 -0
- package/dist/packem_shared/GEO_DEFAULT_PRECISION-CqpQZ-J_.mjs +1 -0
- package/dist/packem_shared/GLOBAL_SHAPE_SNAPSHOT_TABLE-pMxZ-obU.mjs +7 -0
- package/dist/packem_shared/GlobalPollTick-BNK4o-XT.mjs +1 -0
- package/dist/packem_shared/IDEMPOTENCY_TABLE-AOJCuq5U.mjs +7 -0
- package/dist/packem_shared/MAIL_RETENTION-BxAGL3hK.mjs +18 -0
- package/dist/packem_shared/MAX_SQL_ROWS-Dh_Ty0Zo.mjs +4 -0
- package/dist/packem_shared/MAX_TOKEN_LENGTH-BakL9FUy-B3VwYY8C.mjs +1 -0
- package/dist/packem_shared/NotUniqueError-D4EV8EzO.mjs +1 -0
- package/dist/packem_shared/QUEUE_TABLE-DKANxmEZ.mjs +17 -0
- package/dist/packem_shared/RANK_TIEBREAK-B0_x8iev.mjs +1 -0
- package/dist/packem_shared/REACTOR_STATE_TABLE-B8IehLv8.mjs +28 -0
- package/dist/packem_shared/RELATED_DEFAULT_LIMIT-CBYQQIrZ.mjs +1 -0
- package/dist/packem_shared/RELATION_EXISTS_KEY-CFUhnZSZ.mjs +1 -0
- package/dist/packem_shared/REPROJECTION_MIGRATION_PREFIX-Czcb6_mO.mjs +1 -0
- package/dist/packem_shared/RLS_UNWRAP_SYMBOL-rSxYzw-G.mjs +1 -0
- package/dist/packem_shared/ReactiveCache-D8ccaO6f.mjs +1 -0
- package/dist/packem_shared/SCAN_DEP-D7qE3iUe.mjs +1 -0
- package/dist/packem_shared/SCHEDULE_OUTBOX_TABLE-CgLvGxpY.mjs +11 -0
- package/dist/packem_shared/SCHEMA_HISTORY_MAX_VERSIONS-BMcUIqBY.mjs +6 -0
- package/dist/packem_shared/SEARCH_STATE_TABLE-wgl-SePe.mjs +1 -0
- package/dist/packem_shared/SHAPE_POKE_CURSOR_TABLE-cn0stGAL.mjs +8 -0
- package/dist/packem_shared/ShapeDiffCache-gdaILV5E.mjs +1 -0
- package/dist/packem_shared/ShardRunner-CrveaPId.mjs +1 -0
- package/dist/packem_shared/UNVOUCHABLE_DEP-C68htACn.mjs +1 -0
- package/dist/packem_shared/VECTOR_BACKFILL_MAX_PAGES-B2ZWxshy.mjs +1 -0
- package/dist/packem_shared/WORKERD_SQLITE_LIMITS-DBH23L_S.mjs +1 -0
- package/dist/packem_shared/aggregateTableName-C7o-gpms.mjs +1 -0
- package/dist/packem_shared/appendStreamChunk-7ZyAZGg_.mjs +17 -0
- package/dist/packem_shared/applyOnDelete-DJsOG8tz.mjs +1 -0
- package/dist/packem_shared/archiveCdcSegment-BON69Nug.mjs +4 -0
- package/dist/packem_shared/{armRestore-BNzdvQ_o.mjs → armRestore-Bu1_8SUa.mjs} +1 -1
- package/dist/packem_shared/awaitWsDrain-apizgmKY.mjs +1 -0
- package/dist/packem_shared/backfillAggregateIndexes-B_3xdOgV.mjs +1 -0
- package/dist/packem_shared/base64-DfpzS4o_.mjs +1 -0
- package/dist/packem_shared/buildIndexRange-6nIZDf4m.mjs +1 -0
- package/dist/packem_shared/buildPokeFrames-BBE6J91z.mjs +1 -0
- package/dist/packem_shared/buildReprojectionMigration-IMrfRdvU.mjs +1 -0
- package/dist/packem_shared/buildSettings-BRkZd6_E.mjs +1 -0
- package/dist/packem_shared/buildShapeDiff-D-J_GmC1.mjs +1 -0
- package/dist/packem_shared/clearMemoryTables-CogAvVHR.mjs +1 -0
- package/dist/packem_shared/compileWhereSql-DLfUbHc-.mjs +1 -0
- package/dist/packem_shared/computeRankPage-3AiKfT8q.mjs +1 -0
- package/dist/packem_shared/createCompanionSync-Rjn0lsT6.mjs +1 -0
- package/dist/packem_shared/createReplicaLink-CV7SD_b-.mjs +7 -0
- package/dist/packem_shared/createSystemReader-DcDLFfC-.mjs +1 -0
- package/dist/packem_shared/ctx-db-relay-shapes-DuqhDLw8.mjs +17 -0
- package/dist/packem_shared/ctx-db-search-state-DVCp4JQf.mjs +1 -0
- package/dist/packem_shared/defineEngineContractSuite-CJi11pDP.mjs +1 -0
- package/dist/packem_shared/diffExternalSource-DgDJhslq.mjs +1 -0
- package/dist/packem_shared/do-sql-BEFrJUds.mjs +1 -0
- package/dist/packem_shared/effective-kind-BmG_zCAy.mjs +1 -0
- package/dist/packem_shared/envOptionalPositiveInt-D2pY-c64.mjs +1 -0
- package/dist/packem_shared/estimate-bytes-CTuiPWMD.mjs +1 -0
- package/dist/packem_shared/exportShardRows-CTDgQEF8.mjs +1 -0
- package/dist/packem_shared/fts-companion-pUdD6kF-.mjs +1 -0
- package/dist/packem_shared/ftsCompanionDdl-Co6WSyCB.mjs +1 -0
- package/dist/packem_shared/hasTrigger-CjlwI4le.mjs +1 -0
- package/dist/packem_shared/isInternalTableName-BoljO2tP.mjs +1 -0
- package/dist/packem_shared/isPushableWhere-BeYAOjUb.mjs +1 -0
- package/dist/packem_shared/isSoftDeleted-sGRSPPQq.mjs +9 -0
- package/dist/packem_shared/liftSourceId-CA3ENhXj.mjs +1 -0
- package/dist/packem_shared/materializeExternalRows-DhINQHwd.mjs +1 -0
- package/dist/packem_shared/mergeChangedKeys-DH9RAARR.mjs +1 -0
- package/dist/packem_shared/quoteIdentifier-CObIFRhb.mjs +1 -0
- package/dist/packem_shared/relation-operators-BEg-CvCH.mjs +1 -0
- package/dist/packem_shared/runDrizzle-Du5HLitO.mjs +1 -0
- package/dist/packem_shared/runShardMigrations-MXioI81k.mjs +5 -0
- package/dist/packem_shared/runSocketPool-CZJ2X9cF.mjs +1 -0
- package/dist/packem_shared/selectExpiredIds-DQg6v5Uf.mjs +1 -0
- package/dist/packem_shared/selectShapeMembers-BXhvEt4X.mjs +1 -0
- package/dist/packem_shared/serializeSqlValue-BbZ5hKM7.mjs +1 -0
- package/dist/packem_shared/stableStringify-DibjylKD.mjs +1 -0
- package/dist/packem_shared/stableWireKey-D2US4k_J.mjs +1 -0
- package/dist/packem_shared/stubByName-C_P73AOx.mjs +1 -0
- package/dist/packem_shared/where-sql-DFs8Zw7-.mjs +1 -0
- package/dist/packem_shared/wire-codec-C-FpWm52.mjs +1 -0
- package/package.json +3 -3
- package/dist/packem_shared/ADMIN_FUNCTIONS-vj2G8OR6.mjs +0 -1
- package/dist/packem_shared/AGGREGATE_SQL_FUNCTION-QYaiuty4.mjs +0 -1
- package/dist/packem_shared/AGG_COUNT-Bzd34FRk.mjs +0 -1
- package/dist/packem_shared/AUDIT_LOG_TABLE-CaA0jL0L.mjs +0 -8
- package/dist/packem_shared/CDC_LOG_TABLE-BYLRV7-q.mjs +0 -8
- package/dist/packem_shared/CLIENT_WATERMARK_TABLE-CXsSLU8D.mjs +0 -7
- package/dist/packem_shared/CountRlsUnsupportedError-B2WKJD9v.mjs +0 -1
- package/dist/packem_shared/DATA_MIGRATION_STATE_TABLE-BZMVrLcy.mjs +0 -31
- package/dist/packem_shared/DEFAULT_MAX_RELATION_KEYS-bq00btqV.mjs +0 -1
- package/dist/packem_shared/DEFAULT_MAX_RELAYS-Bql_LKaq.mjs +0 -1
- package/dist/packem_shared/DEFAULT_PROMOTION_THRESHOLDS-AgPry7WL.mjs +0 -1
- package/dist/packem_shared/DEFAULT_TRANSACTION_LIMITS-BH5q0Ror.mjs +0 -1
- package/dist/packem_shared/FTS_COUNT_COLUMN-D1gY3wwZ-CZHdaRrd.mjs +0 -1
- package/dist/packem_shared/GEO_DEFAULT_PRECISION-okRCkZ6r.mjs +0 -1
- package/dist/packem_shared/GLOBAL_SHAPE_SNAPSHOT_TABLE-DX-6-gBP.mjs +0 -7
- package/dist/packem_shared/IDEMPOTENCY_TABLE-DjkEMp6w.mjs +0 -7
- package/dist/packem_shared/MAIL_RETENTION-KmozO2NQ.mjs +0 -18
- package/dist/packem_shared/MAX_SQL_ROWS-nMwkxv5f.mjs +0 -2
- package/dist/packem_shared/NotUniqueError-DCzs_EKE.mjs +0 -1
- package/dist/packem_shared/QUEUE_TABLE-DYCDvzTG.mjs +0 -17
- package/dist/packem_shared/RANK_TIEBREAK-9NU5s_mi.mjs +0 -1
- package/dist/packem_shared/RELATION_EXISTS_KEY-BaqSIFU1.mjs +0 -1
- package/dist/packem_shared/RLS_UNWRAP_SYMBOL-CBYPlYBb.mjs +0 -1
- package/dist/packem_shared/ReactiveCache-D7tpXME6.mjs +0 -1
- package/dist/packem_shared/SCAN_DEP-D_yR9EeV.mjs +0 -1
- package/dist/packem_shared/SCHEMA_HISTORY_MAX_VERSIONS-CHXz6p_z.mjs +0 -6
- package/dist/packem_shared/SEARCH_STATE_TABLE-eLN8U5tz.mjs +0 -1
- package/dist/packem_shared/ShardRunner-DIqVdWtk.mjs +0 -1
- package/dist/packem_shared/aggregateTableName-G-eXyjcz.mjs +0 -1
- package/dist/packem_shared/applyOnDelete-uFRC5p1d.mjs +0 -1
- package/dist/packem_shared/applySelect-B0CF8T7y.mjs +0 -1
- package/dist/packem_shared/awaitWsDrain-BO5x5HYv.mjs +0 -1
- package/dist/packem_shared/backfillAggregateIndexes-DSA1Pf3L.mjs +0 -1
- package/dist/packem_shared/buildIndexRange-DFsdtPjD.mjs +0 -1
- package/dist/packem_shared/buildPokeFrames-FXWhJFyr.mjs +0 -1
- package/dist/packem_shared/buildSettings-DT18_DkX.mjs +0 -1
- package/dist/packem_shared/compileWhereSql-BLcfs4QW.mjs +0 -1
- package/dist/packem_shared/computeRankPage-IUSS-zIB.mjs +0 -1
- package/dist/packem_shared/createCompanionSync-BU85IZPJ.mjs +0 -1
- package/dist/packem_shared/createReadFootprint-DIrrxRTE.mjs +0 -1
- package/dist/packem_shared/createSystemReader-DcDcrtM3.mjs +0 -1
- package/dist/packem_shared/defineEngineContractSuite-DA9Xajwm.mjs +0 -1
- package/dist/packem_shared/diffExternalSource-DMpkJta1.mjs +0 -1
- package/dist/packem_shared/estimate-bytes-DwQON1Ky.mjs +0 -1
- package/dist/packem_shared/exportShardRows-kt42wijd.mjs +0 -1
- package/dist/packem_shared/hasTrigger-CbkOHExZ.mjs +0 -1
- package/dist/packem_shared/isSoftDeleted-CbykrrSZ.mjs +0 -9
- package/dist/packem_shared/liftSourceId-DApAbu7Q.mjs +0 -1
- package/dist/packem_shared/materializeExternalRows-DgG38W3I.mjs +0 -1
- package/dist/packem_shared/mergeChangedKeys-BXtUgIPW.mjs +0 -1
- package/dist/packem_shared/param-B5lF5Jd9.mjs +0 -1
- package/dist/packem_shared/quote-identifier-CGiYFBvY.mjs +0 -1
- package/dist/packem_shared/runDrizzle-GKR3y97k.mjs +0 -1
- package/dist/packem_shared/runShardMigrations-CJ9Fkslb.mjs +0 -5
- package/dist/packem_shared/runSocketPool-DPQLVyWF.mjs +0 -1
- package/dist/packem_shared/selectExpiredIds-CFLRQUFO.mjs +0 -1
- package/dist/packem_shared/selectShapeMemberIds-DK74eAPs.mjs +0 -1
- package/dist/packem_shared/serializeSqlValue-DnpyaLcw.mjs +0 -1
- package/dist/packem_shared/stableStringify-BjLh4gvA.mjs +0 -1
- package/dist/packem_shared/stableWireKey-C2NzK-K_.mjs +0 -1
- package/dist/packem_shared/wire-codec-ivyqGF-j.mjs +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LunoraError } from '@lunora/errors';
|
|
2
|
+
import { R2BucketLike, ShardHost, SocketHost, SocketHandle } from '@lunora/platform';
|
|
2
3
|
import { SQL, Name } from 'drizzle-orm';
|
|
3
|
-
import { ShardHost, SocketHost, SocketHandle } from '@lunora/platform';
|
|
4
4
|
interface KeyRange {
|
|
5
5
|
hi: string;
|
|
6
6
|
index: string;
|
|
@@ -27,10 +27,12 @@ interface ScheduledFunctionDoc {
|
|
|
27
27
|
args: Record<string, unknown>;
|
|
28
28
|
attempts?: number;
|
|
29
29
|
enqueuedAt: number;
|
|
30
|
-
functionPath
|
|
30
|
+
functionPath?: string;
|
|
31
31
|
id: string;
|
|
32
|
+
pool?: string;
|
|
32
33
|
scheduledFor: number;
|
|
33
34
|
shardKey?: string;
|
|
35
|
+
workflow?: string;
|
|
34
36
|
}
|
|
35
37
|
interface StorageMetadata {
|
|
36
38
|
contentType?: string;
|
|
@@ -86,6 +88,75 @@ interface WhereInput {
|
|
|
86
88
|
OR?: WhereInput[];
|
|
87
89
|
}
|
|
88
90
|
declare const RELATION_EXISTS_KEY = "__relationExists";
|
|
91
|
+
interface SubscriptionQuery {
|
|
92
|
+
args?: Record<string, unknown>;
|
|
93
|
+
functionPath?: string;
|
|
94
|
+
sinceEpoch?: string;
|
|
95
|
+
sinceSeq?: number;
|
|
96
|
+
table?: string;
|
|
97
|
+
}
|
|
98
|
+
interface ShapeSubscriptionQuery {
|
|
99
|
+
args?: Record<string, unknown>;
|
|
100
|
+
name: string;
|
|
101
|
+
sinceEpoch?: string;
|
|
102
|
+
sinceSeq?: number;
|
|
103
|
+
}
|
|
104
|
+
interface SubscriptionEnvelope {
|
|
105
|
+
caps?: string[];
|
|
106
|
+
clientId?: string;
|
|
107
|
+
context?: Record<string, unknown>;
|
|
108
|
+
data?: unknown;
|
|
109
|
+
generation?: number;
|
|
110
|
+
id: string;
|
|
111
|
+
query?: SubscriptionQuery;
|
|
112
|
+
shape?: {
|
|
113
|
+
args?: Record<string, unknown>;
|
|
114
|
+
name: string;
|
|
115
|
+
};
|
|
116
|
+
sinceCheckpoint?: number;
|
|
117
|
+
sinceChunk?: number;
|
|
118
|
+
sinceEpoch?: string;
|
|
119
|
+
topic?: string;
|
|
120
|
+
type: "ack" | "connect" | "shape_subscribe" | "shape_unsubscribe" | "stream" | "subscribe" | "unsubscribe" | "whisper" | "whisper_subscribe" | "whisper_unsubscribe";
|
|
121
|
+
}
|
|
122
|
+
interface RpcRequest {
|
|
123
|
+
args?: Record<string, unknown>;
|
|
124
|
+
functionPath: string;
|
|
125
|
+
}
|
|
126
|
+
interface SocketAttachment {
|
|
127
|
+
admin?: boolean;
|
|
128
|
+
adminBinding?: string;
|
|
129
|
+
clientId?: string;
|
|
130
|
+
connected?: boolean;
|
|
131
|
+
connectionId?: string;
|
|
132
|
+
context?: Record<string, unknown>;
|
|
133
|
+
expiresAt?: number;
|
|
134
|
+
identity?: Record<string, unknown>;
|
|
135
|
+
ip?: string;
|
|
136
|
+
pageDeltas?: boolean;
|
|
137
|
+
shapes?: Record<string, ShapeSubscriptionQuery>;
|
|
138
|
+
subs: Record<string, SubscriptionQuery>;
|
|
139
|
+
userId?: string;
|
|
140
|
+
whispers?: string[];
|
|
141
|
+
}
|
|
142
|
+
interface ResolvedShape {
|
|
143
|
+
columns?: ReadonlyArray<string>;
|
|
144
|
+
effectiveWhere?: WhereInput;
|
|
145
|
+
global?: boolean;
|
|
146
|
+
table: string;
|
|
147
|
+
}
|
|
148
|
+
interface SubscriptionIdentity {
|
|
149
|
+
identity?: Record<string, unknown>;
|
|
150
|
+
ip?: string;
|
|
151
|
+
userId?: string;
|
|
152
|
+
}
|
|
153
|
+
interface ShardSocketLike {
|
|
154
|
+
readonly bufferedAmount?: number;
|
|
155
|
+
close?: (code?: number, reason?: string) => void;
|
|
156
|
+
deserializeAttachment?: () => unknown;
|
|
157
|
+
send: (data: string) => void;
|
|
158
|
+
serializeAttachment?: (value: unknown) => void;
|
|
159
|
+
}
|
|
89
160
|
type AggregateOp = "avg" | "count" | "max" | "min" | "sum";
|
|
90
161
|
interface AggregateIndexDefinitionLike {
|
|
91
162
|
readonly by?: ReadonlyArray<string>;
|
|
@@ -137,6 +208,10 @@ interface ColumnMetaLike {
|
|
|
137
208
|
interface ValidatorLike {
|
|
138
209
|
readonly _meta?: {
|
|
139
210
|
readonly column?: ColumnMetaLike;
|
|
211
|
+
readonly inner?: ValidatorLike;
|
|
212
|
+
readonly members?: ReadonlyArray<ValidatorLike>;
|
|
213
|
+
readonly tableName?: string;
|
|
214
|
+
readonly value?: unknown;
|
|
140
215
|
};
|
|
141
216
|
readonly kind?: string;
|
|
142
217
|
readonly parse?: (value: unknown) => unknown;
|
|
@@ -180,9 +255,12 @@ interface SchemaLike {
|
|
|
180
255
|
}
|
|
181
256
|
interface TableDefinitionLike {
|
|
182
257
|
readonly aggregateIndexes?: ReadonlyArray<AggregateIndexDefinitionLike>;
|
|
258
|
+
readonly commitOrderedMode?: boolean;
|
|
259
|
+
readonly dropStalePatchesMode?: boolean;
|
|
183
260
|
readonly geoIndexes?: ReadonlyArray<GeoIndexDefinitionLike>;
|
|
184
261
|
readonly indexes: ReadonlyArray<IndexDefinitionLike>;
|
|
185
262
|
readonly isPublic?: boolean;
|
|
263
|
+
readonly memoryMode?: boolean;
|
|
186
264
|
readonly rankIndexes?: ReadonlyArray<RankIndexDefinitionLike>;
|
|
187
265
|
readonly relationMap?: Record<string, RelationDefinitionLike>;
|
|
188
266
|
readonly searchIndexes?: ReadonlyArray<SearchIndexDefinitionLike>;
|
|
@@ -219,17 +297,16 @@ interface WithInput {
|
|
|
219
297
|
[relationName: string]: NestedWith | Record<string, true> | boolean | undefined;
|
|
220
298
|
_count?: Record<string, true>;
|
|
221
299
|
}
|
|
222
|
-
interface
|
|
223
|
-
|
|
224
|
-
relation: RelationDefinitionLike;
|
|
225
|
-
row: Record<string, unknown>;
|
|
226
|
-
tableName: string;
|
|
300
|
+
interface FanOutBudget {
|
|
301
|
+
remaining: number;
|
|
227
302
|
}
|
|
228
303
|
interface ResolveWithOptions {
|
|
304
|
+
fanOutBudget?: FanOutBudget;
|
|
229
305
|
fetcher: (tableName: string, args: QueryArgs) => Promise<QueryPage>;
|
|
230
306
|
groupedCounter: (tableName: string, whereField: string, values: unknown[], policyWhere?: WhereInput) => Promise<Map<unknown, number>>;
|
|
231
307
|
parents: Record<string, unknown>[];
|
|
232
308
|
relationBaseWhere?: (table: string) => undefined | WhereInput;
|
|
309
|
+
relationMask?: RelationMask;
|
|
233
310
|
schema: {
|
|
234
311
|
readonly tables: Record<string, TableDefinitionLike>;
|
|
235
312
|
};
|
|
@@ -248,22 +325,69 @@ interface QueryArgs {
|
|
|
248
325
|
cursor?: null | string;
|
|
249
326
|
includeDeleted?: boolean;
|
|
250
327
|
limit?: number;
|
|
328
|
+
omitContinueCursor?: boolean;
|
|
251
329
|
orderBy?: OrderByInput[];
|
|
252
330
|
relationBaseWhere?: (table: string) => undefined | WhereInput;
|
|
331
|
+
relationMask?: RelationMask;
|
|
253
332
|
restrictsCounts?: boolean;
|
|
254
333
|
select?: ReadonlyArray<string>;
|
|
255
334
|
where?: WhereInput;
|
|
256
335
|
with?: WithInput;
|
|
257
336
|
}
|
|
337
|
+
interface CrossShardReadArgs {
|
|
338
|
+
orderBy?: OrderByInput[];
|
|
339
|
+
relationPolicies?: Record<string, WhereInput>;
|
|
340
|
+
where?: WhereInput;
|
|
341
|
+
with?: WithInput;
|
|
342
|
+
}
|
|
343
|
+
type RelationMask = (table: string, rows: Record<string, unknown>[]) => Record<string, unknown>[];
|
|
258
344
|
interface QueryPage {
|
|
259
345
|
continueCursor: null | string;
|
|
260
346
|
isDone: boolean;
|
|
261
347
|
page: Record<string, unknown>[];
|
|
262
348
|
splitCursor?: null | string;
|
|
263
349
|
}
|
|
350
|
+
interface RelationEdge {
|
|
351
|
+
readonly array: boolean;
|
|
352
|
+
readonly column: string;
|
|
353
|
+
readonly name: string;
|
|
354
|
+
readonly sourceTable: string;
|
|
355
|
+
readonly targetTable: string;
|
|
356
|
+
}
|
|
357
|
+
interface RelatedStartReference {
|
|
358
|
+
id: string;
|
|
359
|
+
table: string;
|
|
360
|
+
}
|
|
361
|
+
type RelatedStart = (Record<string, unknown> & {
|
|
362
|
+
_id: string;
|
|
363
|
+
}) | RelatedStartReference;
|
|
364
|
+
type RelatedDirection = "both" | "in" | "out";
|
|
365
|
+
interface RelatedOptions {
|
|
366
|
+
cursor?: null | string;
|
|
367
|
+
depth?: number;
|
|
368
|
+
direction?: RelatedDirection;
|
|
369
|
+
edges?: ReadonlyArray<string>;
|
|
370
|
+
limit?: number;
|
|
371
|
+
relationBaseWhere?: (table: string) => undefined | WhereInput;
|
|
372
|
+
relationMask?: RelationMask;
|
|
373
|
+
}
|
|
374
|
+
interface RelatedNode {
|
|
375
|
+
depth: number;
|
|
376
|
+
document: Record<string, unknown>;
|
|
377
|
+
path: ReadonlyArray<string>;
|
|
378
|
+
pathIds: ReadonlyArray<string>;
|
|
379
|
+
score: number;
|
|
380
|
+
table: string;
|
|
381
|
+
}
|
|
382
|
+
interface RelatedPage {
|
|
383
|
+
continueCursor: null | string;
|
|
384
|
+
isDone: boolean;
|
|
385
|
+
nodes: RelatedNode[];
|
|
386
|
+
}
|
|
264
387
|
interface OrderKey {
|
|
265
388
|
direction: SortDirection;
|
|
266
389
|
field: string;
|
|
390
|
+
nullable: boolean;
|
|
267
391
|
}
|
|
268
392
|
interface RestrictableQueryOptions {
|
|
269
393
|
baseWhere?: WhereInput;
|
|
@@ -399,10 +523,8 @@ interface LifecycleEvent {
|
|
|
399
523
|
shardKey: string;
|
|
400
524
|
userId: string | null;
|
|
401
525
|
}
|
|
402
|
-
interface LifecycleDispatchInfo {
|
|
526
|
+
interface LifecycleDispatchInfo extends SubscriptionIdentity {
|
|
403
527
|
event: LifecycleEvent;
|
|
404
|
-
identity: Record<string, unknown> | undefined;
|
|
405
|
-
userId: string | undefined;
|
|
406
528
|
}
|
|
407
529
|
interface MutationDelta {
|
|
408
530
|
indexKeys?: ReadonlyArray<IndexKeyEntry>;
|
|
@@ -414,6 +536,13 @@ interface MutationDelta {
|
|
|
414
536
|
interface DatabaseWriterLike {
|
|
415
537
|
aggregate: (tableName: string, options: AggregateOptions) => Promise<AggregateResult>;
|
|
416
538
|
asId?: (tableName: string, id: string) => string;
|
|
539
|
+
cdcChangedTables?: (sinceSeq: number, options?: {
|
|
540
|
+
cursorOnly?: boolean;
|
|
541
|
+
}) => Promise<{
|
|
542
|
+
cursor: number;
|
|
543
|
+
floor?: number;
|
|
544
|
+
tables: string[];
|
|
545
|
+
} | undefined>;
|
|
417
546
|
count: (tableName: string, where?: RestrictableQueryOptions | WhereInput) => Promise<number>;
|
|
418
547
|
delete: (id: string, expectedTable?: string, options?: {
|
|
419
548
|
hard?: boolean;
|
|
@@ -478,6 +607,8 @@ interface DatabaseWriterLike {
|
|
|
478
607
|
rankBefore?: (tableName: string, indexName: string, options: RankBeforeOptions) => Promise<RankBeforeResult>;
|
|
479
608
|
rankPage: (tableName: string, indexName: string, options?: RankPageOptions) => Promise<RankPage>;
|
|
480
609
|
rankPageRows?: (tableName: string, indexName: string, options?: RankPageOptions) => Promise<ShardRankPageResult>;
|
|
610
|
+
related?: (start: RelatedStart, options?: RelatedOptions) => Promise<RelatedPage>;
|
|
611
|
+
relationEdges?: ReadonlyArray<RelationEdge>;
|
|
481
612
|
replace: (id: string, document: Record<string, unknown>, expectedTable?: string, options?: {
|
|
482
613
|
allowExplicitId?: boolean;
|
|
483
614
|
}) => Promise<void>;
|
|
@@ -516,7 +647,6 @@ interface ImportShardResult {
|
|
|
516
647
|
inserted: Record<string, number>;
|
|
517
648
|
}
|
|
518
649
|
declare const selectExportTables: (schema: SchemaLike, requested?: ReadonlyArray<string>) => string[];
|
|
519
|
-
declare const exportShardTable: (writer: DatabaseWriterLike, table: string, batchSize?: number) => AsyncGenerator<ExportRow, void, undefined>;
|
|
520
650
|
declare const exportShardRows: (writer: DatabaseWriterLike, schema: SchemaLike, args: ExportShardArgs) => AsyncGenerator<ExportRow, void, undefined>;
|
|
521
651
|
declare const validateImportRow: (schema: SchemaLike, table: string, record: Record<string, unknown>) => string | undefined;
|
|
522
652
|
declare const importShardRows: (writer: DatabaseWriterLike, schema: SchemaLike, args: ImportShardArgs) => Promise<ImportShardResult>;
|
|
@@ -591,6 +721,7 @@ declare class ReactiveCache {
|
|
|
591
721
|
private readonly maxBytes;
|
|
592
722
|
private readonly now;
|
|
593
723
|
private monotonic;
|
|
724
|
+
private generation;
|
|
594
725
|
constructor(options?: ReactiveCacheOptions);
|
|
595
726
|
run<R>(key: string, deps: Set<string>, run: () => Promise<R>, ranges?: () => ReadonlyArray<KeyRange>): Promise<R>;
|
|
596
727
|
invalidate(table: string, id: string, indexKeys?: ReadonlyArray<IndexKeyEntry>): string[];
|
|
@@ -612,6 +743,7 @@ declare class ReactiveCache {
|
|
|
612
743
|
};
|
|
613
744
|
private dropRangeDeps;
|
|
614
745
|
private collectAndDrop;
|
|
746
|
+
private dropKeys;
|
|
615
747
|
private dropEntry;
|
|
616
748
|
private evict;
|
|
617
749
|
}
|
|
@@ -650,12 +782,18 @@ interface RunTriggersOptions {
|
|
|
650
782
|
}
|
|
651
783
|
declare const runTriggers: (options: RunTriggersOptions) => Promise<void>;
|
|
652
784
|
declare const hasTrigger: (schema: SchemaLike, tableName: string, op: TriggerOpLike) => boolean;
|
|
785
|
+
interface SearchBackfillProgress {
|
|
786
|
+
done: boolean;
|
|
787
|
+
pages: number;
|
|
788
|
+
}
|
|
653
789
|
declare const backfillAggregateIndexes: (sql: SqlExec, schema: SchemaLike) => void;
|
|
654
790
|
declare const backfillRankIndexes: (sql: SqlExec, schema: SchemaLike) => void;
|
|
655
791
|
declare const backfillSearchIndexesForTable: (sql: SqlExec, tableName: string, definition: {
|
|
656
792
|
searchIndexes?: ReadonlyArray<SearchIndexDefinitionLike>;
|
|
657
793
|
}) => void;
|
|
658
|
-
declare const backfillSearchIndexes: (sql: SqlExec, schema: SchemaLike
|
|
794
|
+
declare const backfillSearchIndexes: (sql: SqlExec, schema: SchemaLike, options?: {
|
|
795
|
+
maxPages?: number;
|
|
796
|
+
}) => SearchBackfillProgress;
|
|
659
797
|
declare const CDC_LOG_TABLE = "__cdc_log";
|
|
660
798
|
interface CdcChange {
|
|
661
799
|
doc?: Record<string, unknown>;
|
|
@@ -665,19 +803,35 @@ interface CdcChange {
|
|
|
665
803
|
table: string;
|
|
666
804
|
ts: number;
|
|
667
805
|
}
|
|
668
|
-
declare const
|
|
806
|
+
declare const CDC_LOG_TABLE_SEQ_INDEX = "__cdc_log_table_seq";
|
|
807
|
+
declare const migrateCdcLog: (sql: SqlExec, options?: {
|
|
808
|
+
rowHistoryIndex?: boolean;
|
|
809
|
+
}) => void;
|
|
669
810
|
declare const appendCdcChange: (sql: SqlExec, ts: number, table: string, id: string, op: CdcChange["op"], doc: Record<string, unknown> | undefined) => void;
|
|
670
811
|
declare const readCdcChanges: (sql: SqlExec, options?: {
|
|
671
812
|
limit?: number;
|
|
672
813
|
sinceSeq?: number;
|
|
673
|
-
tables?: ReadonlySet<string>;
|
|
674
814
|
}) => {
|
|
675
815
|
changes: CdcChange[];
|
|
676
816
|
cursor: number;
|
|
677
817
|
};
|
|
678
|
-
declare const
|
|
818
|
+
declare const cdcTouchesTables: (sql: SqlExec, sinceSeq: number, tables: ReadonlySet<string>) => boolean;
|
|
819
|
+
declare const cdcCanVouchFor: (sql: SqlExec, deps: ReadonlySet<string>) => boolean;
|
|
820
|
+
interface CdcChangeKey {
|
|
821
|
+
id: string;
|
|
822
|
+
op: CdcChange["op"];
|
|
823
|
+
seq: number;
|
|
824
|
+
}
|
|
825
|
+
declare const readCdcChangeKeys: (sql: SqlExec, table: string, sinceSeq: number, upTo: number) => CdcChangeKey[];
|
|
826
|
+
declare const trimCdcChanges: (sql: SqlExec, throughSeq: number, maxRows: number) => void;
|
|
827
|
+
declare const compactCdcDocs: (sql: SqlExec, throughSeq: number, maxRows: number) => void;
|
|
828
|
+
declare const cdcSeqLeavingRows: (sql: SqlExec, keep: number) => number | undefined;
|
|
679
829
|
declare const readCdcCursor: (sql: SqlExec) => number;
|
|
830
|
+
declare const cursorBelowRetainedFloor: (floor: number | undefined, sinceSeq: number) => boolean;
|
|
831
|
+
declare const cdcTrimmedError: (floor: number, sinceSeq: number, scope: "global" | "shard") => LunoraError;
|
|
832
|
+
declare const cdcForkedError: (cursor: number, sinceSeq: number, scope: "global" | "shard", epoch?: string) => LunoraError;
|
|
680
833
|
declare const minCdcSeq: (sql: SqlExec) => number | undefined;
|
|
834
|
+
declare const minCdcReplayableSeq: (sql: SqlExec) => number | undefined;
|
|
681
835
|
declare const CDC_META_TABLE = "__cdc_meta";
|
|
682
836
|
declare const migrateCdcMeta: (sql: SqlExec) => void;
|
|
683
837
|
declare const readCdcEpoch: (sql: SqlExec) => string;
|
|
@@ -687,12 +841,6 @@ declare const CLIENT_WATERMARK_TABLE = "__client_watermark";
|
|
|
687
841
|
declare const migrateClientWatermark: (sql: SqlExec) => void;
|
|
688
842
|
declare const readClientWatermark: (sql: SqlExec, identity: string, clientId: string) => number;
|
|
689
843
|
declare const advanceClientWatermark: (sql: SqlExec, identity: string, clientId: string, mutationId: number) => void;
|
|
690
|
-
declare const GLOBAL_SHAPE_SNAPSHOT_TABLE = "__global_shape_snapshot";
|
|
691
|
-
declare const migrateGlobalShapeSnapshot: (sql: SqlExec) => void;
|
|
692
|
-
declare const readGlobalShapeSnapshot: (sql: SqlExec, connectionId: string, subId: string) => Map<string, string>;
|
|
693
|
-
declare const writeGlobalShapeSnapshot: (sql: SqlExec, connectionId: string, subId: string, snapshot: Map<string, string>) => void;
|
|
694
|
-
declare const deleteGlobalShapeSnapshot: (sql: SqlExec, connectionId: string, subId: string) => void;
|
|
695
|
-
declare const deleteGlobalShapeSnapshotsForConnection: (sql: SqlExec, connectionId: string) => void;
|
|
696
844
|
declare const IDEMPOTENCY_TABLE = "__idempotency";
|
|
697
845
|
interface IdempotentRecord {
|
|
698
846
|
resultJson: string;
|
|
@@ -709,50 +857,19 @@ declare const runShardMigrations: (sql: SqlExec, schema: SchemaLike, options?: {
|
|
|
709
857
|
json: string;
|
|
710
858
|
};
|
|
711
859
|
}) => void;
|
|
712
|
-
/**
|
|
713
|
-
* How far a search companion's backfill has progressed, and what the next pass
|
|
714
|
-
* should do about it.
|
|
715
|
-
*
|
|
716
|
-
* Neither stored analysis nor query policy, which is why it is its own module
|
|
717
|
-
* rather than a third responsibility bolted onto one of them: it is *progress*,
|
|
718
|
-
* the one piece of search state that is written as the index is built rather
|
|
719
|
-
* than decided when it is read.
|
|
720
|
-
*
|
|
721
|
-
* The policy below is shared because when each engine owned a copy they
|
|
722
|
-
* immediately disagreed about exactly the two cases that matter — whether a row
|
|
723
|
-
* with no recorded profile may be resumed (it may not; nothing says what
|
|
724
|
-
* analyzed it) and whether a never-started index is worth wiping (it is not;
|
|
725
|
-
* there is nothing in it).
|
|
726
|
-
*/
|
|
727
|
-
/**
|
|
728
|
-
* How far a companion's backfill has progressed, and under which analysis.
|
|
729
|
-
* Declared here rather than beside either engine's state table: both record the
|
|
730
|
-
* same three facts, and the decisions made from them are the shared policy
|
|
731
|
-
* below.
|
|
732
|
-
*/
|
|
733
|
-
interface SearchBackfillState {
|
|
734
|
-
/** Last `id` indexed, or `undefined` when no page has run yet. */
|
|
735
|
-
cursor: string | undefined;
|
|
736
|
-
/** True once a page came back short — the table is fully indexed. */
|
|
737
|
-
done: boolean;
|
|
738
|
-
/** Analyzer profile the stored rows were built with; `undefined` predates profile tracking. */
|
|
739
|
-
profile: string | undefined;
|
|
740
|
-
}
|
|
741
|
-
declare const SEARCH_STATE_TABLE = "__lunora_search_state";
|
|
742
|
-
declare const migrateSearchState: (sql: SqlExec) => void;
|
|
743
|
-
declare const readSearchBackfillState: (sql: SqlExec, companion: string) => SearchBackfillState;
|
|
744
|
-
declare const writeSearchBackfillState: (sql: SqlExec, companion: string, cursor: string | undefined, done: boolean, profile: string) => void;
|
|
745
860
|
interface ShapeRow {
|
|
746
861
|
doc: Record<string, unknown>;
|
|
747
862
|
id: string;
|
|
748
863
|
}
|
|
749
864
|
declare const selectShapeRows: (sql: SqlExec, table: string, effectiveWhere: WhereInput | undefined) => ShapeRow[];
|
|
750
|
-
declare const
|
|
865
|
+
declare const selectShapeMembers: (sql: SqlExec, table: string, effectiveWhere: WhereInput | undefined, ids: ReadonlyArray<string>) => Map<string, Record<string, unknown>>;
|
|
751
866
|
interface SqlExec {
|
|
752
867
|
exec: <Row = Record<string, unknown>>(sql: string, ...params: unknown[]) => SqlCursor<Row>;
|
|
753
868
|
}
|
|
754
869
|
interface SqlCursor<Row> extends Iterable<Row> {
|
|
870
|
+
readonly columnNames?: string[];
|
|
755
871
|
one: () => Row;
|
|
872
|
+
raw?: () => IterableIterator<unknown[]>;
|
|
756
873
|
toArray: () => Row[];
|
|
757
874
|
}
|
|
758
875
|
type IndexUseHook = (table: string, indexName: string, kind: "geo" | "index" | "rank" | "search") => void;
|
|
@@ -768,6 +885,7 @@ interface WriteEvent {
|
|
|
768
885
|
type WriteHook = (event: WriteEvent) => Promise<void> | void;
|
|
769
886
|
interface CtxDbOptions {
|
|
770
887
|
auth?: ServerDefaultContextLike["auth"];
|
|
888
|
+
baselineSeq?: () => number | undefined;
|
|
771
889
|
broadcast?: BroadcastDelta;
|
|
772
890
|
cache?: ReactiveCache;
|
|
773
891
|
cdc?: boolean;
|
|
@@ -776,10 +894,16 @@ interface CtxDbOptions {
|
|
|
776
894
|
globalDb?: DatabaseWriterLike;
|
|
777
895
|
headroom?: TransactionHeadroomTracker;
|
|
778
896
|
idGenerator?: IdGenerator;
|
|
897
|
+
inTransaction?: () => boolean;
|
|
779
898
|
maxRelationKeys?: number;
|
|
780
899
|
onIndexUse?: IndexUseHook;
|
|
781
900
|
onRead?: ReadHook;
|
|
782
901
|
onReadRange?: (range: KeyRange) => void;
|
|
902
|
+
onStalePatchDropped?: (event: {
|
|
903
|
+
fields: string[];
|
|
904
|
+
id: string;
|
|
905
|
+
table: string;
|
|
906
|
+
}) => void;
|
|
783
907
|
onWrite?: WriteHook;
|
|
784
908
|
relationExistsPushDown?: "always" | "auto" | "never";
|
|
785
909
|
scheduler?: SchedulerLike;
|
|
@@ -792,6 +916,8 @@ declare class NotUniqueError extends LunoraError {
|
|
|
792
916
|
constructor(message?: string);
|
|
793
917
|
}
|
|
794
918
|
declare const normalizeIdStructurally: (schema: SchemaLike, tableName: string, id: string) => null | string;
|
|
919
|
+
declare const assertNoExplicitUndefined: (op: "patch" | "replace", document: Record<string, unknown>) => void;
|
|
920
|
+
declare const stripReservedPatchFields: (patch: Record<string, unknown>) => Record<string, unknown>;
|
|
795
921
|
declare const createShardCtxDb: (options: CtxDbOptions) => DatabaseWriterLike;
|
|
796
922
|
declare const AUDIT_LOG_TABLE = "__lunora_audit__";
|
|
797
923
|
interface AuditEntry {
|
|
@@ -815,68 +941,23 @@ declare const readAuditLog: (sql: SqlExec, options?: {
|
|
|
815
941
|
limit?: number;
|
|
816
942
|
sinceSeq?: number;
|
|
817
943
|
}) => AuditEntry[];
|
|
818
|
-
interface
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
id: string;
|
|
836
|
-
query?: SubscriptionQuery;
|
|
837
|
-
shape?: {
|
|
838
|
-
args?: Record<string, unknown>;
|
|
839
|
-
name: string;
|
|
840
|
-
};
|
|
841
|
-
sinceCheckpoint?: number;
|
|
842
|
-
sinceEpoch?: string;
|
|
843
|
-
topic?: string;
|
|
844
|
-
type: "ack" | "connect" | "shape_subscribe" | "shape_unsubscribe" | "stream" | "subscribe" | "unsubscribe" | "whisper" | "whisper_subscribe" | "whisper_unsubscribe";
|
|
845
|
-
}
|
|
846
|
-
interface RpcRequest {
|
|
847
|
-
args?: Record<string, unknown>;
|
|
848
|
-
functionPath: string;
|
|
849
|
-
}
|
|
850
|
-
interface SocketAttachment {
|
|
851
|
-
admin?: boolean;
|
|
852
|
-
clientId?: string;
|
|
853
|
-
connected?: boolean;
|
|
854
|
-
connectionId?: string;
|
|
855
|
-
context?: Record<string, unknown>;
|
|
856
|
-
expiresAt?: number;
|
|
857
|
-
identity?: Record<string, unknown>;
|
|
858
|
-
shapes?: Record<string, ShapeSubscriptionQuery>;
|
|
859
|
-
subs: Record<string, SubscriptionQuery>;
|
|
860
|
-
userId?: string;
|
|
861
|
-
whispers?: string[];
|
|
862
|
-
}
|
|
863
|
-
interface ResolvedShape {
|
|
864
|
-
columns?: ReadonlyArray<string>;
|
|
865
|
-
effectiveWhere?: WhereInput;
|
|
866
|
-
global?: boolean;
|
|
867
|
-
table: string;
|
|
868
|
-
}
|
|
869
|
-
interface SubscriptionIdentity {
|
|
870
|
-
identity?: Record<string, unknown>;
|
|
871
|
-
userId?: string;
|
|
872
|
-
}
|
|
873
|
-
interface ShardSocketLike {
|
|
874
|
-
readonly bufferedAmount?: number;
|
|
875
|
-
close?: (code?: number, reason?: string) => void;
|
|
876
|
-
deserializeAttachment?: () => unknown;
|
|
877
|
-
send: (data: string) => void;
|
|
878
|
-
serializeAttachment?: (value: unknown) => void;
|
|
879
|
-
}
|
|
944
|
+
interface CdcArchiveScope {
|
|
945
|
+
epoch: string;
|
|
946
|
+
shard: string;
|
|
947
|
+
}
|
|
948
|
+
declare const readCdcArchivedThrough: (sql: SqlExec) => number;
|
|
949
|
+
declare const writeCdcArchivedThrough: (sql: SqlExec, seq: number) => void;
|
|
950
|
+
declare const archiveCdcSegment: (bucket: R2BucketLike, scope: CdcArchiveScope, changes: CdcChange[]) => Promise<void>;
|
|
951
|
+
declare const cdcArchiveRewound: (bucket: R2BucketLike, scope: CdcArchiveScope, archivedThrough: number) => Promise<boolean>;
|
|
952
|
+
declare const readArchivedCdcChanges: (bucket: R2BucketLike, scope: CdcArchiveScope, sinceSeq: number, limit: number | undefined) => Promise<{
|
|
953
|
+
changes: CdcChange[];
|
|
954
|
+
cursor: number;
|
|
955
|
+
} | undefined>;
|
|
956
|
+
declare const COMMIT_SEQ_TABLE = "__commit_seq";
|
|
957
|
+
declare const COMMIT_SEQ_FIELD = "_commitSeq";
|
|
958
|
+
declare const migrateCommitSeq: (sql: SqlExec) => void;
|
|
959
|
+
declare const readCommitSeq: (sql: SqlExec) => number;
|
|
960
|
+
declare const allocateCommitSeq: (sql: SqlExec) => number;
|
|
880
961
|
interface CompanionSyncDeps {
|
|
881
962
|
broadcast: (delta: MutationDelta) => void;
|
|
882
963
|
indexKeysFor: (table: string, document?: Record<string, unknown>) => ReadonlyArray<{
|
|
@@ -900,6 +981,19 @@ interface CompanionSync {
|
|
|
900
981
|
syncSearch: (tableName: string, id: string, document: Record<string, unknown> | undefined, previous?: Record<string, unknown>) => void;
|
|
901
982
|
}
|
|
902
983
|
declare const createCompanionSync: (deps: CompanionSyncDeps) => CompanionSync;
|
|
984
|
+
declare const GLOBAL_SHAPE_SNAPSHOT_TABLE = "__global_shape_snapshot";
|
|
985
|
+
declare const migrateGlobalShapeSnapshot: (sql: SqlExec) => void;
|
|
986
|
+
declare const readGlobalShapeSnapshot: (sql: SqlExec, connectionId: string, subId: string) => Map<string, string> | undefined;
|
|
987
|
+
declare const writeGlobalShapeSnapshot: (sql: SqlExec, connectionId: string, subId: string, snapshot: Map<string, string>) => void;
|
|
988
|
+
declare const deleteGlobalShapeSnapshot: (sql: SqlExec, connectionId: string, subId: string) => void;
|
|
989
|
+
declare const deleteGlobalShapeSnapshotsForConnection: (sql: SqlExec, connectionId: string) => void;
|
|
990
|
+
declare const isMemoryTable: (definition: TableDefinitionLike | undefined) => boolean;
|
|
991
|
+
declare const memoryTableNames: (schema: SchemaLike) => string[];
|
|
992
|
+
declare const clearMemoryTables: (sql: SqlExec, schema: SchemaLike) => number;
|
|
993
|
+
declare const resolveRankSeekTuple: (options: {
|
|
994
|
+
after?: RankPageRowKey;
|
|
995
|
+
cursor?: null | string;
|
|
996
|
+
}) => unknown[] | undefined;
|
|
903
997
|
interface RankPageDeps {
|
|
904
998
|
assertRankPartitionLocal: (tableName: string, definition: TableDefinitionLike, index: RankIndexDefinitionLike) => void;
|
|
905
999
|
ensureRankBackfilled: (tableName: string, index: RankIndexDefinitionLike) => void;
|
|
@@ -917,8 +1011,67 @@ interface RankPageComputation {
|
|
|
917
1011
|
key: RankPageRowKey;
|
|
918
1012
|
}[];
|
|
919
1013
|
}
|
|
920
|
-
declare const hydrateDocsById: (deps: RankPageDeps, tableName: string, ids: ReadonlyArray<string>) => Map<string, Record<string, unknown>>;
|
|
921
1014
|
declare const computeRankPage: (deps: RankPageDeps, tableName: string, indexName: string, rankPageOptions: RankPageOptions) => RankPageComputation;
|
|
1015
|
+
declare const SCHEDULE_OUTBOX_TABLE = "__schedule_outbox";
|
|
1016
|
+
interface ScheduleOutboxRow {
|
|
1017
|
+
attempts: number;
|
|
1018
|
+
envelopeJson: string;
|
|
1019
|
+
id: string;
|
|
1020
|
+
nextAttemptAt: number;
|
|
1021
|
+
}
|
|
1022
|
+
interface ScheduleOutboxEnvelope {
|
|
1023
|
+
args: unknown;
|
|
1024
|
+
options: Record<string, unknown> | undefined;
|
|
1025
|
+
target: unknown;
|
|
1026
|
+
when: number;
|
|
1027
|
+
}
|
|
1028
|
+
interface ScheduleOutbox {
|
|
1029
|
+
forget: (id: string) => void;
|
|
1030
|
+
record: (id: string, envelope: ScheduleOutboxEnvelope) => void;
|
|
1031
|
+
wake: () => void;
|
|
1032
|
+
}
|
|
1033
|
+
declare const migrateScheduleOutbox: (sql: SqlExec) => void;
|
|
1034
|
+
declare const recordScheduleOutbox: (sql: SqlExec, id: string, envelopeJson: string, now: number) => void;
|
|
1035
|
+
declare const forgetScheduleOutbox: (sql: SqlExec, id: string) => void;
|
|
1036
|
+
declare const readDueScheduleOutbox: (sql: SqlExec, nowMs: number, limit: number) => ScheduleOutboxRow[];
|
|
1037
|
+
declare const deferScheduleOutbox: (sql: SqlExec, id: string, attempts: number, nextAttemptAt: number) => void;
|
|
1038
|
+
declare const parkScheduleOutbox: (sql: SqlExec, id: string, attempts: number) => void;
|
|
1039
|
+
declare const probeScheduleOutbox: (sql: SqlExec) => {
|
|
1040
|
+
dueAt: number | undefined;
|
|
1041
|
+
populated: boolean;
|
|
1042
|
+
};
|
|
1043
|
+
declare const trimScheduleOutbox: (sql: SqlExec, olderThanTs: number) => void;
|
|
1044
|
+
/**
|
|
1045
|
+
* How far a companion's backfill has progressed, and under which analysis.
|
|
1046
|
+
* Declared here rather than beside either engine's state table: both record the
|
|
1047
|
+
* same three facts, and the decisions made from them are the shared policy
|
|
1048
|
+
* below.
|
|
1049
|
+
*/
|
|
1050
|
+
interface BackfillState {
|
|
1051
|
+
/** Last `id` indexed, or `undefined` when no page has run yet. */
|
|
1052
|
+
cursor: string | undefined;
|
|
1053
|
+
/** True once a page came back short — the table is fully indexed. */
|
|
1054
|
+
done: boolean;
|
|
1055
|
+
/** Analyzer profile the stored rows were built with; `undefined` predates profile tracking. */
|
|
1056
|
+
profile: string | undefined;
|
|
1057
|
+
}
|
|
1058
|
+
declare const SEARCH_STATE_TABLE = "__lunora_search_state";
|
|
1059
|
+
declare const migrateSearchState: (sql: SqlExec) => void;
|
|
1060
|
+
declare const readSearchBackfillState: (sql: SqlExec, companion: string) => BackfillState;
|
|
1061
|
+
declare const writeSearchBackfillState: (sql: SqlExec, companion: string, cursor: string | undefined, done: boolean, profile: string) => void;
|
|
1062
|
+
declare const SHAPE_POKE_CURSOR_TABLE = "__shape_poke_cursor";
|
|
1063
|
+
declare const migrateShapePokeCursor: (sql: SqlExec) => void;
|
|
1064
|
+
declare const readShapePokeCursor: (sql: SqlExec, connectionId: string, subId: string) => number | undefined;
|
|
1065
|
+
declare const writeShapePokeCursor: (sql: SqlExec, connectionId: string, subId: string, cursor: number) => void;
|
|
1066
|
+
interface ShapePokeCursorRow {
|
|
1067
|
+
connectionId: string;
|
|
1068
|
+
cursor: number;
|
|
1069
|
+
subId: string;
|
|
1070
|
+
}
|
|
1071
|
+
declare const writeShapePokeCursors: (sql: SqlExec, rows: ReadonlyArray<ShapePokeCursorRow>) => void;
|
|
1072
|
+
declare const minShapePokeCursor: (sql: SqlExec) => number | undefined;
|
|
1073
|
+
declare const deleteShapePokeCursor: (sql: SqlExec, connectionId: string, subId: string) => void;
|
|
1074
|
+
declare const deleteShapePokeCursorsForConnection: (sql: SqlExec, connectionId: string) => void;
|
|
922
1075
|
declare const DATA_MIGRATION_STATE_TABLE = "__lunora_migrations";
|
|
923
1076
|
type MigrationDirection = "down" | "up";
|
|
924
1077
|
type MigrationStatus = "completed" | "failed" | "in_progress";
|
|
@@ -982,10 +1135,10 @@ interface DependencyTracker {
|
|
|
982
1135
|
declare const createDependencyTracker: () => DependencyTracker;
|
|
983
1136
|
declare const runSql: <Row = Record<string, unknown>>(sql: SqlExec, query: string, ...params: unknown[]) => SqlCursor<Row>;
|
|
984
1137
|
declare const runDrizzle: <Row = Record<string, unknown>>(exec: SqlExec, query: SQL) => SqlCursor<Row>;
|
|
1138
|
+
declare const quoteIdentifier: (name: string) => string;
|
|
985
1139
|
declare const serializeSqlValue: (value: unknown) => unknown;
|
|
986
1140
|
declare const DOC_COLUMN = "__doc__";
|
|
987
1141
|
declare const geoTableName: (table: string, indexName: string) => string;
|
|
988
|
-
declare const quoteIdentifier: (name: string) => string;
|
|
989
1142
|
declare const jsonPath: (field: string) => string;
|
|
990
1143
|
declare const jsonPathSql: (field: string) => SQL;
|
|
991
1144
|
declare const qualifiedJsonPath: (table: string, field: string) => string;
|
|
@@ -995,10 +1148,16 @@ declare const AGG_KEY: Name;
|
|
|
995
1148
|
declare const AGG_VALUE: Name;
|
|
996
1149
|
declare const AGG_COUNT: Name;
|
|
997
1150
|
declare const aggUpsertSql: (aggTable: string, key: unknown, value: unknown, count: unknown, set: SQL) => SQL;
|
|
998
|
-
declare const tableColumns: (definition: TableDefinitionLike) => [string, ColumnMetaLike]
|
|
1151
|
+
declare const tableColumns: (definition: TableDefinitionLike) => ReadonlyArray<readonly [string, ColumnMetaLike]>;
|
|
999
1152
|
declare const rowToDocument: (row: Record<string, unknown> | undefined) => Record<string, unknown> | undefined;
|
|
1000
1153
|
declare const tryRowToDocument: (row: Record<string, unknown> | undefined) => Record<string, unknown> | undefined;
|
|
1001
1154
|
declare const isFtsAvailable: (sql: SqlExec) => boolean;
|
|
1155
|
+
declare const WORKERD_SQLITE_LIMITS: {
|
|
1156
|
+
readonly boundParams: 100;
|
|
1157
|
+
readonly compoundSelect: 5;
|
|
1158
|
+
readonly likePattern: 50;
|
|
1159
|
+
readonly sqlTextLength: 100000;
|
|
1160
|
+
};
|
|
1002
1161
|
type SqlEngine = "mysql" | "postgres" | "sqlite";
|
|
1003
1162
|
interface RenderedSql {
|
|
1004
1163
|
params: unknown[];
|
|
@@ -1006,6 +1165,79 @@ interface RenderedSql {
|
|
|
1006
1165
|
}
|
|
1007
1166
|
declare const renderSql: (engine: SqlEngine, query: SQL) => RenderedSql;
|
|
1008
1167
|
declare const param: (value: unknown) => SQL;
|
|
1168
|
+
declare const unionAll: (branches: ReadonlyArray<SQL>) => SQL;
|
|
1169
|
+
declare const sqliteInList: (reference: SQL, items: ReadonlyArray<unknown>, negated: boolean, budget?: number) => SQL;
|
|
1170
|
+
type DurableStreamStatus = "complete" | "error" | "running";
|
|
1171
|
+
interface DurableStreamRun {
|
|
1172
|
+
error?: string;
|
|
1173
|
+
errorCode?: string;
|
|
1174
|
+
lastSeq: number;
|
|
1175
|
+
startedAt: number;
|
|
1176
|
+
status: DurableStreamStatus;
|
|
1177
|
+
}
|
|
1178
|
+
interface DurableStreamChunk {
|
|
1179
|
+
dataJson: string;
|
|
1180
|
+
seq: number;
|
|
1181
|
+
}
|
|
1182
|
+
declare const migrateDurableStreams: (sql: SqlExec) => void;
|
|
1183
|
+
declare const readStreamRun: (sql: SqlExec, runKey: string) => DurableStreamRun | undefined;
|
|
1184
|
+
declare const claimStreamRun: (sql: SqlExec, runKey: string, startedAt: number, ttlMs: number) => boolean;
|
|
1185
|
+
declare const deleteStreamRun: (sql: SqlExec, runKey: string) => void;
|
|
1186
|
+
declare const appendStreamChunk: (sql: SqlExec, runKey: string, seq: number, dataJson: string) => void;
|
|
1187
|
+
declare const readStreamChunks: (sql: SqlExec, runKey: string, sinceSeq: number) => DurableStreamChunk[];
|
|
1188
|
+
declare const finishStreamRun: (sql: SqlExec, runKey: string, status: "complete" | "error", lastSeq: number, failure?: {
|
|
1189
|
+
code: string;
|
|
1190
|
+
message: string;
|
|
1191
|
+
}) => void;
|
|
1192
|
+
declare const trimStreamRuns: (sql: SqlExec, now: number, live: ReadonlySet<string>) => void;
|
|
1193
|
+
declare const MAX_DURABLE_STREAM_CHUNKS = 50000;
|
|
1194
|
+
declare const MAX_DURABLE_STREAM_BYTES: number;
|
|
1195
|
+
interface DurableStreamSink {
|
|
1196
|
+
readonly chunk: (chunk: {
|
|
1197
|
+
data: unknown;
|
|
1198
|
+
generation?: number;
|
|
1199
|
+
seq: number;
|
|
1200
|
+
}) => boolean;
|
|
1201
|
+
readonly complete: () => void;
|
|
1202
|
+
readonly fail: (failure: {
|
|
1203
|
+
code: string;
|
|
1204
|
+
message: string;
|
|
1205
|
+
}) => void;
|
|
1206
|
+
}
|
|
1207
|
+
type DurableAttachDecision = "attach" | "interrupted" | "reclaim" | "replay-terminal";
|
|
1208
|
+
declare const decideDurableAttach: (run: DurableStreamRun | undefined, context: {
|
|
1209
|
+
generation?: number;
|
|
1210
|
+
live?: {
|
|
1211
|
+
generation: number;
|
|
1212
|
+
};
|
|
1213
|
+
resuming: boolean;
|
|
1214
|
+
}) => DurableAttachDecision;
|
|
1215
|
+
interface DurableStreamAttach {
|
|
1216
|
+
readonly generation?: number;
|
|
1217
|
+
readonly iterator: (signal: AbortSignal) => AsyncIterable<unknown>;
|
|
1218
|
+
readonly runKey: string;
|
|
1219
|
+
readonly sinceChunk: number;
|
|
1220
|
+
readonly sink: DurableStreamSink;
|
|
1221
|
+
readonly ttlMs?: number;
|
|
1222
|
+
}
|
|
1223
|
+
declare class DurableStreamRunner {
|
|
1224
|
+
private lastTrimAt;
|
|
1225
|
+
private readonly runs;
|
|
1226
|
+
private readonly sql;
|
|
1227
|
+
private readonly waitUntil;
|
|
1228
|
+
constructor(dependencies: {
|
|
1229
|
+
sql: () => SqlExec;
|
|
1230
|
+
waitUntil?: (promise: Promise<unknown>) => void;
|
|
1231
|
+
});
|
|
1232
|
+
attach(request: DurableStreamAttach): Promise<void>;
|
|
1233
|
+
detach(runKey: string, sink: DurableStreamSink): void;
|
|
1234
|
+
isLive(runKey: string): boolean;
|
|
1235
|
+
private attachOrThrow;
|
|
1236
|
+
private produce;
|
|
1237
|
+
private trim;
|
|
1238
|
+
}
|
|
1239
|
+
declare const envPositiveInt: (env: unknown, key: string, fallback: number) => number;
|
|
1240
|
+
declare const envOptionalPositiveInt: (env: unknown, key: string) => number | undefined;
|
|
1009
1241
|
interface ExternalSourceDiffResult {
|
|
1010
1242
|
changes: CdcChange[];
|
|
1011
1243
|
nextBaseline: Map<string, string>;
|
|
@@ -1070,6 +1302,16 @@ declare const isSoftDeleted: (row: Record<string, unknown>, column: string) => b
|
|
|
1070
1302
|
declare const pullExternalSourceIncrementalTick: (sql: SqlExec, writer: DatabaseWriterLike, client: SourceClientLike, table: string, source: ExternalSourceLike, shardKey: string, nowMs: number) => Promise<{
|
|
1071
1303
|
applied: number;
|
|
1072
1304
|
}>;
|
|
1305
|
+
declare const ftsRowidMapName: (companion: string) => string;
|
|
1306
|
+
interface FtsWriteOptions {
|
|
1307
|
+
guard?: SQL;
|
|
1308
|
+
unmappedRowids?: ReadonlyArray<number>;
|
|
1309
|
+
}
|
|
1310
|
+
declare const ftsCompanionDdl: (companion: string) => SQL[];
|
|
1311
|
+
declare const ftsWriteDocument: (companion: string, id: string, text: string, options?: FtsWriteOptions) => SQL[];
|
|
1312
|
+
declare const ftsPurgeDocument: (companion: string, id: string, options?: FtsWriteOptions) => SQL[];
|
|
1313
|
+
declare const ftsUnmappedPage: (companion: string, limit: number, after?: number) => SQL;
|
|
1314
|
+
declare const groupUnmappedRows: (rows: ReadonlyArray<Record<string, unknown>>) => Map<string, number[]>;
|
|
1073
1315
|
declare const GEO_DEFAULT_PRECISION = 9;
|
|
1074
1316
|
interface GeoPoint {
|
|
1075
1317
|
lat: number;
|
|
@@ -1085,6 +1327,20 @@ declare const coveringGeohashes: (center: GeoPoint, radiusMeters: number) => str
|
|
|
1085
1327
|
declare const pointInBoundingBox: (point: GeoPoint, box: GeoBoundingBox) => boolean;
|
|
1086
1328
|
declare const boundingBoxCenter: (box: GeoBoundingBox) => GeoPoint;
|
|
1087
1329
|
declare const boundingBoxGeohashes: (box: GeoBoundingBox) => string[];
|
|
1330
|
+
declare class GlobalPollTick {
|
|
1331
|
+
private readonly changedTables;
|
|
1332
|
+
private readonly reads;
|
|
1333
|
+
private resync;
|
|
1334
|
+
private skippedCount;
|
|
1335
|
+
constructor(changedTables?: Set<string>);
|
|
1336
|
+
get readCount(): number;
|
|
1337
|
+
get resyncRequested(): boolean;
|
|
1338
|
+
get skipped(): number;
|
|
1339
|
+
requestResync(): void;
|
|
1340
|
+
rows(key: string | undefined, load: () => Promise<ShapeRow[]>): Promise<ShapeRow[]>;
|
|
1341
|
+
shouldRead(table: string): boolean;
|
|
1342
|
+
}
|
|
1343
|
+
declare const isInternalTableName: (name: string) => boolean;
|
|
1088
1344
|
declare const ADMIN_FUNCTION_PREFIX = "__lunora_admin__:";
|
|
1089
1345
|
declare const RELATION_FUNCTION_PREFIX = "__lunora_relation__:";
|
|
1090
1346
|
declare const FLAGS_FUNCTION_PREFIX = "__lunora_flags__:";
|
|
@@ -1095,6 +1351,8 @@ declare const ADMIN_FUNCTIONS: {
|
|
|
1095
1351
|
readonly aiGenerateSql: "__lunora_admin__:aiGenerateSql";
|
|
1096
1352
|
readonly aiTableFilter: "__lunora_admin__:aiTableFilter";
|
|
1097
1353
|
readonly assignIssue: "__lunora_admin__:assignIssue";
|
|
1354
|
+
readonly backfillSearch: "__lunora_admin__:backfillSearch";
|
|
1355
|
+
readonly backfillVectors: "__lunora_admin__:backfillVectors";
|
|
1098
1356
|
readonly backRelationCounts: "__lunora_admin__:backRelationCounts";
|
|
1099
1357
|
readonly cdcSync: "__lunora_admin__:cdcSync";
|
|
1100
1358
|
readonly clearCapturedMail: "__lunora_admin__:clearCapturedMail";
|
|
@@ -1107,6 +1365,7 @@ declare const ADMIN_FUNCTIONS: {
|
|
|
1107
1365
|
readonly explainIssue: "__lunora_admin__:explainIssue";
|
|
1108
1366
|
readonly exportShard: "__lunora_admin__:exportShard";
|
|
1109
1367
|
readonly facetColumn: "__lunora_admin__:facetColumn";
|
|
1368
|
+
readonly findRelated: "__lunora_admin__:findRelated";
|
|
1110
1369
|
readonly getAdvisories: "__lunora_admin__:getAdvisories";
|
|
1111
1370
|
readonly getAdvisorProcedures: "__lunora_admin__:getAdvisorProcedures";
|
|
1112
1371
|
readonly getAuditLog: "__lunora_admin__:getAuditLog";
|
|
@@ -1133,12 +1392,14 @@ declare const ADMIN_FUNCTIONS: {
|
|
|
1133
1392
|
readonly ignoreIssue: "__lunora_admin__:ignoreIssue";
|
|
1134
1393
|
readonly importShard: "__lunora_admin__:importShard";
|
|
1135
1394
|
readonly listFlags: "__lunora_admin__:listFlags";
|
|
1395
|
+
readonly listReactors: "__lunora_admin__:listReactors";
|
|
1136
1396
|
readonly listQueues: "__lunora_admin__:listQueues";
|
|
1137
1397
|
readonly lintSql: "__lunora_admin__:lintSql";
|
|
1138
1398
|
readonly listTables: "__lunora_admin__:listTables";
|
|
1139
1399
|
readonly listWorkflows: "__lunora_admin__:listWorkflows";
|
|
1140
1400
|
readonly maskPolicies: "__lunora_admin__:maskPolicies";
|
|
1141
1401
|
readonly migrationStatus: "__lunora_admin__:migrationStatus";
|
|
1402
|
+
readonly patchRows: "__lunora_admin__:patchRows";
|
|
1142
1403
|
readonly pitrRestore: "__lunora_admin__:pitrRestore";
|
|
1143
1404
|
readonly rankBefore: "__lunora_admin__:rankBefore";
|
|
1144
1405
|
readonly rankPage: "__lunora_admin__:rankPage";
|
|
@@ -1147,6 +1408,7 @@ declare const ADMIN_FUNCTIONS: {
|
|
|
1147
1408
|
readonly recordContainerEvent: "__lunora_admin__:recordContainerEvent";
|
|
1148
1409
|
readonly recordMail: "__lunora_admin__:recordMail";
|
|
1149
1410
|
readonly recordQueueMessage: "__lunora_admin__:recordQueueMessage";
|
|
1411
|
+
readonly releaseShardRegistration: "__lunora_admin__:releaseShardRegistration";
|
|
1150
1412
|
readonly replayQueueMessage: "__lunora_admin__:replayQueueMessage";
|
|
1151
1413
|
readonly resolveIssue: "__lunora_admin__:resolveIssue";
|
|
1152
1414
|
readonly rlsPolicies: "__lunora_admin__:rlsPolicies";
|
|
@@ -1216,8 +1478,12 @@ interface TablesIndexesResult {
|
|
|
1216
1478
|
indexesByTable: Record<string, TableIndexInfo[]>;
|
|
1217
1479
|
}
|
|
1218
1480
|
interface ColumnMeta {
|
|
1481
|
+
bucket?: string;
|
|
1482
|
+
enumValues?: string[];
|
|
1219
1483
|
isStorage?: boolean;
|
|
1220
1484
|
name: string;
|
|
1485
|
+
nullable?: boolean;
|
|
1486
|
+
onDelete?: "cascade" | "restrict" | "set null";
|
|
1221
1487
|
optional: boolean;
|
|
1222
1488
|
pk?: boolean;
|
|
1223
1489
|
ref?: string;
|
|
@@ -1314,6 +1580,11 @@ interface StudioFeaturesResult {
|
|
|
1314
1580
|
mail: boolean;
|
|
1315
1581
|
notifications: boolean;
|
|
1316
1582
|
payments: boolean;
|
|
1583
|
+
platform?: {
|
|
1584
|
+
id: string;
|
|
1585
|
+
name: string;
|
|
1586
|
+
unsupported: string[];
|
|
1587
|
+
};
|
|
1317
1588
|
queues: boolean;
|
|
1318
1589
|
scheduler: boolean;
|
|
1319
1590
|
storage: boolean;
|
|
@@ -1332,6 +1603,19 @@ interface FlagsResult {
|
|
|
1332
1603
|
configured: boolean;
|
|
1333
1604
|
flags: FlagEvaluation[];
|
|
1334
1605
|
}
|
|
1606
|
+
interface ReactorMetadata {
|
|
1607
|
+
errors: number;
|
|
1608
|
+
lastError?: string;
|
|
1609
|
+
lastRanAt?: number;
|
|
1610
|
+
path: string;
|
|
1611
|
+
runs: number;
|
|
1612
|
+
state: "active" | "failing" | "idle";
|
|
1613
|
+
suppressed: number;
|
|
1614
|
+
tables?: ReadonlyArray<string>;
|
|
1615
|
+
}
|
|
1616
|
+
interface ReactorsResult {
|
|
1617
|
+
reactors: ReactorMetadata[];
|
|
1618
|
+
}
|
|
1335
1619
|
interface WorkflowMetadata {
|
|
1336
1620
|
binding: string;
|
|
1337
1621
|
className: string;
|
|
@@ -1390,8 +1674,10 @@ interface TablePage {
|
|
|
1390
1674
|
columns: string[];
|
|
1391
1675
|
refs?: Record<string, string>;
|
|
1392
1676
|
rows: Record<string, unknown>[];
|
|
1677
|
+
sqlColumns: string[];
|
|
1393
1678
|
total?: number;
|
|
1394
1679
|
}
|
|
1680
|
+
type ColumnKinds = Readonly<Record<string, string>>;
|
|
1395
1681
|
type FilterOperator = "contains" | "eq" | "gt" | "gte" | "lt" | "lte" | "ne";
|
|
1396
1682
|
interface FilterClause {
|
|
1397
1683
|
column: string;
|
|
@@ -1403,6 +1689,7 @@ interface OrderByClause {
|
|
|
1403
1689
|
direction: SortDirection;
|
|
1404
1690
|
}
|
|
1405
1691
|
interface ReadTablePageOptions {
|
|
1692
|
+
columnKinds?: ColumnKinds;
|
|
1406
1693
|
filters?: FilterClause[];
|
|
1407
1694
|
limit?: number;
|
|
1408
1695
|
offset?: number;
|
|
@@ -1413,6 +1700,8 @@ interface ReadTablePageOptions {
|
|
|
1413
1700
|
table: string;
|
|
1414
1701
|
}
|
|
1415
1702
|
interface SelectMatchingIdsOptions {
|
|
1703
|
+
after?: string;
|
|
1704
|
+
columnKinds?: ColumnKinds;
|
|
1416
1705
|
filters?: FilterClause[];
|
|
1417
1706
|
limit?: number;
|
|
1418
1707
|
search?: string;
|
|
@@ -1420,6 +1709,7 @@ interface SelectMatchingIdsOptions {
|
|
|
1420
1709
|
}
|
|
1421
1710
|
interface FacetColumnOptions {
|
|
1422
1711
|
column: string;
|
|
1712
|
+
columnKinds?: ColumnKinds;
|
|
1423
1713
|
filters?: FilterClause[];
|
|
1424
1714
|
limit?: number;
|
|
1425
1715
|
search?: string;
|
|
@@ -1435,6 +1725,7 @@ interface FacetColumnResult {
|
|
|
1435
1725
|
}
|
|
1436
1726
|
declare const MAX_PAGE_SIZE = 500;
|
|
1437
1727
|
declare const listTables: (sql: SqlExec) => TableInfo[];
|
|
1728
|
+
declare const isVacuousFilterClause: (clause: FilterClause) => boolean;
|
|
1438
1729
|
declare const readTablePage: (sql: SqlExec, options: ReadTablePageOptions) => TablePage;
|
|
1439
1730
|
declare const selectMatchingIds: (sql: SqlExec, options: SelectMatchingIdsOptions) => {
|
|
1440
1731
|
hasMore: boolean;
|
|
@@ -1469,12 +1760,22 @@ interface FanoutPathCounters {
|
|
|
1469
1760
|
socketsIterated: number;
|
|
1470
1761
|
totalMs: number;
|
|
1471
1762
|
}
|
|
1763
|
+
interface ShapeProbeCounters {
|
|
1764
|
+
run: number;
|
|
1765
|
+
served: number;
|
|
1766
|
+
}
|
|
1767
|
+
interface GlobalPollCounters {
|
|
1768
|
+
drains: number;
|
|
1769
|
+
pairsSkipped: number;
|
|
1770
|
+
}
|
|
1472
1771
|
interface FanoutMetricsResult {
|
|
1772
|
+
globalPoll: GlobalPollCounters;
|
|
1473
1773
|
maxRelays: number;
|
|
1474
1774
|
peakSubscribers: number;
|
|
1475
1775
|
promoted: boolean;
|
|
1476
1776
|
relayCount: number;
|
|
1477
1777
|
shapePoke: FanoutPathCounters;
|
|
1778
|
+
shapeProbe: ShapeProbeCounters;
|
|
1478
1779
|
sinceMs: number;
|
|
1479
1780
|
topics: FanoutTopicStat[];
|
|
1480
1781
|
totalConnections: number;
|
|
@@ -1488,6 +1789,10 @@ interface FanoutAttachmentLike {
|
|
|
1488
1789
|
}
|
|
1489
1790
|
declare const DEFAULT_FANOUT_TOPIC_LIMIT = 20;
|
|
1490
1791
|
declare const createFanoutCounters: () => FanoutPathCounters;
|
|
1792
|
+
declare const createShapeProbeCounters: () => ShapeProbeCounters;
|
|
1793
|
+
declare const createGlobalPollCounters: () => GlobalPollCounters;
|
|
1794
|
+
declare const recordGlobalPollPass: (counters: GlobalPollCounters, drains: number, pairsSkipped: number) => GlobalPollCounters;
|
|
1795
|
+
declare const recordShapeProbePass: (counters: ShapeProbeCounters, run: number, served: number) => ShapeProbeCounters;
|
|
1491
1796
|
declare const recordFanoutPass: (counters: FanoutPathCounters, iterated: number, delivered: number, ms: number) => FanoutPathCounters;
|
|
1492
1797
|
declare const summarizeFanoutTopics: (attachments: FanoutAttachmentLike[], limit?: number) => {
|
|
1493
1798
|
peakSubscribers: number;
|
|
@@ -1556,7 +1861,20 @@ interface PitrRestoreArgs {
|
|
|
1556
1861
|
}
|
|
1557
1862
|
declare const readBookmark: (storage: PitrStorage, time?: number | string) => Promise<PitrBookmarkResult>;
|
|
1558
1863
|
declare const armRestore: (storage: PitrStorage, args: PitrRestoreArgs) => Promise<Omit<PitrRestoreResult, "restarted">>;
|
|
1559
|
-
declare const
|
|
1864
|
+
declare const tiebreakDirectionFor: (keys: ReadonlyArray<{
|
|
1865
|
+
direction?: string;
|
|
1866
|
+
}>) => SortDirection;
|
|
1867
|
+
declare const equalityPinnedFields: (where: undefined | WhereInput) => ReadonlySet<string>;
|
|
1868
|
+
declare const uniqueIndexFields: (indexes: ReadonlyArray<{
|
|
1869
|
+
fields: ReadonlyArray<string>;
|
|
1870
|
+
unique?: boolean;
|
|
1871
|
+
}> | undefined, shape: Record<string, ValidatorLike> | undefined) => ReadonlyArray<ReadonlyArray<string>>;
|
|
1872
|
+
interface OrderKeyConstraints {
|
|
1873
|
+
pinned?: ReadonlySet<string>;
|
|
1874
|
+
uniqueBy?: ReadonlyArray<ReadonlyArray<string>>;
|
|
1875
|
+
}
|
|
1876
|
+
declare const normalizeOrderKeys: (orderBy: OrderByInput[] | undefined, shape?: Record<string, ValidatorLike>, constraints?: OrderKeyConstraints) => OrderKey[];
|
|
1877
|
+
declare const CURSOR_PREFIX = "~4";
|
|
1560
1878
|
declare const encodeCursor: (record: Record<string, unknown>, keys: OrderKey[]) => string;
|
|
1561
1879
|
declare const decodeCursor: (cursor: string) => unknown[];
|
|
1562
1880
|
declare const buildSeekWhere: (keys: OrderKey[], cursorValues: unknown[]) => WhereInput;
|
|
@@ -1609,7 +1927,6 @@ declare const clearQueueMessages: (sql: SqlExec) => {
|
|
|
1609
1927
|
declare const encodePartitionKey: (partitionBy: ReadonlyArray<string>, source: Record<string, unknown>) => string;
|
|
1610
1928
|
declare const RANK_TIEBREAK = "__id__";
|
|
1611
1929
|
declare const sortColumnName: (i: number) => string;
|
|
1612
|
-
declare const matchesRankStaticWhere: (document: Record<string, unknown>, predicate: Record<string, unknown>) => boolean;
|
|
1613
1930
|
declare const resolveRankPartition: (index: RankIndexDefinitionLike, where: Record<string, unknown> | undefined) => Record<string, unknown> | undefined;
|
|
1614
1931
|
declare const rankTableName: (table: string, indexName: string) => string;
|
|
1615
1932
|
declare const rankKeyFromDocument: (index: RankIndexDefinitionLike, document_: Record<string, unknown>) => {
|
|
@@ -1617,6 +1934,36 @@ declare const rankKeyFromDocument: (index: RankIndexDefinitionLike, document_: R
|
|
|
1617
1934
|
rowId: string;
|
|
1618
1935
|
sortValues: unknown[];
|
|
1619
1936
|
};
|
|
1937
|
+
declare const rankPivotConditionSql: (column: string, value: unknown, direction: "asc" | "desc", wantLater: boolean) => SQL | undefined;
|
|
1938
|
+
declare const matchesRankStaticWhere: (document: Record<string, unknown>, predicate: Record<string, unknown>) => boolean;
|
|
1939
|
+
declare const REACTOR_STATE_TABLE = "__reactor_state";
|
|
1940
|
+
interface ReactorState {
|
|
1941
|
+
digest: string;
|
|
1942
|
+
lastError?: string;
|
|
1943
|
+
lastRanAt: number;
|
|
1944
|
+
stats: ReactorStats;
|
|
1945
|
+
tables?: ReadonlyArray<string>;
|
|
1946
|
+
}
|
|
1947
|
+
interface ReactorStats {
|
|
1948
|
+
errors: number;
|
|
1949
|
+
runs: number;
|
|
1950
|
+
suppressed: number;
|
|
1951
|
+
}
|
|
1952
|
+
declare const migrateReactorState: (sql: SqlExec) => void;
|
|
1953
|
+
declare const readReactorState: (sql: SqlExec, path: string) => ReactorState | undefined;
|
|
1954
|
+
declare const listReactorStates: (sql: SqlExec) => {
|
|
1955
|
+
path: string;
|
|
1956
|
+
state: ReactorState;
|
|
1957
|
+
}[];
|
|
1958
|
+
type ReactorDispatchResult = "error" | "ran" | "suppressed";
|
|
1959
|
+
declare const writeReactorState: (sql: SqlExec, path: string, outcome: {
|
|
1960
|
+
digest?: string;
|
|
1961
|
+
error?: string;
|
|
1962
|
+
now: number;
|
|
1963
|
+
result: ReactorDispatchResult;
|
|
1964
|
+
tables?: ReadonlyArray<string>;
|
|
1965
|
+
}) => void;
|
|
1966
|
+
declare const reactorNeedsRun: (state: Pick<ReactorState, "tables"> | undefined, changed: ReadonlySet<string>) => boolean;
|
|
1620
1967
|
interface ReadFootprint {
|
|
1621
1968
|
onRead: (table: string, idOrScan?: string) => void;
|
|
1622
1969
|
onReadRange: (range: KeyRange) => void;
|
|
@@ -1624,6 +1971,23 @@ interface ReadFootprint {
|
|
|
1624
1971
|
tables: Set<string>;
|
|
1625
1972
|
}
|
|
1626
1973
|
declare const createReadFootprint: () => ReadFootprint;
|
|
1974
|
+
declare const UNVOUCHABLE_DEP = "!unvouchable";
|
|
1975
|
+
declare const markUnvouchableReads: <T extends object>(facade: T, onRead: ReadFootprint["onRead"] | undefined, methods: ReadonlyArray<string>) => T;
|
|
1976
|
+
declare const WHERE_FILTER: unique symbol;
|
|
1977
|
+
type RowPredicate = (document: Record<string, unknown>) => boolean;
|
|
1978
|
+
type WhereFilter = RowPredicate & {
|
|
1979
|
+
readonly [WHERE_FILTER]: WhereInput;
|
|
1980
|
+
};
|
|
1981
|
+
declare const whereFilter: (where: WhereInput, predicate: RowPredicate) => WhereFilter;
|
|
1982
|
+
declare const whereOfFilter: (predicate: RowPredicate) => undefined | WhereInput;
|
|
1983
|
+
declare const isPushableWhere: (where: WhereInput, shape: Readonly<Record<string, ValidatorLike>>, exactText?: boolean) => boolean;
|
|
1984
|
+
declare const RELATED_MAX_DEPTH = 4;
|
|
1985
|
+
declare const RELATED_DEFAULT_LIMIT = 50;
|
|
1986
|
+
declare const RELATED_MAX_LIMIT = 200;
|
|
1987
|
+
declare const RELATED_DEPTH_DECAY = 0.5;
|
|
1988
|
+
declare const deriveRelationEdges: (schema: SchemaLike) => RelationEdge[];
|
|
1989
|
+
type RelationGraphReader = Pick<DatabaseWriterLike, "findMany"> & Pick<Partial<DatabaseWriterLike>, "lookupById">;
|
|
1990
|
+
declare const findRelated: (reader: RelationGraphReader, edges: ReadonlyArray<RelationEdge>, start: RelatedStart, options?: RelatedOptions) => Promise<RelatedPage>;
|
|
1627
1991
|
declare const DEFAULT_MAX_RELATION_KEYS = 5000;
|
|
1628
1992
|
interface RelationExistsMarker {
|
|
1629
1993
|
childWhere: WhereInput;
|
|
@@ -1658,6 +2022,7 @@ declare const containsRelationPredicate: (where: WhereInput, schema: ResolveCont
|
|
|
1658
2022
|
declare const assertFlatPredicate: (where: WhereInput | undefined, schema: ResolveContext["schema"], tableName: string, op: string) => void;
|
|
1659
2023
|
declare const resolveRelationPredicates: (where: WhereInput | undefined, options: ResolveRelationPredicatesOptions) => Promise<WhereInput | undefined>;
|
|
1660
2024
|
declare const assertShapeShardable: (effectiveWhere: WhereInput | undefined, schema: ResolveContext["schema"], table: string) => void;
|
|
2025
|
+
declare const relationHooks: (args: Pick<QueryArgs, "relationBaseWhere" | "relationMask">) => Pick<QueryArgs, "relationBaseWhere" | "relationMask"> & Pick<ResolveWithOptions, "fanOutBudget">;
|
|
1661
2026
|
declare const fanOutScalarCounts: (counter: (tableName: string, where?: WhereInput) => Promise<number>, tableName: string, whereField: string, values: unknown[], policyWhere: WhereInput | undefined) => Promise<Map<unknown, number>>;
|
|
1662
2027
|
declare const distinctValues: (rows: Record<string, unknown>[], field: string) => unknown[];
|
|
1663
2028
|
declare const resolveWith: (options: ResolveWithOptions) => Promise<void>;
|
|
@@ -1682,6 +2047,8 @@ interface ShapeRowOp {
|
|
|
1682
2047
|
value?: Record<string, unknown>;
|
|
1683
2048
|
}
|
|
1684
2049
|
interface ShapePokePart {
|
|
2050
|
+
baseCheckpoint?: number;
|
|
2051
|
+
reset?: boolean;
|
|
1685
2052
|
rowsPatch: ShapeRowOp[];
|
|
1686
2053
|
shapeId: string;
|
|
1687
2054
|
}
|
|
@@ -1742,6 +2109,12 @@ interface RelayShapeSubscribe {
|
|
|
1742
2109
|
type: "relay_shape_subscribe";
|
|
1743
2110
|
userId?: string;
|
|
1744
2111
|
}
|
|
2112
|
+
interface RelayShapeUnsubscribe {
|
|
2113
|
+
connectionId: string;
|
|
2114
|
+
relayIndex: number;
|
|
2115
|
+
subId?: string;
|
|
2116
|
+
type: "relay_shape_unsubscribe";
|
|
2117
|
+
}
|
|
1745
2118
|
interface RelayShapeSeed {
|
|
1746
2119
|
cursor?: number;
|
|
1747
2120
|
epoch?: string;
|
|
@@ -1761,22 +2134,19 @@ interface RelayShapePoke {
|
|
|
1761
2134
|
targetConnectionId?: string;
|
|
1762
2135
|
type: "relay_shape_poke";
|
|
1763
2136
|
}
|
|
1764
|
-
type OwnerRelayFrame = RelayAttach | RelayDetach | RelayFrame | RelayShapePoke | RelayShapeSubscribe;
|
|
1765
|
-
|
|
1766
|
-
interface RelayStub {
|
|
2137
|
+
type OwnerRelayFrame = RelayAttach | RelayDetach | RelayFrame | RelayShapePoke | RelayShapeSubscribe | RelayShapeUnsubscribe;
|
|
2138
|
+
interface SiblingStub {
|
|
1767
2139
|
fetch: (url: string, init?: RequestInit) => Promise<Response>;
|
|
1768
2140
|
}
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
getByName?: (name: string) => RelayStub;
|
|
1772
|
-
idFromName: (name: string) => unknown;
|
|
1773
|
-
}
|
|
2141
|
+
declare const stubByName: (value: unknown, name: string, jurisdiction?: string) => SiblingStub | undefined;
|
|
2142
|
+
declare const DEFAULT_MAX_RELAYS = 8;
|
|
1774
2143
|
interface RelayHost {
|
|
1775
2144
|
buildShapeDiff: (resolved: ResolvedShape, fromCursor: number, toCursor: number) => ShapeRowOp[];
|
|
1776
2145
|
computeOpLogShapeSeed: (shape: ShapeSubscriptionQuery, resolved: ResolvedShape) => {
|
|
1777
2146
|
baseCheckpoint: number | undefined;
|
|
1778
2147
|
cursor: number;
|
|
1779
2148
|
epoch: string | undefined;
|
|
2149
|
+
reset: boolean;
|
|
1780
2150
|
rowsPatch: ShapeRowOp[];
|
|
1781
2151
|
};
|
|
1782
2152
|
currentCdcEpoch: () => string | undefined;
|
|
@@ -1791,8 +2161,13 @@ interface RelayHost {
|
|
|
1791
2161
|
resolveShape: (name: string, args: Record<string, unknown>, identity?: SubscriptionIdentity) => ResolvedShape | undefined;
|
|
1792
2162
|
rlsMetadata: () => RlsPoliciesResult;
|
|
1793
2163
|
shardBinding: () => string | undefined;
|
|
2164
|
+
shardJurisdiction: () => string | undefined;
|
|
1794
2165
|
sql: () => SqlExec;
|
|
1795
2166
|
}
|
|
2167
|
+
interface RelayPokeDelivery {
|
|
2168
|
+
delivered: number;
|
|
2169
|
+
matched: number;
|
|
2170
|
+
}
|
|
1796
2171
|
declare abstract class RelayLink {
|
|
1797
2172
|
protected readonly host: RelayHost;
|
|
1798
2173
|
protected readonly roleId: {
|
|
@@ -1806,7 +2181,8 @@ declare abstract class RelayLink {
|
|
|
1806
2181
|
handleControl(request: Request): Promise<Response>;
|
|
1807
2182
|
maxRelays(): number;
|
|
1808
2183
|
protected canAddressSiblings(): boolean;
|
|
1809
|
-
protected
|
|
2184
|
+
protected siblingStub(targetName: string): SiblingStub | undefined;
|
|
2185
|
+
protected bindingName(): string | undefined;
|
|
1810
2186
|
protected postRelayMessage(targetName: string, message: OwnerRelayFrame): Promise<void>;
|
|
1811
2187
|
protected requestRelayMessage(targetName: string, message: OwnerRelayFrame): Promise<Response | undefined>;
|
|
1812
2188
|
abstract forwardWhisper(topic: string, frame: string): Promise<void>;
|
|
@@ -1817,19 +2193,22 @@ declare abstract class RelayLink {
|
|
|
1817
2193
|
}>;
|
|
1818
2194
|
abstract announce(): Promise<void>;
|
|
1819
2195
|
abstract announceDrain(closing: ShardSocketLike): Promise<void>;
|
|
2196
|
+
abstract releaseRelayShapes(ws: ShardSocketLike, subId?: string): Promise<void>;
|
|
1820
2197
|
abstract relayCount(): number;
|
|
1821
2198
|
abstract isShapeRelayUniform(name: string, args: Record<string, unknown>): boolean;
|
|
2199
|
+
abstract minShapeCursor(): number | undefined;
|
|
1822
2200
|
protected abstract onAttach(index: number): void;
|
|
1823
2201
|
protected abstract onDetach(index: number): void;
|
|
1824
2202
|
protected abstract onWhisperFrame(message: RelayFrame): Promise<void>;
|
|
1825
2203
|
protected abstract onShapeSubscribe(message: RelayShapeSubscribe): RelayShapeSeed;
|
|
1826
|
-
protected abstract
|
|
2204
|
+
protected abstract onShapeUnsubscribe(message: RelayShapeUnsubscribe): void;
|
|
2205
|
+
protected abstract onShapePoke(poke: RelayShapePoke): RelayPokeDelivery;
|
|
1827
2206
|
}
|
|
1828
2207
|
declare class OwnerRelay extends RelayLink {
|
|
1829
2208
|
private readonly shapeUniformCache;
|
|
1830
2209
|
private relaySetCache;
|
|
1831
|
-
private
|
|
1832
|
-
private
|
|
2210
|
+
private registryCache;
|
|
2211
|
+
private recordedBinding;
|
|
1833
2212
|
private promotionState;
|
|
1834
2213
|
constructor(host: RelayHost, ownerKey: string);
|
|
1835
2214
|
forwardWhisper(topic: string, frame: string): Promise<void>;
|
|
@@ -1840,17 +2219,26 @@ declare class OwnerRelay extends RelayLink {
|
|
|
1840
2219
|
}>;
|
|
1841
2220
|
announce(): Promise<void>;
|
|
1842
2221
|
announceDrain(): Promise<void>;
|
|
2222
|
+
releaseRelayShapes(): Promise<void>;
|
|
1843
2223
|
relayCount(): number;
|
|
2224
|
+
minShapeCursor(): number | undefined;
|
|
1844
2225
|
isShapeRelayUniform(name: string, args: Record<string, unknown>): boolean;
|
|
2226
|
+
protected onShapeUnsubscribe(message: RelayShapeUnsubscribe): void;
|
|
1845
2227
|
protected onAttach(index: number): void;
|
|
1846
2228
|
protected onDetach(index: number): void;
|
|
1847
2229
|
protected onWhisperFrame(message: RelayFrame): Promise<void>;
|
|
1848
2230
|
protected onShapeSubscribe(message: RelayShapeSubscribe): RelayShapeSeed;
|
|
1849
|
-
protected onShapePoke():
|
|
2231
|
+
protected onShapePoke(): RelayPokeDelivery;
|
|
2232
|
+
private buildShapePoke;
|
|
1850
2233
|
private multicastShapePokes;
|
|
2234
|
+
private multicastToRelays;
|
|
1851
2235
|
private proxyShapePokes;
|
|
2236
|
+
private proxyToRelay;
|
|
1852
2237
|
private buildShapeSeedFrames;
|
|
1853
|
-
private
|
|
2238
|
+
private ensureRelayTables;
|
|
2239
|
+
protected bindingName(): string | undefined;
|
|
2240
|
+
private relayShapes;
|
|
2241
|
+
private rewindShapeCursor;
|
|
1854
2242
|
private ownerRelaySet;
|
|
1855
2243
|
private addRelayToSet;
|
|
1856
2244
|
private removeRelayFromSet;
|
|
@@ -1859,7 +2247,8 @@ declare class OwnerRelay extends RelayLink {
|
|
|
1859
2247
|
}
|
|
1860
2248
|
declare class RelayMember extends RelayLink {
|
|
1861
2249
|
private relayAnnounced;
|
|
1862
|
-
private
|
|
2250
|
+
private relayMemoCache;
|
|
2251
|
+
private readonly shapeControl;
|
|
1863
2252
|
constructor(host: RelayHost, ownerKey: string, relayIndex: number);
|
|
1864
2253
|
forwardWhisper(topic: string, frame: string): Promise<void>;
|
|
1865
2254
|
onFlush(): Promise<void>;
|
|
@@ -1869,17 +2258,81 @@ declare class RelayMember extends RelayLink {
|
|
|
1869
2258
|
}>;
|
|
1870
2259
|
announce(): Promise<void>;
|
|
1871
2260
|
announceDrain(closing: ShardSocketLike): Promise<void>;
|
|
2261
|
+
releaseRelayShapes(ws: ShardSocketLike, subId?: string): Promise<void>;
|
|
1872
2262
|
relayCount(): number;
|
|
1873
2263
|
isShapeRelayUniform(): boolean;
|
|
2264
|
+
minShapeCursor(): number | undefined;
|
|
1874
2265
|
protected onAttach(): void;
|
|
1875
2266
|
protected onDetach(): void;
|
|
1876
2267
|
protected onWhisperFrame(): Promise<void>;
|
|
1877
2268
|
protected onShapeSubscribe(): RelayShapeSeed;
|
|
1878
|
-
protected
|
|
2269
|
+
protected onShapeUnsubscribe(): void;
|
|
2270
|
+
protected onShapePoke(poke: RelayShapePoke): RelayPokeDelivery;
|
|
2271
|
+
private queueShapeControl;
|
|
2272
|
+
private relayMemos;
|
|
2273
|
+
private connectionMemos;
|
|
1879
2274
|
private recordRelayShapeMemo;
|
|
2275
|
+
private forgetRelayShapeMemos;
|
|
1880
2276
|
private deliverShapePoke;
|
|
2277
|
+
private pokeSocketShapes;
|
|
1881
2278
|
}
|
|
1882
2279
|
declare const createRelayLink: (host: RelayHost) => OwnerRelay | RelayMember | undefined;
|
|
2280
|
+
declare const REGION_HINTS: readonly ["wnam", "enam", "sam", "weur", "eeur", "apac", "apac-ne", "apac-se", "oc", "afr", "me"];
|
|
2281
|
+
type RegionHint = (typeof REGION_HINTS)[number];
|
|
2282
|
+
type ReplicaReadiness = "fresh" | "stale" | "unavailable";
|
|
2283
|
+
interface ShardSiblingHost {
|
|
2284
|
+
doName: () => string | undefined;
|
|
2285
|
+
env: () => unknown;
|
|
2286
|
+
shardBinding: () => string | undefined;
|
|
2287
|
+
shardJurisdiction: () => string | undefined;
|
|
2288
|
+
sql: () => SqlExec;
|
|
2289
|
+
}
|
|
2290
|
+
interface ReplicaOwnerHost extends ShardSiblingHost {
|
|
2291
|
+
exportRows: () => Promise<ExportRow[]>;
|
|
2292
|
+
ownerCursor: () => number | undefined;
|
|
2293
|
+
ownerEpoch: () => string | undefined;
|
|
2294
|
+
ownerFloor: () => number | undefined;
|
|
2295
|
+
readChanges: (sinceSeq: number, limit: number) => {
|
|
2296
|
+
changes: CdcChange[];
|
|
2297
|
+
cursor: number;
|
|
2298
|
+
};
|
|
2299
|
+
rowCount: () => number;
|
|
2300
|
+
}
|
|
2301
|
+
interface ReplicaFollowerHost extends ShardSiblingHost {
|
|
2302
|
+
applyChanges: (changes: ReadonlyArray<CdcChange>) => Promise<number>;
|
|
2303
|
+
importRows: (rows: ReadonlyArray<ExportRow>) => Promise<{
|
|
2304
|
+
errors: ReadonlyArray<unknown>;
|
|
2305
|
+
}>;
|
|
2306
|
+
}
|
|
2307
|
+
declare const handleReplicaControl: (host: ReplicaOwnerHost, request: Request) => Promise<Response>;
|
|
2308
|
+
declare class ShardReplica {
|
|
2309
|
+
private readonly host;
|
|
2310
|
+
readonly ownerKey: string;
|
|
2311
|
+
readonly region: RegionHint;
|
|
2312
|
+
private divergent;
|
|
2313
|
+
private inFlight;
|
|
2314
|
+
constructor(host: ReplicaFollowerHost, ownerKey: string, region: RegionHint);
|
|
2315
|
+
ensureFresh(minSeq?: number): Promise<ReplicaReadiness>;
|
|
2316
|
+
appliedSeq(): number;
|
|
2317
|
+
isDivergent(): boolean;
|
|
2318
|
+
private advance;
|
|
2319
|
+
private isCaughtUp;
|
|
2320
|
+
private catchUp;
|
|
2321
|
+
private applyPage;
|
|
2322
|
+
private hasDiverged;
|
|
2323
|
+
private bootstrap;
|
|
2324
|
+
private isFreshEnough;
|
|
2325
|
+
private pull;
|
|
2326
|
+
private request;
|
|
2327
|
+
}
|
|
2328
|
+
declare const createReplicaLink: (host: ReplicaFollowerHost) => ShardReplica | undefined;
|
|
2329
|
+
declare const gateReplicaDispatch: (replica: ShardReplica, request: Request, functionPath: string) => Promise<Response | undefined>;
|
|
2330
|
+
declare const REPROJECTION_MIGRATION_PREFIX = "__lunora_reproject__";
|
|
2331
|
+
declare const reprojectionMigrationId: (table: string) => string;
|
|
2332
|
+
declare const reprojectableFields: (definition: TableDefinitionLike) => string[];
|
|
2333
|
+
declare const reprojectionTables: (schema: SchemaLike) => string[];
|
|
2334
|
+
declare const countLegacyRows: (sql: SqlExec, table: string, fields: ReadonlyArray<string>) => number;
|
|
2335
|
+
declare const buildReprojectionMigration: (id: string, schema: SchemaLike, sql: SqlExec) => DataMigrationLike | undefined;
|
|
1883
2336
|
declare const RLS_UNWRAP_SYMBOL: symbol;
|
|
1884
2337
|
declare class RlsRequiredError extends LunoraError {
|
|
1885
2338
|
readonly table: string;
|
|
@@ -1896,7 +2349,7 @@ interface GuardableSchema {
|
|
|
1896
2349
|
}
|
|
1897
2350
|
type TableOfId = (id: string, expectedTable?: string) => Promise<string | undefined> | string | undefined;
|
|
1898
2351
|
type TablesOfIds = (ids: ReadonlyArray<string>, expectedTable?: string) => Promise<ReadonlyMap<string, string>> | ReadonlyMap<string, string>;
|
|
1899
|
-
declare const guardWriter: <W>(raw: W, schema: GuardableSchema, tableOfId: TableOfId, tablesOfIds?: TablesOfIds) => W;
|
|
2352
|
+
declare const guardWriter: <W>(raw: W, schema: GuardableSchema, tableOfId: TableOfId, tablesOfIds?: TablesOfIds, relationEdges?: ReadonlyArray<RelationEdge>) => W;
|
|
1900
2353
|
declare const SCHEMA_HISTORY_MAX_VERSIONS = 50;
|
|
1901
2354
|
interface SchemaVersionRow {
|
|
1902
2355
|
appliedAt: number;
|
|
@@ -1907,8 +2360,24 @@ interface SchemaVersionRow {
|
|
|
1907
2360
|
declare const recordSchemaVersion: (sql: SqlExec, hash: string, snapshotJson: string, now?: number) => boolean;
|
|
1908
2361
|
declare const readSchemaHistory: (sql: SqlExec) => SchemaVersionRow[];
|
|
1909
2362
|
declare const readSchemaVersion: (sql: SqlExec, hash: string) => SchemaVersionRow | undefined;
|
|
2363
|
+
declare const readDeployInfo: (rawEnv: unknown) => DeployInfo;
|
|
1910
2364
|
declare const isDevEnvironment: (rawEnv: unknown) => boolean;
|
|
1911
2365
|
declare const buildSettings: (rawEnv: unknown) => SettingsResult;
|
|
2366
|
+
declare class ShapeDiffCache {
|
|
2367
|
+
private readonly keyScans;
|
|
2368
|
+
private readonly memberProbes;
|
|
2369
|
+
private run;
|
|
2370
|
+
private served;
|
|
2371
|
+
get probesRun(): number;
|
|
2372
|
+
get probesServed(): number;
|
|
2373
|
+
changedKeys(rangeKey: string, load: () => CdcChangeKey[]): ReadonlyArray<CdcChangeKey>;
|
|
2374
|
+
members(resolved: ResolvedShape, rangeKey: string, load: () => Map<string, Record<string, unknown>>): ReadonlyMap<string, Record<string, unknown>>;
|
|
2375
|
+
private getOrLoad;
|
|
2376
|
+
}
|
|
2377
|
+
declare const createShapeDiffCache: () => ShapeDiffCache;
|
|
2378
|
+
declare const globalShapeReadKey: (resolved: ResolvedShape, identity: SubscriptionIdentity) => string | undefined;
|
|
2379
|
+
type ReadShapeCdcKeys = (sql: SqlExec, table: string, sinceSeq: number, upTo: number) => CdcChangeKey[];
|
|
2380
|
+
declare const buildShapeDiff: (sql: SqlExec, resolved: ResolvedShape, sinceSeq: number, upTo: number, cache: ShapeDiffCache, readKeys?: ReadShapeCdcKeys) => ShapeRowOp[];
|
|
1912
2381
|
interface ShardRunnerOptions {
|
|
1913
2382
|
handlers?: {
|
|
1914
2383
|
handleAlarm?: () => Promise<void>;
|
|
@@ -1924,7 +2393,7 @@ declare class ShardRunner {
|
|
|
1924
2393
|
socketFor(raw: unknown): ShardSocketLike;
|
|
1925
2394
|
sockets(tag?: string): SocketHandle[];
|
|
1926
2395
|
background(work: Promise<unknown>): boolean;
|
|
1927
|
-
runInTransaction<T>(work: () => Promise<T
|
|
2396
|
+
runInTransaction<T>(work: () => Promise<T>, onCommitted?: () => void): Promise<T>;
|
|
1928
2397
|
handleFetch(request: Request): Promise<Response>;
|
|
1929
2398
|
handleAlarm(): Promise<void>;
|
|
1930
2399
|
}
|
|
@@ -1950,6 +2419,11 @@ interface SqlDiagnostic {
|
|
|
1950
2419
|
source: "gate" | "plan" | "syntax";
|
|
1951
2420
|
}
|
|
1952
2421
|
declare const lintReadonlySql: (sql: SqlExec, query: string) => SqlLintResult;
|
|
2422
|
+
declare const BIGINT_KEY_DIGITS = 39;
|
|
2423
|
+
declare const bigintSqlKey: (value: bigint) => string;
|
|
2424
|
+
declare const decodeBigintSqlKey: (raw: string) => bigint | undefined;
|
|
2425
|
+
declare const float64SqlKey: (value: number) => string;
|
|
2426
|
+
declare const decodeFloat64SqlKey: (raw: string) => number | undefined;
|
|
1953
2427
|
declare const subscriptionListDeltas: (previousJson: string, nextResult: unknown, table: string, frames?: string[]) => MutationDelta[] | undefined;
|
|
1954
2428
|
interface FrameSink {
|
|
1955
2429
|
send: (data: string) => void;
|
|
@@ -1958,7 +2432,17 @@ interface DrainableSink {
|
|
|
1958
2432
|
readonly bufferedAmount?: unknown;
|
|
1959
2433
|
}
|
|
1960
2434
|
declare const trySendFrame: (ws: FrameSink, frame: string) => boolean;
|
|
1961
|
-
|
|
2435
|
+
interface SubscriptionFrameInput {
|
|
2436
|
+
cursorSuffix: string;
|
|
2437
|
+
lastMutationId?: number;
|
|
2438
|
+
nextResult: unknown;
|
|
2439
|
+
pageDeltas?: boolean;
|
|
2440
|
+
previousJson?: string;
|
|
2441
|
+
snapshotJson: string;
|
|
2442
|
+
subId: string;
|
|
2443
|
+
table: string;
|
|
2444
|
+
}
|
|
2445
|
+
declare const subscriptionFrames: (input: SubscriptionFrameInput) => string[];
|
|
1962
2446
|
declare const awaitWsDrain: (ws: DrainableSink) => Promise<void>;
|
|
1963
2447
|
interface SubscriptionReadFootprint {
|
|
1964
2448
|
ranges?: Map<string, KeyRange[]>;
|
|
@@ -1986,13 +2470,51 @@ declare const selectExpiredIds: (sql: SqlExec, spec: TtlSweepSpec, now: number,
|
|
|
1986
2470
|
hasMore: boolean;
|
|
1987
2471
|
ids: string[];
|
|
1988
2472
|
};
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
2473
|
+
declare const VECTOR_BACKFILL_MAX_PAGES = 20;
|
|
2474
|
+
interface VectorBackfillTarget {
|
|
2475
|
+
profile: string;
|
|
2476
|
+
table: string;
|
|
2477
|
+
}
|
|
2478
|
+
interface VectorBackfillProgress {
|
|
2479
|
+
done: boolean;
|
|
2480
|
+
error?: string;
|
|
2481
|
+
failed: number;
|
|
2482
|
+
failedIds: string[];
|
|
2483
|
+
pages: number;
|
|
2484
|
+
rows: number;
|
|
2485
|
+
}
|
|
2486
|
+
type VectorPageSync = (table: string, rows: ReadonlyArray<{
|
|
2487
|
+
doc: Record<string, unknown>;
|
|
2488
|
+
id: string;
|
|
2489
|
+
}>) => Promise<ReadonlyArray<{
|
|
2490
|
+
error: unknown;
|
|
2491
|
+
id: string;
|
|
2492
|
+
}>>;
|
|
2493
|
+
type OrderedAfterWrites = <T, U>(read: () => T, work: (value: T) => Promise<U>) => Promise<U>;
|
|
2494
|
+
declare const backfillVectorIndexes: (sql: SqlExec, targets: ReadonlyArray<VectorBackfillTarget>, sync: VectorPageSync, options: {
|
|
2495
|
+
maxPages?: number;
|
|
2496
|
+
ordered: OrderedAfterWrites;
|
|
2497
|
+
restart?: boolean;
|
|
2498
|
+
}) => Promise<VectorBackfillProgress>;
|
|
2499
|
+
interface WhereFragments<T> {
|
|
2500
|
+
binary: (reference: T, comparator: string, value: unknown) => T;
|
|
2501
|
+
connect: (left: T, right: T, connector: "AND" | "OR") => T;
|
|
2502
|
+
constant: (value: boolean) => T;
|
|
2503
|
+
contains: (reference: T, term: T) => T;
|
|
2504
|
+
inList: (reference: T, items: ReadonlyArray<unknown>, negated: boolean, budget: number) => T;
|
|
2505
|
+
negate: (inner: T) => T;
|
|
2506
|
+
nullCheck: (reference: T, negated: boolean) => T;
|
|
2507
|
+
value: (value: unknown) => T;
|
|
2508
|
+
}
|
|
2509
|
+
type FieldRefSql<T> = (field: string) => T;
|
|
2510
|
+
type SerializeValue = (value: unknown, field: string) => unknown;
|
|
2511
|
+
interface WhereSqlStrategy<T = SQL> {
|
|
2512
|
+
containsExpr?: (reference: T, term: T) => T;
|
|
2513
|
+
fieldRef: FieldRefSql<T>;
|
|
2514
|
+
inList?: (reference: T, items: ReadonlyArray<unknown>, negated: boolean, budget?: number) => T;
|
|
2515
|
+
relationExists?: (request: unknown) => T;
|
|
1995
2516
|
serialize: SerializeValue;
|
|
1996
2517
|
}
|
|
1997
|
-
declare const
|
|
1998
|
-
|
|
2518
|
+
declare const serverInList: (engine: "mysql" | "postgres") => (reference: SQL, items: ReadonlyArray<unknown>, negated: boolean, budget?: number) => SQL;
|
|
2519
|
+
declare const compileWhereSql: <T = SQL>(where: WhereInput | undefined, strategy: WhereSqlStrategy<T>, fragments?: WhereFragments<T>, reservedParams?: number) => T | undefined;
|
|
2520
|
+
export { ADMIN_FUNCTIONS, ADMIN_FUNCTION_PREFIX, AGGREGATE_SQL_FUNCTION, AGG_COUNT, AGG_KEY, AGG_VALUE, AUDIT_LOG_TABLE, type AdvisorProcedure, type AdvisorProceduresResult, type AdvisoriesResult, type AdvisoryFinding, type AggregateIndexDefinitionLike, type AggregateOp, type AggregateOptions, type AggregateResult, type AggregateTally, type AppendAuditEntry, type ApplyOnDeleteOptions, type AuditEntry, type AuditLogResult, BIGINT_KEY_DIGITS, type BroadcastDelta, CDC_LOG_TABLE, CDC_LOG_TABLE_SEQ_INDEX, CDC_META_TABLE, CLIENT_WATERMARK_TABLE, COMMIT_SEQ_FIELD, COMMIT_SEQ_TABLE, CURSOR_PREFIX, type CacheEntry, type CapturedMailRow, type CdcArchiveScope, type CdcChange, type CdcChangeKey, type ChangedKeys, type Clock, type ColumnMeta, type ColumnMetaLike, type CompanionSync, type CompanionSyncDeps, ConflictError, type ConflictKind, type CountArgs, CountRlsUnsupportedError, type CreateWorkflowInstanceResult, type CrossShardReadArgs, type CtxDbOptions, DATA_MIGRATION_STATE_TABLE, DEFAULT_FANOUT_TOPIC_LIMIT, DEFAULT_MAX_RELATION_KEYS, DEFAULT_MAX_RELAYS, DEFAULT_PROMOTION_THRESHOLDS, DEFAULT_TRANSACTION_LIMITS, DOC_COLUMN, type DataMigrationDocument, type DataMigrationLike, type DataMigrationTransform, type DatabaseWriterLike, type DependencyTracker, type DeployInfo, type DurableAttachDecision, type DurableStreamAttach, type DurableStreamRun, DurableStreamRunner, type DurableStreamSink, type ExportRow, type ExportShardAdminArgs, type ExportShardArgs, type ExternalSourceDiffResult, type ExternalSourceLike, FLAGS_FUNCTION_PREFIX, type FacetColumnOptions, type FacetColumnResult, type FacetValue, type FanOutBudget, type FanoutMetricsResult, type FanoutPathCounters, type FanoutTopicStat, type FieldOperators, type FilterClause, type FilterOperator, type FlagEvaluation, type FlagsResult, type FtsWriteOptions, type FunctionCallStat, type FunctionScanAttribution, type FunctionStatsResult, GEO_DEFAULT_PRECISION, GLOBAL_SHAPE_SNAPSHOT_TABLE, type GeoBoundingBox, type GeoFilterBuilderLike, type GeoIndexDefinitionLike, type GeoPoint, type GeoScoredDocument, type GlobalPollCounters, GlobalPollTick, type GroupByEntry, type GroupByOptions, type GuardableSchema$1 as GuardableSchema, IDEMPOTENCY_TABLE, type IdGenerator, type IdempotentRecord, type ImportError, type ImportShardAdminArgs, type ImportShardArgs, type ImportShardResult, type IncrementalMaterializeResult, type IndexDefinitionLike, type IndexKeyEntry, type IndexRangeBuilderLike, type KeyRange, type LifecycleDispatchInfo, type LifecycleEvent, MAIL_RETENTION, MAIL_TABLE, MAX_DURABLE_STREAM_BYTES, MAX_DURABLE_STREAM_CHUNKS, MAX_PAGE_SIZE, MAX_SQL_ROWS, type MaskColumnMetadata, type MaskPoliciesResult, type MaterializeResult, type MigrationDirection, type MigrationRunResult, type MigrationStatus, type MigrationStatusRow, type MutationDelta, type NestedWith, NotFoundError, NotUniqueError, type OnDeleteActionLike, type OrderByClause, type OrderByInput, type OrderKey, type OrderKeyConstraints, OwnerRelay, type OwnerRelayFrame, type PaginationOptions, type PitrBookmarkResult, type PitrRestoreArgs, type PitrRestoreResult, type PitrStorage, type PokeFrameMeta, type PromotionState, type PromotionThresholds, QUEUE_TABLE, type QueryArgs, type QueryPage, type QueueMessageOutcome, type QueueMessageRow, type QueueMetadata, type QueuesResult, RANK_TIEBREAK, REACTOR_STATE_TABLE, RELATED_DEFAULT_LIMIT, RELATED_DEPTH_DECAY, RELATED_MAX_DEPTH, RELATED_MAX_LIMIT, RELATION_EXISTS_KEY, RELATION_FUNCTION_PREFIX, REPROJECTION_MIGRATION_PREFIX, RLS_UNWRAP_SYMBOL, type RankBeforeOptions, type RankBeforeResult, type RankDirection, type RankIndexDefinitionLike, type RankOptions, type RankPage, type RankPageComputation, type RankPageDeps, type RankPageOptions, type RankPageRow, type RankPageRowKey, type RankResult, type RankSortKeyLike, ReactiveCache, type ReactiveCacheOptions, type ReactorDispatchResult, type ReactorMetadata, type ReactorState, type ReactorStats, type ReactorsResult, type ReadFootprint, type ReadHook, type ReadTablePageOptions, type RecordMailInput, type RecordQueueMessageInput, type RelatedDirection, type RelatedNode, type RelatedOptions, type RelatedPage, type RelatedStart, type RelatedStartReference, type RelationDefinitionLike, type RelationEdge, type RelationExistsMarker, type RelationGraphReader, type RelayAttach, type RelayDetach, type RelayFrame, type RelayHost, RelayMember, type RelayPokeDelivery, type RelayShapePoke, type RelayShapeSeed, type RelayShapeSubscribe, type RelayShapeUnsubscribe, type RenderedSql, type ReplicaFollowerHost, type ReplicaOwnerHost, type ReplicaReadiness, type ResolveRelationPredicatesOptions, type ResolveWithOptions, type ResolveWithResult, type ResolvedShape, type RestrictableQueryOptions, type RlsPoliciesResult, type RlsPolicyMetadata, RlsRequiredError, type RlsRoleMetadata, type RpcRequest, type RunDataMigrationOptions, type RunTriggersOptions, SCAN_DEP, SCHEDULE_OUTBOX_TABLE, SCHEMA_HISTORY_MAX_VERSIONS, SEARCH_STATE_TABLE, SHAPE_POKE_CURSOR_TABLE, type SchedulableWorkflowReferenceLike, type ScheduleOutbox, type ScheduleOutboxEnvelope, type ScheduleOutboxRow, type ScheduledFunctionDoc, type SchedulerLike, type SchemaLike, type ScoredDocument, type SearchBackfillProgress, type SearchFilterBuilderLike, type SearchIndexDefinitionLike, type SearchScoredDocument, type SelectMatchingIdsOptions, type ServerDefaultContextLike, type SettingEntry, type SettingKind, type SettingsResult, ShapeDiffCache, type ShapePokeCursorRow, type ShapePokePart, type ShapeProbeCounters, type ShapeRow, type ShapeRowOp, type ShapeSubscriptionQuery, type ShardRankPageResult, ShardRunner, type ShardRunnerOptions, type ShardSiblingHost, type ShardSocketLike, type SocketAttachment, type SortDirection, type SourceClientLike, type SourceCursorLike, type SourceRefresh, type SqlConsoleResult, type SqlCursor, type SqlEngine, type SqlExec, type SqlLintResult, type StorageMetadata, type StorageReference, type StorageReferenceResult, type StorageRuleMetadata, type StorageRulesResult, type StudioFeaturesResult, type SubscriptionConnection, type SubscriptionEnvelope, type SubscriptionIdentity, type SubscriptionInfo, type SubscriptionQuery, type SubscriptionReadFootprint, type SubscriptionsResult, type SystemDatabaseReader, type SystemDoc, type SystemQuery, type SystemReaderOptions, type SystemReaderSchedulerLike, type SystemReaderStorageLike, type SystemTableName, type TableColumnsResult, type TableDefinitionLike, type TableIndexInfo, type TableIndexesResult, type TableInfo, type TablePage, type TableReaderLike, type TablesColumnsResult, type TablesIndexesResult, type TransactionHeadroom, TransactionHeadroomTracker, type TransactionLimits, type TransactionSqlLike, type TriggerContextLike, type TriggerDefinitionLike, type TriggerEventLike, type TriggerOpLike, type TriggerTimingLike, type TtlSweepSpec, UNVOUCHABLE_DEP, VECTOR_BACKFILL_MAX_PAGES, type ValidatorLike, type VectorBackfillProgress, WORKERD_SQLITE_LIMITS, type WhereFilter, type WhereInput, type WhereSqlStrategy, type WithInput, type WorkflowInstanceState, type WorkflowInstanceStatusResult, type WorkflowMetadata, type WorkflowsResult, type WriteEvent, type WriteHook, advanceClientWatermark, aggUpsertSql, aggregateSqlFunction, aggregateTableName, allocateCommitSeq, appendAuditEntry, appendCdcChange, appendStreamChunk, applyCdcChanges, applyOnDelete, applySelect, archiveCdcSegment, armRestore, assertFlatPredicate, assertNoExplicitUndefined, assertReadonly, assertShapeShardable, assertValidClientId, awaitWsDrain, backfillAggregateIndexes, backfillRankIndexes, backfillSearchIndexes, backfillSearchIndexesForTable, backfillVectorIndexes, bigintSqlKey, boundingBoxCenter, boundingBoxGeohashes, buildIndexRange, buildPokeFrames, buildReprojectionMigration, buildSeekBeforeWhere, buildSeekWhere, buildSettings, buildShapeDiff, bumpCdcEpoch, cdcArchiveRewound, cdcCanVouchFor, cdcForkedError, cdcSeqLeavingRows, cdcTouchesTables, cdcTrimmedError, claimStreamRun, clampPromotionThresholds, clearCapturedMail, clearMemoryTables, clearQueueMessages, coerceAggregateNumber, compactCdcDocs, compileWhereSql, computeRankPage, containsRelationPredicate, countLegacyRows, coveringGeohashes, createCompanionSync, createDependencyTracker, createFanoutCounters, createGlobalPollCounters, createIndexSql, createReadFootprint, createRelayLink, createReplicaLink, createShapeDiffCache, createShapeProbeCounters, createShardCtxDb, createSystemReader, cursorBelowRetainedFloor, decideDurableAttach, decodeBigintSqlKey, decodeCursor, decodeFloat64SqlKey, deferScheduleOutbox, deleteGlobalShapeSnapshot, deleteGlobalShapeSnapshotsForConnection, deleteShapePokeCursor, deleteShapePokeCursorsForConnection, deleteStreamRun, depKey, deriveRelationEdges, diffExternalSource, diffGlobalMembership, distinctValues, encodeAggregateKey, encodeCursor, encodeGeohash, encodePartitionKey, encodeRowsPatch, ensureAuditTable, ensureMailTable, envOptionalPositiveInt, envPositiveInt, equalityPinnedFields, exportShardRows, facetColumn, fanOutScalarCounts, findRelated, findStorageReferences, finishStreamRun, float64SqlKey, foldAggregateTally, forgetScheduleOutbox, ftsCompanionDdl, ftsPurgeDocument, ftsRowidMapName, ftsUnmappedPage, ftsWriteDocument, gateReplicaDispatch, geoTableName, globalShapeReadKey, groupUnmappedRows, guardWriter, handleReplicaControl, hasTrigger, haversineMeters, importShardRows, indexKeysForRow, isDevEnvironment, isFtsAvailable, isInternalTableName, isLossyBody, isMemoryTable, isPushableWhere, isRelationPredicate, isSoftDeleted, isSourceDue, isVacuousFilterClause, jsonPath, jsonPathSql, keysTouchRanges, liftSourceId, lintReadonlySql, listReactorStates, listTables, markUnvouchableReads, matchesRankStaticWhere, matchesStaticWhere, materializeExternalRows, materializeExternalRowsIncremental, memoryTableNames, mergeChangedKeys, mergeWhere, migrateCdcLog, migrateCdcMeta, migrateClientWatermark, migrateCommitSeq, migrateDurableStreams, migrateGlobalShapeSnapshot, migrateIdempotency, migrateReactorState, migrateScheduleOutbox, migrateSearchState, migrateShapePokeCursor, minCdcReplayableSeq, minCdcSeq, minShapePokeCursor, nextPromotionState, normalizeCountArgument, normalizeIdStructurally, normalizeOrderKeys, normalizeSourceDocument, normalizeSourceValue, param, parkScheduleOutbox, parseExportShardArgs, parseImportShardArgs, planAggregateLookup, pointInBoundingBox, probeScheduleOutbox, projectColumns, pullExternalSourceIncrementalTick, pullExternalSourceTick, qualifiedJsonPath, qualifiedJsonPathSql, quoteIdentifier, rankKeyFromDocument as rankKeyFromDoc, rankPivotConditionSql, rankTableName, reactiveCacheKey, reactorNeedsRun, readAggregateValue, readArchivedCdcChanges, readAuditLog, readBookmark, readCapturedMail, readCdcArchivedThrough, readCdcChangeKeys, readCdcChanges, readCdcCursor, readCdcEpoch, readClientWatermark, readCommitSeq, readDeployInfo, readDueScheduleOutbox, readExternalSourceBaseline, readGlobalShapeSnapshot, readIdempotent, readMigrationStatus, readQueueMessageById, readQueueMessages, readReactorState, readSchemaHistory, readSchemaVersion, readSearchBackfillState, readShapePokeCursor, readStreamChunks, readStreamRun, readTablePage, recordCapturedMail, recordChangedKeys, recordFanoutPass, recordGlobalPollPass, recordQueueMessages, recordScheduleOutbox, recordSchemaVersion, recordShapeProbePass, relationHooks, relayCountFor, renderSql, reprojectableFields, reprojectionMigrationId, reprojectionTables, resolveRankPartition, resolveRankSeekTuple, resolveRelationPredicates, resolveWith, rowToDocument, runDataMigration, runDrizzle, runExternalSourceTick, runReadonlySql, runRowValidators, runShardMigrations, runSocketPool, runSql, runTriggers, selectExpiredIds, selectExportTables, selectIndexForAggregate, selectIndexForCount, selectIndexForGroupBy, selectMatchingIds, selectShapeMembers, selectShapeRows, serializeSqlValue, serverInList, shapeRoutingKey, softDeleteScope, sortColumnName, sqliteInList, stableStringify, stableWireKey, stripReservedPatchFields, stubByName, subscriptionFrames, subscriptionListDeltas, summarizeFanoutTopics, summarizeSubscriptions, tableColumns, tableFromDepKey, throwingScheduler, tiebreakDirectionFor, trimCdcChanges, trimIdempotent, trimScheduleOutbox, trimStreamRuns, tryRowToDocument, trySendFrame, unionAll, uniqueIndexFields, validateImportRow, whereFilter, whereOfFilter, writeCdcArchivedThrough, writeGlobalShapeSnapshot, writeIdempotent, writeReactorState, writeSearchBackfillState, writeShapePokeCursor, writeShapePokeCursors, writeTouchesMemo };
|