@lunora/shard-engine 1.0.0-alpha.122 → 1.0.0-alpha.123

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.
Files changed (51) hide show
  1. package/dist/conformance/index.mjs +1 -1
  2. package/dist/index.d.mts +68 -24
  3. package/dist/index.d.ts +68 -24
  4. package/dist/index.mjs +1 -1
  5. package/dist/packem_shared/{ADMIN_FUNCTIONS-BGXP6oxh.mjs → ADMIN_FUNCTIONS-Bsvi2ytY.mjs} +1 -1
  6. package/dist/packem_shared/AGGREGATE_SQL_FUNCTION-BMtvQHac.mjs +1 -0
  7. package/dist/packem_shared/AGG_COUNT-D77Ynq1b.mjs +1 -0
  8. package/dist/packem_shared/{CDC_LOG_TABLE-GKlDpuM2.mjs → CDC_LOG_TABLE-BPEzVAil.mjs} +1 -1
  9. package/dist/packem_shared/CURSOR_PREFIX-BztyXqNP.mjs +1 -0
  10. package/dist/packem_shared/{DATA_MIGRATION_STATE_TABLE-DfqA-2Dj.mjs → DATA_MIGRATION_STATE_TABLE-CqPrNKql.mjs} +1 -1
  11. package/dist/packem_shared/DEFAULT_MAX_RELATION_KEYS-BPSfUl2O.mjs +1 -0
  12. package/dist/packem_shared/NotUniqueError-B4X0Amvc.mjs +1 -0
  13. package/dist/packem_shared/{RANK_TIEBREAK-DrISKVKe.mjs → RANK_TIEBREAK-BKugKf70.mjs} +1 -1
  14. package/dist/packem_shared/{RELATED_DEFAULT_LIMIT-e7viSuiO.mjs → RELATED_DEFAULT_LIMIT-Me5elP-K.mjs} +1 -1
  15. package/dist/packem_shared/RELATION_EXISTS_KEY-wxgj6rSL.mjs +1 -0
  16. package/dist/packem_shared/RLS_UNWRAP_SYMBOL-qYcAxjuk.mjs +1 -0
  17. package/dist/packem_shared/{VECTOR_BACKFILL_MAX_PAGES-CO1Ra57t.mjs → VECTOR_BACKFILL_MAX_PAGES-D9DeCfM2.mjs} +1 -1
  18. package/dist/packem_shared/accepts-null-D1zmJbyR.mjs +1 -0
  19. package/dist/packem_shared/{applyOnDelete-8n5PzcI0.mjs → applyOnDelete-CeqSZSQu.mjs} +1 -1
  20. package/dist/packem_shared/assertPatchAllowed-BJ_2LgkQ.mjs +1 -0
  21. package/dist/packem_shared/{backfillAggregateIndexes-B1yVAkvK.mjs → backfillAggregateIndexes-CJrtolQ9.mjs} +1 -1
  22. package/dist/packem_shared/{buildReprojectionMigration-BnUbAUwT.mjs → buildReprojectionMigration-CRS4SNgc.mjs} +1 -1
  23. package/dist/packem_shared/{buildShapeDiff-AxUzi_GL.mjs → buildShapeDiff-C3hPtSKO.mjs} +1 -1
  24. package/dist/packem_shared/compileWhereSql-BaMGeXXq.mjs +1 -0
  25. package/dist/packem_shared/{computeRankPage-BI2lNKPu.mjs → computeRankPage-CFeFkZ_k.mjs} +1 -1
  26. package/dist/packem_shared/createCompanionSync-B7dV2y4L.mjs +1 -0
  27. package/dist/packem_shared/{createReplicaLink-CJn5lH0o.mjs → createReplicaLink-B9F5PAQ0.mjs} +1 -1
  28. package/dist/packem_shared/defineEngineContractSuite-CD390TWc.mjs +1 -0
  29. package/dist/packem_shared/describeRelationWrites-z-ocXMtj.mjs +1 -0
  30. package/dist/packem_shared/do-sql-Cg3zXJpF.mjs +1 -0
  31. package/dist/packem_shared/{isSoftDeleted-BHlFkAsr.mjs → isSoftDeleted-BTGu2iBl.mjs} +1 -1
  32. package/dist/packem_shared/json-field-path-B2fjnGc3.mjs +1 -0
  33. package/dist/packem_shared/{materializeExternalRows-Csa8ELkU.mjs → materializeExternalRows-Cx6_A2W3.mjs} +1 -1
  34. package/dist/packem_shared/{runShardMigrations-3BBkjGHs.mjs → runShardMigrations-eqHNBW6S.mjs} +1 -1
  35. package/dist/packem_shared/{selectExpiredIds-5bAT7X28.mjs → selectExpiredIds-CilDdUr2.mjs} +1 -1
  36. package/dist/packem_shared/selectShapeMembers-CU8Kl2Bq.mjs +1 -0
  37. package/dist/packem_shared/where-sql-Dn9trjRu.mjs +1 -0
  38. package/package.json +2 -2
  39. package/dist/packem_shared/AGGREGATE_SQL_FUNCTION-DDEoMnJR.mjs +0 -1
  40. package/dist/packem_shared/AGG_COUNT-BIGZgU8U.mjs +0 -1
  41. package/dist/packem_shared/CURSOR_PREFIX-C1jsjAPd.mjs +0 -1
  42. package/dist/packem_shared/DEFAULT_MAX_RELATION_KEYS-CQLms3UG.mjs +0 -1
  43. package/dist/packem_shared/NotUniqueError-thbeLn0g.mjs +0 -1
  44. package/dist/packem_shared/RELATION_EXISTS_KEY-CFUhnZSZ.mjs +0 -1
  45. package/dist/packem_shared/RLS_UNWRAP_SYMBOL-Dv9crDfv.mjs +0 -1
  46. package/dist/packem_shared/compileWhereSql-DLfUbHc-.mjs +0 -1
  47. package/dist/packem_shared/createCompanionSync-hGCzG0O1.mjs +0 -1
  48. package/dist/packem_shared/defineEngineContractSuite-eCIuMGrM.mjs +0 -1
  49. package/dist/packem_shared/do-sql-CyWszGdM.mjs +0 -1
  50. package/dist/packem_shared/selectShapeMembers-CNpeUQ-H.mjs +0 -1
  51. package/dist/packem_shared/where-sql-DFs8Zw7-.mjs +0 -1
@@ -1 +1 @@
1
- import{defineEngineContractSuite as t}from"../packem_shared/defineEngineContractSuite-eCIuMGrM.mjs";export{t as defineEngineContractSuite};
1
+ import{defineEngineContractSuite as t}from"../packem_shared/defineEngineContractSuite-CD390TWc.mjs";export{t as defineEngineContractSuite};
package/dist/index.d.mts CHANGED
@@ -22,6 +22,16 @@ declare const indexKeysForRow: (indexes: ReadonlyArray<{
22
22
  name: string;
23
23
  }>, row: Record<string, unknown>, serialize: (value: unknown) => unknown) => IndexKeyEntry[];
24
24
  declare const keysTouchRanges: (ranges: ReadonlyArray<KeyRange> | undefined, keys: ReadonlyArray<IndexKeyEntry> | undefined) => boolean;
25
+ interface RelationWriteInfo {
26
+ readonly colocated: boolean;
27
+ readonly field: string;
28
+ readonly kind: "many" | "one";
29
+ readonly nullable: boolean;
30
+ readonly references: string;
31
+ readonly table: string;
32
+ }
33
+ type RelationWriteMap = Readonly<Record<string, Readonly<Record<string, RelationWriteInfo>>>>;
34
+ declare const describeRelationWrites: (schema: SchemaLike) => RelationWriteMap;
25
35
  type SystemTableName = "_scheduled_functions" | "_storage";
26
36
  interface ScheduledFunctionDoc {
27
37
  args: Record<string, unknown>;
@@ -210,6 +220,7 @@ interface ValidatorLike {
210
220
  readonly column?: ColumnMetaLike;
211
221
  readonly inner?: ValidatorLike;
212
222
  readonly members?: ReadonlyArray<ValidatorLike>;
223
+ readonly shape?: Readonly<Record<string, ValidatorLike>>;
213
224
  readonly tableName?: string;
214
225
  readonly value?: unknown;
215
226
  };
@@ -253,6 +264,10 @@ interface SchemaLike {
253
264
  readonly rlsMode?: "required";
254
265
  readonly tables: Record<string, TableDefinitionLike>;
255
266
  }
267
+ type PatchVerifier = (previous: Record<string, unknown>, next: Record<string, unknown>) => boolean;
268
+ interface PatchWriteOptions {
269
+ verify?: PatchVerifier;
270
+ }
256
271
  interface TableDefinitionLike {
257
272
  readonly aggregateIndexes?: ReadonlyArray<AggregateIndexDefinitionLike>;
258
273
  readonly commitOrderedMode?: boolean;
@@ -319,7 +334,11 @@ interface ResolveWithResult {
319
334
  rows: Record<string, unknown>[];
320
335
  }
321
336
  type SortDirection = "asc" | "desc";
322
- type OrderByInput = Record<string, SortDirection>;
337
+ type NullPlacement = "first" | "last";
338
+ type OrderByInput = Record<string, SortDirection | {
339
+ nulls: NullPlacement;
340
+ sort: SortDirection;
341
+ }>;
323
342
  interface QueryArgs {
324
343
  baseWhere?: WhereInput;
325
344
  cursor?: null | string;
@@ -341,6 +360,11 @@ interface CrossShardReadArgs {
341
360
  with?: WithInput;
342
361
  }
343
362
  type RelationMask = (table: string, rows: Record<string, unknown>[]) => Record<string, unknown>[];
363
+ interface QueryPlan {
364
+ params: unknown[];
365
+ plan: string[];
366
+ sql: string;
367
+ }
344
368
  interface QueryPage {
345
369
  continueCursor: null | string;
346
370
  isDone: boolean;
@@ -388,6 +412,7 @@ interface OrderKey {
388
412
  direction: SortDirection;
389
413
  field: string;
390
414
  nullable: boolean;
415
+ nulls?: NullPlacement;
391
416
  }
392
417
  interface RestrictableQueryOptions {
393
418
  baseWhere?: WhereInput;
@@ -536,6 +561,7 @@ interface MutationDelta {
536
561
  interface DatabaseWriterLike {
537
562
  aggregate: (tableName: string, options: AggregateOptions) => Promise<AggregateResult>;
538
563
  asId?: (tableName: string, id: string) => string;
564
+ assertPatchAllowed?: (id: string, expectedTable?: string) => Promise<void>;
539
565
  cdcChangedTables?: (sinceSeq: number, options?: {
540
566
  cursorOnly?: boolean;
541
567
  }) => Promise<{
@@ -563,6 +589,7 @@ interface DatabaseWriterLike {
563
589
  }) => Promise<{
564
590
  deleted: number;
565
591
  }>;
592
+ explain: (tableName: string, args?: QueryArgs) => Promise<QueryPlan>;
566
593
  findFirst: (tableName: string, args?: QueryArgs) => Promise<Record<string, unknown> | null>;
567
594
  findFirstOrThrow: (tableName: string, args?: QueryArgs) => Promise<Record<string, unknown>>;
568
595
  findMany: (tableName: string, args?: QueryArgs) => Promise<QueryPage>;
@@ -585,9 +612,10 @@ interface DatabaseWriterLike {
585
612
  tableName: string;
586
613
  }>;
587
614
  normalizeId: (tableName: string, id: string) => null | string;
588
- patch: (id: string, patch: Record<string, unknown>, expectedTable?: string) => Promise<void>;
615
+ patch: (id: string, patch: Record<string, unknown>, expectedTable?: string, options?: PatchWriteOptions) => Promise<void>;
589
616
  patchIf?: (tableName: string, id: string, args: {
590
617
  patch: Record<string, unknown>;
618
+ verify?: PatchVerifier;
591
619
  where: WhereInput;
592
620
  }) => Promise<{
593
621
  applied: boolean;
@@ -616,6 +644,7 @@ interface DatabaseWriterLike {
616
644
  rankPageRows?: (tableName: string, indexName: string, options?: RankPageOptions) => Promise<ShardRankPageResult>;
617
645
  related?: (start: RelatedStart, options?: RelatedOptions) => Promise<RelatedPage>;
618
646
  relationEdges?: ReadonlyArray<RelationEdge>;
647
+ relationWrites?: RelationWriteMap;
619
648
  replace: (id: string, document: Record<string, unknown>, expectedTable?: string, options?: {
620
649
  allowExplicitId?: boolean;
621
650
  }) => Promise<void>;
@@ -1143,6 +1172,29 @@ interface DependencyTracker {
1143
1172
  declare const createDependencyTracker: () => DependencyTracker;
1144
1173
  declare const runSql: <Row = Record<string, unknown>>(sql: SqlExec, query: string, ...params: unknown[]) => SqlCursor<Row>;
1145
1174
  declare const runDrizzle: <Row = Record<string, unknown>>(exec: SqlExec, query: SQL) => SqlCursor<Row>;
1175
+ type RangeOperandType = "boolean" | "number" | "string";
1176
+ interface WhereFragments<T> {
1177
+ binary: (reference: T, comparator: string, value: unknown) => T;
1178
+ connect: (left: T, right: T, connector: "AND" | "OR") => T;
1179
+ constant: (value: boolean) => T;
1180
+ contains: (reference: T, term: T) => T;
1181
+ inList: (reference: T, items: ReadonlyArray<unknown>, negated: boolean, budget: number) => T;
1182
+ negate: (inner: T) => T;
1183
+ nullCheck: (reference: T, negated: boolean) => T;
1184
+ value: (value: unknown) => T;
1185
+ }
1186
+ type FieldRefSql<T> = (field: string) => T;
1187
+ type SerializeValue = (value: unknown, field: string) => unknown;
1188
+ interface WhereSqlStrategy<T = SQL> {
1189
+ containsExpr?: (reference: T, term: T) => T;
1190
+ fieldRef: FieldRefSql<T>;
1191
+ inList?: (reference: T, items: ReadonlyArray<unknown>, negated: boolean, budget?: number) => T;
1192
+ rangeTypeGuard: (field: string, type: RangeOperandType) => T;
1193
+ relationExists?: (request: unknown) => T;
1194
+ serialize: SerializeValue;
1195
+ }
1196
+ declare const serverInList: (engine: "mysql" | "postgres") => (reference: SQL, items: ReadonlyArray<unknown>, negated: boolean, budget?: number) => SQL;
1197
+ declare const compileWhereSql: <T = SQL>(where: WhereInput | undefined, strategy: WhereSqlStrategy<T>, fragments?: WhereFragments<T>, reservedParams?: number) => T | undefined;
1146
1198
  declare const quoteIdentifier: (name: string) => string;
1147
1199
  declare const serializeSqlValue: (value: unknown) => unknown;
1148
1200
  declare const DOC_COLUMN = "__doc__";
@@ -1850,6 +1902,11 @@ declare const clearCapturedMail: (sql: SqlExec) => {
1850
1902
  declare class NotFoundError extends LunoraError {
1851
1903
  constructor(message?: string);
1852
1904
  }
1905
+ declare const operatorFields: (definition: TableDefinitionLike, patch: Record<string, unknown>) => ReadonlySet<string>;
1906
+ declare const resolvePatch: (definition: TableDefinitionLike, patch: Record<string, unknown>, current: Record<string, unknown>) => Record<string, unknown>;
1907
+ declare const patchDependsOnRow: (definition: TableDefinitionLike, patch: Record<string, unknown>) => boolean;
1908
+ declare const assertPatchAllowed: (options: PatchWriteOptions | undefined, previous: Record<string, unknown>, next: Record<string, unknown>) => void;
1909
+ declare const readPatchField: (document: Record<string, unknown>, field: string) => unknown;
1853
1910
  interface PitrStorage {
1854
1911
  getBookmarkForTime?: (time: Date | number) => Promise<string>;
1855
1912
  getCurrentBookmark?: () => Promise<string>;
@@ -1883,6 +1940,8 @@ interface OrderKeyConstraints {
1883
1940
  pinned?: ReadonlySet<string>;
1884
1941
  uniqueBy?: ReadonlyArray<ReadonlyArray<string>>;
1885
1942
  }
1943
+ declare const nullsFirstOf: (key: Pick<OrderKey, "direction" | "nulls">) => boolean;
1944
+ declare const nullsOrderSuffix: (nullsFirst: boolean) => string;
1886
1945
  declare const normalizeOrderKeys: (orderBy: OrderByInput[] | undefined, shape?: Record<string, ValidatorLike>, constraints?: OrderKeyConstraints) => OrderKey[];
1887
1946
  declare const CURSOR_PREFIX = "~4";
1888
1947
  declare const encodeCursor: (record: Record<string, unknown>, keys: OrderKey[]) => string;
@@ -2031,6 +2090,12 @@ declare const isRelationPredicate: (value: unknown) => value is Record<string, W
2031
2090
  declare const containsRelationPredicate: (where: WhereInput, schema: ResolveContext["schema"], tableName: string) => boolean;
2032
2091
  declare const assertFlatPredicate: (where: WhereInput | undefined, schema: ResolveContext["schema"], tableName: string, op: string) => void;
2033
2092
  declare const resolveRelationPredicates: (where: WhereInput | undefined, options: ResolveRelationPredicatesOptions) => Promise<WhereInput | undefined>;
2093
+ declare const composeReadPredicate: (definition: TableDefinitionLike, args: QueryArgs, relation: Omit<ResolveRelationPredicatesOptions, "relationBaseWhere">) => Promise<{
2094
+ fetchLimit: number | undefined;
2095
+ limit: number | undefined;
2096
+ orderKeys: OrderKey[];
2097
+ predicate: WhereInput | undefined;
2098
+ }>;
2034
2099
  declare const assertShapeShardable: (effectiveWhere: WhereInput | undefined, schema: ResolveContext["schema"], table: string) => void;
2035
2100
  declare const relationHooks: (args: Pick<QueryArgs, "relationBaseWhere" | "relationMask">) => Pick<QueryArgs, "relationBaseWhere" | "relationMask"> & Pick<ResolveWithOptions, "fanOutBudget">;
2036
2101
  declare const fanOutScalarCounts: (counter: (tableName: string, where?: WhereInput) => Promise<number>, tableName: string, whereField: string, values: unknown[], policyWhere: WhereInput | undefined) => Promise<Map<unknown, number>>;
@@ -2506,25 +2571,4 @@ declare const backfillVectorIndexes: (sql: SqlExec, targets: ReadonlyArray<Vecto
2506
2571
  ordered: OrderedAfterWrites;
2507
2572
  restart?: boolean;
2508
2573
  }) => Promise<VectorBackfillProgress>;
2509
- interface WhereFragments<T> {
2510
- binary: (reference: T, comparator: string, value: unknown) => T;
2511
- connect: (left: T, right: T, connector: "AND" | "OR") => T;
2512
- constant: (value: boolean) => T;
2513
- contains: (reference: T, term: T) => T;
2514
- inList: (reference: T, items: ReadonlyArray<unknown>, negated: boolean, budget: number) => T;
2515
- negate: (inner: T) => T;
2516
- nullCheck: (reference: T, negated: boolean) => T;
2517
- value: (value: unknown) => T;
2518
- }
2519
- type FieldRefSql<T> = (field: string) => T;
2520
- type SerializeValue = (value: unknown, field: string) => unknown;
2521
- interface WhereSqlStrategy<T = SQL> {
2522
- containsExpr?: (reference: T, term: T) => T;
2523
- fieldRef: FieldRefSql<T>;
2524
- inList?: (reference: T, items: ReadonlyArray<unknown>, negated: boolean, budget?: number) => T;
2525
- relationExists?: (request: unknown) => T;
2526
- serialize: SerializeValue;
2527
- }
2528
- declare const serverInList: (engine: "mysql" | "postgres") => (reference: SQL, items: ReadonlyArray<unknown>, negated: boolean, budget?: number) => SQL;
2529
- declare const compileWhereSql: <T = SQL>(where: WhereInput | undefined, strategy: WhereSqlStrategy<T>, fragments?: WhereFragments<T>, reservedParams?: number) => T | undefined;
2530
- 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, clearCompanionSignatures, 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 };
2574
+ 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 NullPlacement, type OnDeleteActionLike, type OrderByClause, type OrderByInput, type OrderKey, type OrderKeyConstraints, OwnerRelay, type OwnerRelayFrame, type PaginationOptions, type PatchVerifier, type PatchWriteOptions, type PitrBookmarkResult, type PitrRestoreArgs, type PitrRestoreResult, type PitrStorage, type PokeFrameMeta, type PromotionState, type PromotionThresholds, QUEUE_TABLE, type QueryArgs, type QueryPage, type QueryPlan, 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 RangeOperandType, 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 RelationWriteInfo, type RelationWriteMap, 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, assertPatchAllowed, 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, clearCompanionSignatures, clearMemoryTables, clearQueueMessages, coerceAggregateNumber, compactCdcDocs, compileWhereSql, composeReadPredicate, 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, describeRelationWrites, 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, nullsFirstOf, nullsOrderSuffix, operatorFields, param, parkScheduleOutbox, parseExportShardArgs, parseImportShardArgs, patchDependsOnRow, 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, readPatchField, readQueueMessageById, readQueueMessages, readReactorState, readSchemaHistory, readSchemaVersion, readSearchBackfillState, readShapePokeCursor, readStreamChunks, readStreamRun, readTablePage, recordCapturedMail, recordChangedKeys, recordFanoutPass, recordGlobalPollPass, recordQueueMessages, recordScheduleOutbox, recordSchemaVersion, recordShapeProbePass, relationHooks, relayCountFor, renderSql, reprojectableFields, reprojectionMigrationId, reprojectionTables, resolvePatch, 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 };
package/dist/index.d.ts CHANGED
@@ -22,6 +22,16 @@ declare const indexKeysForRow: (indexes: ReadonlyArray<{
22
22
  name: string;
23
23
  }>, row: Record<string, unknown>, serialize: (value: unknown) => unknown) => IndexKeyEntry[];
24
24
  declare const keysTouchRanges: (ranges: ReadonlyArray<KeyRange> | undefined, keys: ReadonlyArray<IndexKeyEntry> | undefined) => boolean;
25
+ interface RelationWriteInfo {
26
+ readonly colocated: boolean;
27
+ readonly field: string;
28
+ readonly kind: "many" | "one";
29
+ readonly nullable: boolean;
30
+ readonly references: string;
31
+ readonly table: string;
32
+ }
33
+ type RelationWriteMap = Readonly<Record<string, Readonly<Record<string, RelationWriteInfo>>>>;
34
+ declare const describeRelationWrites: (schema: SchemaLike) => RelationWriteMap;
25
35
  type SystemTableName = "_scheduled_functions" | "_storage";
26
36
  interface ScheduledFunctionDoc {
27
37
  args: Record<string, unknown>;
@@ -210,6 +220,7 @@ interface ValidatorLike {
210
220
  readonly column?: ColumnMetaLike;
211
221
  readonly inner?: ValidatorLike;
212
222
  readonly members?: ReadonlyArray<ValidatorLike>;
223
+ readonly shape?: Readonly<Record<string, ValidatorLike>>;
213
224
  readonly tableName?: string;
214
225
  readonly value?: unknown;
215
226
  };
@@ -253,6 +264,10 @@ interface SchemaLike {
253
264
  readonly rlsMode?: "required";
254
265
  readonly tables: Record<string, TableDefinitionLike>;
255
266
  }
267
+ type PatchVerifier = (previous: Record<string, unknown>, next: Record<string, unknown>) => boolean;
268
+ interface PatchWriteOptions {
269
+ verify?: PatchVerifier;
270
+ }
256
271
  interface TableDefinitionLike {
257
272
  readonly aggregateIndexes?: ReadonlyArray<AggregateIndexDefinitionLike>;
258
273
  readonly commitOrderedMode?: boolean;
@@ -319,7 +334,11 @@ interface ResolveWithResult {
319
334
  rows: Record<string, unknown>[];
320
335
  }
321
336
  type SortDirection = "asc" | "desc";
322
- type OrderByInput = Record<string, SortDirection>;
337
+ type NullPlacement = "first" | "last";
338
+ type OrderByInput = Record<string, SortDirection | {
339
+ nulls: NullPlacement;
340
+ sort: SortDirection;
341
+ }>;
323
342
  interface QueryArgs {
324
343
  baseWhere?: WhereInput;
325
344
  cursor?: null | string;
@@ -341,6 +360,11 @@ interface CrossShardReadArgs {
341
360
  with?: WithInput;
342
361
  }
343
362
  type RelationMask = (table: string, rows: Record<string, unknown>[]) => Record<string, unknown>[];
363
+ interface QueryPlan {
364
+ params: unknown[];
365
+ plan: string[];
366
+ sql: string;
367
+ }
344
368
  interface QueryPage {
345
369
  continueCursor: null | string;
346
370
  isDone: boolean;
@@ -388,6 +412,7 @@ interface OrderKey {
388
412
  direction: SortDirection;
389
413
  field: string;
390
414
  nullable: boolean;
415
+ nulls?: NullPlacement;
391
416
  }
392
417
  interface RestrictableQueryOptions {
393
418
  baseWhere?: WhereInput;
@@ -536,6 +561,7 @@ interface MutationDelta {
536
561
  interface DatabaseWriterLike {
537
562
  aggregate: (tableName: string, options: AggregateOptions) => Promise<AggregateResult>;
538
563
  asId?: (tableName: string, id: string) => string;
564
+ assertPatchAllowed?: (id: string, expectedTable?: string) => Promise<void>;
539
565
  cdcChangedTables?: (sinceSeq: number, options?: {
540
566
  cursorOnly?: boolean;
541
567
  }) => Promise<{
@@ -563,6 +589,7 @@ interface DatabaseWriterLike {
563
589
  }) => Promise<{
564
590
  deleted: number;
565
591
  }>;
592
+ explain: (tableName: string, args?: QueryArgs) => Promise<QueryPlan>;
566
593
  findFirst: (tableName: string, args?: QueryArgs) => Promise<Record<string, unknown> | null>;
567
594
  findFirstOrThrow: (tableName: string, args?: QueryArgs) => Promise<Record<string, unknown>>;
568
595
  findMany: (tableName: string, args?: QueryArgs) => Promise<QueryPage>;
@@ -585,9 +612,10 @@ interface DatabaseWriterLike {
585
612
  tableName: string;
586
613
  }>;
587
614
  normalizeId: (tableName: string, id: string) => null | string;
588
- patch: (id: string, patch: Record<string, unknown>, expectedTable?: string) => Promise<void>;
615
+ patch: (id: string, patch: Record<string, unknown>, expectedTable?: string, options?: PatchWriteOptions) => Promise<void>;
589
616
  patchIf?: (tableName: string, id: string, args: {
590
617
  patch: Record<string, unknown>;
618
+ verify?: PatchVerifier;
591
619
  where: WhereInput;
592
620
  }) => Promise<{
593
621
  applied: boolean;
@@ -616,6 +644,7 @@ interface DatabaseWriterLike {
616
644
  rankPageRows?: (tableName: string, indexName: string, options?: RankPageOptions) => Promise<ShardRankPageResult>;
617
645
  related?: (start: RelatedStart, options?: RelatedOptions) => Promise<RelatedPage>;
618
646
  relationEdges?: ReadonlyArray<RelationEdge>;
647
+ relationWrites?: RelationWriteMap;
619
648
  replace: (id: string, document: Record<string, unknown>, expectedTable?: string, options?: {
620
649
  allowExplicitId?: boolean;
621
650
  }) => Promise<void>;
@@ -1143,6 +1172,29 @@ interface DependencyTracker {
1143
1172
  declare const createDependencyTracker: () => DependencyTracker;
1144
1173
  declare const runSql: <Row = Record<string, unknown>>(sql: SqlExec, query: string, ...params: unknown[]) => SqlCursor<Row>;
1145
1174
  declare const runDrizzle: <Row = Record<string, unknown>>(exec: SqlExec, query: SQL) => SqlCursor<Row>;
1175
+ type RangeOperandType = "boolean" | "number" | "string";
1176
+ interface WhereFragments<T> {
1177
+ binary: (reference: T, comparator: string, value: unknown) => T;
1178
+ connect: (left: T, right: T, connector: "AND" | "OR") => T;
1179
+ constant: (value: boolean) => T;
1180
+ contains: (reference: T, term: T) => T;
1181
+ inList: (reference: T, items: ReadonlyArray<unknown>, negated: boolean, budget: number) => T;
1182
+ negate: (inner: T) => T;
1183
+ nullCheck: (reference: T, negated: boolean) => T;
1184
+ value: (value: unknown) => T;
1185
+ }
1186
+ type FieldRefSql<T> = (field: string) => T;
1187
+ type SerializeValue = (value: unknown, field: string) => unknown;
1188
+ interface WhereSqlStrategy<T = SQL> {
1189
+ containsExpr?: (reference: T, term: T) => T;
1190
+ fieldRef: FieldRefSql<T>;
1191
+ inList?: (reference: T, items: ReadonlyArray<unknown>, negated: boolean, budget?: number) => T;
1192
+ rangeTypeGuard: (field: string, type: RangeOperandType) => T;
1193
+ relationExists?: (request: unknown) => T;
1194
+ serialize: SerializeValue;
1195
+ }
1196
+ declare const serverInList: (engine: "mysql" | "postgres") => (reference: SQL, items: ReadonlyArray<unknown>, negated: boolean, budget?: number) => SQL;
1197
+ declare const compileWhereSql: <T = SQL>(where: WhereInput | undefined, strategy: WhereSqlStrategy<T>, fragments?: WhereFragments<T>, reservedParams?: number) => T | undefined;
1146
1198
  declare const quoteIdentifier: (name: string) => string;
1147
1199
  declare const serializeSqlValue: (value: unknown) => unknown;
1148
1200
  declare const DOC_COLUMN = "__doc__";
@@ -1850,6 +1902,11 @@ declare const clearCapturedMail: (sql: SqlExec) => {
1850
1902
  declare class NotFoundError extends LunoraError {
1851
1903
  constructor(message?: string);
1852
1904
  }
1905
+ declare const operatorFields: (definition: TableDefinitionLike, patch: Record<string, unknown>) => ReadonlySet<string>;
1906
+ declare const resolvePatch: (definition: TableDefinitionLike, patch: Record<string, unknown>, current: Record<string, unknown>) => Record<string, unknown>;
1907
+ declare const patchDependsOnRow: (definition: TableDefinitionLike, patch: Record<string, unknown>) => boolean;
1908
+ declare const assertPatchAllowed: (options: PatchWriteOptions | undefined, previous: Record<string, unknown>, next: Record<string, unknown>) => void;
1909
+ declare const readPatchField: (document: Record<string, unknown>, field: string) => unknown;
1853
1910
  interface PitrStorage {
1854
1911
  getBookmarkForTime?: (time: Date | number) => Promise<string>;
1855
1912
  getCurrentBookmark?: () => Promise<string>;
@@ -1883,6 +1940,8 @@ interface OrderKeyConstraints {
1883
1940
  pinned?: ReadonlySet<string>;
1884
1941
  uniqueBy?: ReadonlyArray<ReadonlyArray<string>>;
1885
1942
  }
1943
+ declare const nullsFirstOf: (key: Pick<OrderKey, "direction" | "nulls">) => boolean;
1944
+ declare const nullsOrderSuffix: (nullsFirst: boolean) => string;
1886
1945
  declare const normalizeOrderKeys: (orderBy: OrderByInput[] | undefined, shape?: Record<string, ValidatorLike>, constraints?: OrderKeyConstraints) => OrderKey[];
1887
1946
  declare const CURSOR_PREFIX = "~4";
1888
1947
  declare const encodeCursor: (record: Record<string, unknown>, keys: OrderKey[]) => string;
@@ -2031,6 +2090,12 @@ declare const isRelationPredicate: (value: unknown) => value is Record<string, W
2031
2090
  declare const containsRelationPredicate: (where: WhereInput, schema: ResolveContext["schema"], tableName: string) => boolean;
2032
2091
  declare const assertFlatPredicate: (where: WhereInput | undefined, schema: ResolveContext["schema"], tableName: string, op: string) => void;
2033
2092
  declare const resolveRelationPredicates: (where: WhereInput | undefined, options: ResolveRelationPredicatesOptions) => Promise<WhereInput | undefined>;
2093
+ declare const composeReadPredicate: (definition: TableDefinitionLike, args: QueryArgs, relation: Omit<ResolveRelationPredicatesOptions, "relationBaseWhere">) => Promise<{
2094
+ fetchLimit: number | undefined;
2095
+ limit: number | undefined;
2096
+ orderKeys: OrderKey[];
2097
+ predicate: WhereInput | undefined;
2098
+ }>;
2034
2099
  declare const assertShapeShardable: (effectiveWhere: WhereInput | undefined, schema: ResolveContext["schema"], table: string) => void;
2035
2100
  declare const relationHooks: (args: Pick<QueryArgs, "relationBaseWhere" | "relationMask">) => Pick<QueryArgs, "relationBaseWhere" | "relationMask"> & Pick<ResolveWithOptions, "fanOutBudget">;
2036
2101
  declare const fanOutScalarCounts: (counter: (tableName: string, where?: WhereInput) => Promise<number>, tableName: string, whereField: string, values: unknown[], policyWhere: WhereInput | undefined) => Promise<Map<unknown, number>>;
@@ -2506,25 +2571,4 @@ declare const backfillVectorIndexes: (sql: SqlExec, targets: ReadonlyArray<Vecto
2506
2571
  ordered: OrderedAfterWrites;
2507
2572
  restart?: boolean;
2508
2573
  }) => Promise<VectorBackfillProgress>;
2509
- interface WhereFragments<T> {
2510
- binary: (reference: T, comparator: string, value: unknown) => T;
2511
- connect: (left: T, right: T, connector: "AND" | "OR") => T;
2512
- constant: (value: boolean) => T;
2513
- contains: (reference: T, term: T) => T;
2514
- inList: (reference: T, items: ReadonlyArray<unknown>, negated: boolean, budget: number) => T;
2515
- negate: (inner: T) => T;
2516
- nullCheck: (reference: T, negated: boolean) => T;
2517
- value: (value: unknown) => T;
2518
- }
2519
- type FieldRefSql<T> = (field: string) => T;
2520
- type SerializeValue = (value: unknown, field: string) => unknown;
2521
- interface WhereSqlStrategy<T = SQL> {
2522
- containsExpr?: (reference: T, term: T) => T;
2523
- fieldRef: FieldRefSql<T>;
2524
- inList?: (reference: T, items: ReadonlyArray<unknown>, negated: boolean, budget?: number) => T;
2525
- relationExists?: (request: unknown) => T;
2526
- serialize: SerializeValue;
2527
- }
2528
- declare const serverInList: (engine: "mysql" | "postgres") => (reference: SQL, items: ReadonlyArray<unknown>, negated: boolean, budget?: number) => SQL;
2529
- declare const compileWhereSql: <T = SQL>(where: WhereInput | undefined, strategy: WhereSqlStrategy<T>, fragments?: WhereFragments<T>, reservedParams?: number) => T | undefined;
2530
- 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, clearCompanionSignatures, 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 };
2574
+ 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 NullPlacement, type OnDeleteActionLike, type OrderByClause, type OrderByInput, type OrderKey, type OrderKeyConstraints, OwnerRelay, type OwnerRelayFrame, type PaginationOptions, type PatchVerifier, type PatchWriteOptions, type PitrBookmarkResult, type PitrRestoreArgs, type PitrRestoreResult, type PitrStorage, type PokeFrameMeta, type PromotionState, type PromotionThresholds, QUEUE_TABLE, type QueryArgs, type QueryPage, type QueryPlan, 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 RangeOperandType, 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 RelationWriteInfo, type RelationWriteMap, 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, assertPatchAllowed, 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, clearCompanionSignatures, clearMemoryTables, clearQueueMessages, coerceAggregateNumber, compactCdcDocs, compileWhereSql, composeReadPredicate, 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, describeRelationWrites, 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, nullsFirstOf, nullsOrderSuffix, operatorFields, param, parkScheduleOutbox, parseExportShardArgs, parseImportShardArgs, patchDependsOnRow, 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, readPatchField, readQueueMessageById, readQueueMessages, readReactorState, readSchemaHistory, readSchemaVersion, readSearchBackfillState, readShapePokeCursor, readStreamChunks, readStreamRun, readTablePage, recordCapturedMail, recordChangedKeys, recordFanoutPass, recordGlobalPollPass, recordQueueMessages, recordScheduleOutbox, recordSchemaVersion, recordShapeProbePass, relationHooks, relayCountFor, renderSql, reprojectableFields, reprojectionMigrationId, reprojectionTables, resolvePatch, 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 };
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{exportShardRows as o,importShardRows as a,parseExportShardArgs as t,parseImportShardArgs as i,selectExportTables as n,validateImportRow as s}from"./packem_shared/exportShardRows-CTDgQEF8.mjs";import{AGGREGATE_SQL_FUNCTION as d,aggregateSqlFunction as c,matchesStaticWhere as m,normalizeCountArgument as p,throwingScheduler as S}from"./packem_shared/AGGREGATE_SQL_FUNCTION-DDEoMnJR.mjs";import{aggregateTableName as f,coerceAggregateNumber as x,encodeAggregateKey as E,foldAggregateTally as h,readAggregateValue as T}from"./packem_shared/aggregateTableName-DbAttCNH.mjs";import{CountRlsUnsupportedError as R,mergeWhere as A,planAggregateLookup as g,selectIndexForAggregate as _,selectIndexForCount as I,selectIndexForGroupBy as b}from"./packem_shared/CountRlsUnsupportedError-BvsDqfO2.mjs";import{AUDIT_LOG_TABLE as D,appendAuditEntry as P,ensureAuditTable as O,readAuditLog as M}from"./packem_shared/AUDIT_LOG_TABLE-CZNxCRLv.mjs";import{NotUniqueError as y,assertNoExplicitUndefined as N,assertValidClientId as k,createShardCtxDb as B,normalizeIdStructurally as U,stripReservedPatchFields as G}from"./packem_shared/NotUniqueError-thbeLn0g.mjs";import{backfillAggregateIndexes as w,backfillRankIndexes as K,backfillSearchIndexes as v,backfillSearchIndexesForTable as W}from"./packem_shared/backfillAggregateIndexes-B1yVAkvK.mjs";import{CDC_LOG_TABLE as H,CDC_LOG_TABLE_SEQ_INDEX as V,CDC_META_TABLE as z,appendCdcChange as Q,applyCdcChanges as Y,bumpCdcEpoch as j,cdcCanVouchFor as J,cdcForkedError as Z,cdcSeqLeavingRows as $,cdcTouchesTables as ee,cdcTrimmedError as re,compactCdcDocs as oe,cursorBelowRetainedFloor as ae,migrateCdcLog as te,migrateCdcMeta as ie,minCdcReplayableSeq as ne,minCdcSeq as se,readCdcChangeKeys as le,readCdcChanges as de,readCdcCursor as ce,readCdcEpoch as me,trimCdcChanges as pe}from"./packem_shared/CDC_LOG_TABLE-GKlDpuM2.mjs";import{archiveCdcSegment as ue,cdcArchiveRewound as fe,readArchivedCdcChanges as xe,readCdcArchivedThrough as Ee,writeCdcArchivedThrough as he}from"./packem_shared/archiveCdcSegment-BON69Nug.mjs";import{CLIENT_WATERMARK_TABLE as Ce,advanceClientWatermark as Re,migrateClientWatermark as Ae,readClientWatermark as ge}from"./packem_shared/CLIENT_WATERMARK_TABLE-vLjfNhBR.mjs";import{COMMIT_SEQ_FIELD as Ie,COMMIT_SEQ_TABLE as be,allocateCommitSeq as Le,migrateCommitSeq as De,readCommitSeq as Pe}from"./packem_shared/COMMIT_SEQ_FIELD-BY_vc9bw.mjs";import{clearCompanionSignatures as Me}from"./packem_shared/clearCompanionSignatures-C2CSfkeQ.mjs";import{createCompanionSync as ye}from"./packem_shared/createCompanionSync-hGCzG0O1.mjs";import{GLOBAL_SHAPE_SNAPSHOT_TABLE as ke,deleteGlobalShapeSnapshot as Be,deleteGlobalShapeSnapshotsForConnection as Ue,migrateGlobalShapeSnapshot as Ge,readGlobalShapeSnapshot as qe,writeGlobalShapeSnapshot as we}from"./packem_shared/GLOBAL_SHAPE_SNAPSHOT_TABLE-pMxZ-obU.mjs";import{IDEMPOTENCY_TABLE as ve,migrateIdempotency as We,readIdempotent as Xe,trimIdempotent as He,writeIdempotent as Ve}from"./packem_shared/IDEMPOTENCY_TABLE-AOJCuq5U.mjs";import{clearMemoryTables as Qe,isMemoryTable as Ye,memoryTableNames as je}from"./packem_shared/clearMemoryTables-CogAvVHR.mjs";import{computeRankPage as Ze,resolveRankSeekTuple as $e}from"./packem_shared/computeRankPage-BI2lNKPu.mjs";import{SCHEDULE_OUTBOX_TABLE as rr,deferScheduleOutbox as or,forgetScheduleOutbox as ar,migrateScheduleOutbox as tr,parkScheduleOutbox as ir,probeScheduleOutbox as nr,readDueScheduleOutbox as sr,recordScheduleOutbox as lr,trimScheduleOutbox as dr}from"./packem_shared/SCHEDULE_OUTBOX_TABLE-CgLvGxpY.mjs";import{S as mr,m as pr,r as Sr,w as ur}from"./packem_shared/ctx-db-search-state-DVCp4JQf.mjs";import{SHAPE_POKE_CURSOR_TABLE as xr,deleteShapePokeCursor as Er,deleteShapePokeCursorsForConnection as hr,migrateShapePokeCursor as Tr,minShapePokeCursor as Cr,readShapePokeCursor as Rr,writeShapePokeCursor as Ar,writeShapePokeCursors as gr}from"./packem_shared/SHAPE_POKE_CURSOR_TABLE-cn0stGAL.mjs";import{selectShapeMembers as Ir,selectShapeRows as br}from"./packem_shared/selectShapeMembers-CNpeUQ-H.mjs";import{DATA_MIGRATION_STATE_TABLE as Dr,readMigrationStatus as Pr,runDataMigration as Or}from"./packem_shared/DATA_MIGRATION_STATE_TABLE-DfqA-2Dj.mjs";import{SCAN_DEP as Fr,createDependencyTracker as yr,depKey as Nr,tableFromDepKey as kr}from"./packem_shared/SCAN_DEP-D7qE3iUe.mjs";import{runDrizzle as Ur,runSql as Gr}from"./packem_shared/runDrizzle-Du5HLitO.mjs";import{A as wr,a as Kr,b as vr,D as Wr,c as Xr,d as Hr,g as Vr,i as zr,j as Qr,e as Yr,q as jr,f as Jr,r as Zr,t as $r,h as eo}from"./packem_shared/do-sql-CyWszGdM.mjs";import{WORKERD_SQLITE_LIMITS as oo,param as ao,renderSql as to,sqliteInList as io,unionAll as no}from"./packem_shared/WORKERD_SQLITE_LIMITS-DBH23L_S.mjs";import{appendStreamChunk as lo,claimStreamRun as co,deleteStreamRun as mo,finishStreamRun as po,migrateDurableStreams as So,readStreamChunks as uo,readStreamRun as fo,trimStreamRuns as xo}from"./packem_shared/appendStreamChunk-7ZyAZGg_.mjs";import{DurableStreamRunner as ho,MAX_DURABLE_STREAM_BYTES as To,MAX_DURABLE_STREAM_CHUNKS as Co,decideDurableAttach as Ro}from"./packem_shared/DurableStreamRunner-y2CRbfuZ.mjs";import{envOptionalPositiveInt as go,envPositiveInt as _o}from"./packem_shared/envOptionalPositiveInt-D2pY-c64.mjs";import{diffExternalSource as bo}from"./packem_shared/diffExternalSource-DgDJhslq.mjs";import{liftSourceId as Do,normalizeSourceDocument as Po,normalizeSourceValue as Oo}from"./packem_shared/liftSourceId-CA3ENhXj.mjs";import{materializeExternalRows as Fo,materializeExternalRowsIncremental as yo,readExternalSourceBaseline as No,runExternalSourceTick as ko}from"./packem_shared/materializeExternalRows-Csa8ELkU.mjs";import{isSoftDeleted as Uo,isSourceDue as Go,pullExternalSourceIncrementalTick as qo,pullExternalSourceTick as wo}from"./packem_shared/isSoftDeleted-BHlFkAsr.mjs";import{f as vo,a as Wo,b as Xo,c as Ho,d as Vo,g as zo}from"./packem_shared/fts-companion-pUdD6kF-.mjs";import{GEO_DEFAULT_PRECISION as Yo,boundingBoxCenter as jo,boundingBoxGeohashes as Jo,coveringGeohashes as Zo,encodeGeohash as $o,haversineMeters as ea,pointInBoundingBox as ra}from"./packem_shared/GEO_DEFAULT_PRECISION-CqpQZ-J_.mjs";import{default as aa}from"./packem_shared/GlobalPollTick-BNK4o-XT.mjs";import{ADMIN_FUNCTIONS as ia,ADMIN_FUNCTION_PREFIX as na,DEFAULT_FANOUT_TOPIC_LIMIT as sa,FLAGS_FUNCTION_PREFIX as la,MAX_PAGE_SIZE as da,RELATION_FUNCTION_PREFIX as ca,createFanoutCounters as ma,createGlobalPollCounters as pa,createShapeProbeCounters as Sa,facetColumn as ua,findStorageReferences as fa,isVacuousFilterClause as xa,listTables as Ea,readTablePage as ha,recordFanoutPass as Ta,recordGlobalPollPass as Ca,recordShapeProbePass as Ra,selectMatchingIds as Aa,summarizeFanoutTopics as ga,summarizeSubscriptions as _a}from"./packem_shared/ADMIN_FUNCTIONS-BGXP6oxh.mjs";import{MAIL_RETENTION as ba,MAIL_TABLE as La,clearCapturedMail as Da,ensureMailTable as Pa,readCapturedMail as Oa,recordCapturedMail as Ma}from"./packem_shared/MAIL_RETENTION-BxAGL3hK.mjs";import{NotFoundError as ya}from"./packem_shared/NotFoundError-BhF7FeFr.mjs";import{armRestore as ka,readBookmark as Ba}from"./packem_shared/armRestore-Bu1_8SUa.mjs";import{CURSOR_PREFIX as Ga,applySelect as qa,buildSeekBeforeWhere as wa,buildSeekWhere as Ka,decodeCursor as va,encodeCursor as Wa,equalityPinnedFields as Xa,normalizeOrderKeys as Ha,softDeleteScope as Va,tiebreakDirectionFor as za,uniqueIndexFields as Qa}from"./packem_shared/CURSOR_PREFIX-C1jsjAPd.mjs";import{QUEUE_TABLE as ja,clearQueueMessages as Ja,isLossyBody as Za,readQueueMessageById as $a,readQueueMessages as et,recordQueueMessages as rt}from"./packem_shared/QUEUE_TABLE-DKANxmEZ.mjs";import{RANK_TIEBREAK as at,encodePartitionKey as tt,matchesRankStaticWhere as it,rankKeyFromDoc as nt,rankPivotConditionSql as st,rankTableName as lt,resolveRankPartition as dt,sortColumnName as ct}from"./packem_shared/RANK_TIEBREAK-DrISKVKe.mjs";import{ReactiveCache as pt,reactiveCacheKey as St}from"./packem_shared/ReactiveCache-Bdzsahf3.mjs";import{REACTOR_STATE_TABLE as ft,listReactorStates as xt,migrateReactorState as Et,reactorNeedsRun as ht,readReactorState as Tt,writeReactorState as Ct}from"./packem_shared/REACTOR_STATE_TABLE-B8IehLv8.mjs";import{UNVOUCHABLE_DEP as At,createReadFootprint as gt,markUnvouchableReads as _t}from"./packem_shared/UNVOUCHABLE_DEP-C68htACn.mjs";import{buildIndexRange as bt,indexKeysForRow as Lt,keysTouchRanges as Dt}from"./packem_shared/buildIndexRange-6nIZDf4m.mjs";import{isPushableWhere as Ot,whereFilter as Mt,whereOfFilter as Ft}from"./packem_shared/isPushableWhere-BeYAOjUb.mjs";import{RELATED_DEFAULT_LIMIT as Nt,RELATED_DEPTH_DECAY as kt,RELATED_MAX_DEPTH as Bt,RELATED_MAX_LIMIT as Ut,deriveRelationEdges as Gt,findRelated as qt}from"./packem_shared/RELATED_DEFAULT_LIMIT-e7viSuiO.mjs";import{DEFAULT_MAX_RELATION_KEYS as Kt,assertFlatPredicate as vt,assertShapeShardable as Wt,containsRelationPredicate as Xt,isRelationPredicate as Ht,resolveRelationPredicates as Vt}from"./packem_shared/DEFAULT_MAX_RELATION_KEYS-CQLms3UG.mjs";import{applyOnDelete as Qt,distinctValues as Yt,fanOutScalarCounts as jt,relationHooks as Jt,resolveWith as Zt,runRowValidators as $t}from"./packem_shared/applyOnDelete-8n5PzcI0.mjs";import{DEFAULT_PROMOTION_THRESHOLDS as ri,clampPromotionThresholds as oi,nextPromotionState as ai,relayCountFor as ti,shapeRoutingKey as ii}from"./packem_shared/DEFAULT_PROMOTION_THRESHOLDS-DEURXMvk.mjs";import{DEFAULT_MAX_RELAYS as si,OwnerRelay as li,RelayMember as di,createRelayLink as ci}from"./packem_shared/DEFAULT_MAX_RELAYS-BqSpObEl.mjs";import{createReplicaLink as pi,gateReplicaDispatch as Si,handleReplicaControl as ui}from"./packem_shared/createReplicaLink-CJn5lH0o.mjs";import{buildReprojectionMigration as xi,countLegacyRows as Ei,reprojectableFields as hi,reprojectionTables as Ti}from"./packem_shared/buildReprojectionMigration-BnUbAUwT.mjs";import{RLS_UNWRAP_SYMBOL as Ri,RlsRequiredError as Ai,guardWriter as gi}from"./packem_shared/RLS_UNWRAP_SYMBOL-Dv9crDfv.mjs";import{SCHEMA_HISTORY_MAX_VERSIONS as Ii,readSchemaHistory as bi,readSchemaVersion as Li,recordSchemaVersion as Di}from"./packem_shared/SCHEMA_HISTORY_MAX_VERSIONS-BMcUIqBY.mjs";import{serializeSqlValue as Oi}from"./packem_shared/serializeSqlValue-BbZ5hKM7.mjs";import{buildSettings as Fi,isDevEnvironment as yi,readDeployInfo as Ni}from"./packem_shared/buildSettings-BRkZd6_E.mjs";import{buildShapeDiff as Bi}from"./packem_shared/buildShapeDiff-AxUzi_GL.mjs";import{ShapeDiffCache as Gi,createShapeDiffCache as qi,globalShapeReadKey as wi}from"./packem_shared/ShapeDiffCache-Br3kxusw.mjs";import{buildPokeFrames as vi,diffGlobalMembership as Wi,encodeRowsPatch as Xi,projectColumns as Hi}from"./packem_shared/buildPokeFrames-CDOP-XYp.mjs";import{ShardRunner as zi}from"./packem_shared/ShardRunner-CrveaPId.mjs";import{stubByName as Yi}from"./packem_shared/stubByName-C_P73AOx.mjs";import{runSocketPool as Ji}from"./packem_shared/runSocketPool-CZJ2X9cF.mjs";import{MAX_SQL_ROWS as $i,assertReadonly as en,lintReadonlySql as rn,runReadonlySql as on}from"./packem_shared/MAX_SQL_ROWS-Dh_Ty0Zo.mjs";import{BIGINT_KEY_DIGITS as tn,bigintSqlKey as nn,decodeBigintSqlKey as sn,decodeFloat64SqlKey as ln,float64SqlKey as dn}from"./packem_shared/BIGINT_KEY_DIGITS-C9a7Ix7k.mjs";import{awaitWsDrain as mn,subscriptionFrames as pn,subscriptionListDeltas as Sn,trySendFrame as un}from"./packem_shared/awaitWsDrain-D4E7Oiwo.mjs";import{mergeChangedKeys as xn,recordChangedKeys as En,writeTouchesMemo as hn}from"./packem_shared/mergeChangedKeys-DH9RAARR.mjs";import{createSystemReader as Cn}from"./packem_shared/createSystemReader-DcDLFfC-.mjs";import{ConflictError as An}from"./packem_shared/ConflictError-C8GtJmjS.mjs";import{DEFAULT_TRANSACTION_LIMITS as _n,TransactionHeadroomTracker as In}from"./packem_shared/DEFAULT_TRANSACTION_LIMITS-DiR5z5EX.mjs";import{hasTrigger as Ln,runTriggers as Dn}from"./packem_shared/hasTrigger-CjlwI4le.mjs";import{selectExpiredIds as On}from"./packem_shared/selectExpiredIds-5bAT7X28.mjs";import{VECTOR_BACKFILL_MAX_PAGES as Fn,backfillVectorIndexes as yn}from"./packem_shared/VECTOR_BACKFILL_MAX_PAGES-CO1Ra57t.mjs";import{c as kn,s as Bn}from"./packem_shared/where-sql-DFs8Zw7-.mjs";import{RELATION_EXISTS_KEY as Gn}from"./packem_shared/RELATION_EXISTS_KEY-CFUhnZSZ.mjs";import{REPROJECTION_MIGRATION_PREFIX as wn,reprojectionMigrationId as Kn}from"./packem_shared/REPROJECTION_MIGRATION_PREFIX-Czcb6_mO.mjs";import{isInternalTableName as Wn}from"./packem_shared/isInternalTableName-BoljO2tP.mjs";import{quoteIdentifier as Hn}from"./packem_shared/quoteIdentifier-CObIFRhb.mjs";import{runShardMigrations as zn}from"./packem_shared/runShardMigrations-3BBkjGHs.mjs";import{stableStringify as Yn}from"./packem_shared/stableStringify-DibjylKD.mjs";import{stableWireKey as Jn}from"./packem_shared/stableWireKey-Bdh5JSdg.mjs";export{ia as ADMIN_FUNCTIONS,na as ADMIN_FUNCTION_PREFIX,d as AGGREGATE_SQL_FUNCTION,wr as AGG_COUNT,Kr as AGG_KEY,vr as AGG_VALUE,D as AUDIT_LOG_TABLE,tn as BIGINT_KEY_DIGITS,H as CDC_LOG_TABLE,V as CDC_LOG_TABLE_SEQ_INDEX,z as CDC_META_TABLE,Ce as CLIENT_WATERMARK_TABLE,Ie as COMMIT_SEQ_FIELD,be as COMMIT_SEQ_TABLE,Ga as CURSOR_PREFIX,An as ConflictError,R as CountRlsUnsupportedError,Dr as DATA_MIGRATION_STATE_TABLE,sa as DEFAULT_FANOUT_TOPIC_LIMIT,Kt as DEFAULT_MAX_RELATION_KEYS,si as DEFAULT_MAX_RELAYS,ri as DEFAULT_PROMOTION_THRESHOLDS,_n as DEFAULT_TRANSACTION_LIMITS,Wr as DOC_COLUMN,ho as DurableStreamRunner,la as FLAGS_FUNCTION_PREFIX,Yo as GEO_DEFAULT_PRECISION,ke as GLOBAL_SHAPE_SNAPSHOT_TABLE,aa as GlobalPollTick,ve as IDEMPOTENCY_TABLE,ba as MAIL_RETENTION,La as MAIL_TABLE,To as MAX_DURABLE_STREAM_BYTES,Co as MAX_DURABLE_STREAM_CHUNKS,da as MAX_PAGE_SIZE,$i as MAX_SQL_ROWS,ya as NotFoundError,y as NotUniqueError,li as OwnerRelay,ja as QUEUE_TABLE,at as RANK_TIEBREAK,ft as REACTOR_STATE_TABLE,Nt as RELATED_DEFAULT_LIMIT,kt as RELATED_DEPTH_DECAY,Bt as RELATED_MAX_DEPTH,Ut as RELATED_MAX_LIMIT,Gn as RELATION_EXISTS_KEY,ca as RELATION_FUNCTION_PREFIX,wn as REPROJECTION_MIGRATION_PREFIX,Ri as RLS_UNWRAP_SYMBOL,pt as ReactiveCache,di as RelayMember,Ai as RlsRequiredError,Fr as SCAN_DEP,rr as SCHEDULE_OUTBOX_TABLE,Ii as SCHEMA_HISTORY_MAX_VERSIONS,mr as SEARCH_STATE_TABLE,xr as SHAPE_POKE_CURSOR_TABLE,Gi as ShapeDiffCache,zi as ShardRunner,In as TransactionHeadroomTracker,At as UNVOUCHABLE_DEP,Fn as VECTOR_BACKFILL_MAX_PAGES,oo as WORKERD_SQLITE_LIMITS,Re as advanceClientWatermark,Xr as aggUpsertSql,c as aggregateSqlFunction,f as aggregateTableName,Le as allocateCommitSeq,P as appendAuditEntry,Q as appendCdcChange,lo as appendStreamChunk,Y as applyCdcChanges,Qt as applyOnDelete,qa as applySelect,ue as archiveCdcSegment,ka as armRestore,vt as assertFlatPredicate,N as assertNoExplicitUndefined,en as assertReadonly,Wt as assertShapeShardable,k as assertValidClientId,mn as awaitWsDrain,w as backfillAggregateIndexes,K as backfillRankIndexes,v as backfillSearchIndexes,W as backfillSearchIndexesForTable,yn as backfillVectorIndexes,nn as bigintSqlKey,jo as boundingBoxCenter,Jo as boundingBoxGeohashes,bt as buildIndexRange,vi as buildPokeFrames,xi as buildReprojectionMigration,wa as buildSeekBeforeWhere,Ka as buildSeekWhere,Fi as buildSettings,Bi as buildShapeDiff,j as bumpCdcEpoch,fe as cdcArchiveRewound,J as cdcCanVouchFor,Z as cdcForkedError,$ as cdcSeqLeavingRows,ee as cdcTouchesTables,re as cdcTrimmedError,co as claimStreamRun,oi as clampPromotionThresholds,Da as clearCapturedMail,Me as clearCompanionSignatures,Qe as clearMemoryTables,Ja as clearQueueMessages,x as coerceAggregateNumber,oe as compactCdcDocs,kn as compileWhereSql,Ze as computeRankPage,Xt as containsRelationPredicate,Ei as countLegacyRows,Zo as coveringGeohashes,ye as createCompanionSync,yr as createDependencyTracker,ma as createFanoutCounters,pa as createGlobalPollCounters,Hr as createIndexSql,gt as createReadFootprint,ci as createRelayLink,pi as createReplicaLink,qi as createShapeDiffCache,Sa as createShapeProbeCounters,B as createShardCtxDb,Cn as createSystemReader,ae as cursorBelowRetainedFloor,Ro as decideDurableAttach,sn as decodeBigintSqlKey,va as decodeCursor,ln as decodeFloat64SqlKey,or as deferScheduleOutbox,Be as deleteGlobalShapeSnapshot,Ue as deleteGlobalShapeSnapshotsForConnection,Er as deleteShapePokeCursor,hr as deleteShapePokeCursorsForConnection,mo as deleteStreamRun,Nr as depKey,Gt as deriveRelationEdges,bo as diffExternalSource,Wi as diffGlobalMembership,Yt as distinctValues,E as encodeAggregateKey,Wa as encodeCursor,$o as encodeGeohash,tt as encodePartitionKey,Xi as encodeRowsPatch,O as ensureAuditTable,Pa as ensureMailTable,go as envOptionalPositiveInt,_o as envPositiveInt,Xa as equalityPinnedFields,o as exportShardRows,ua as facetColumn,jt as fanOutScalarCounts,qt as findRelated,fa as findStorageReferences,po as finishStreamRun,dn as float64SqlKey,h as foldAggregateTally,ar as forgetScheduleOutbox,vo as ftsCompanionDdl,Wo as ftsPurgeDocument,Xo as ftsRowidMapName,Ho as ftsUnmappedPage,Vo as ftsWriteDocument,Si as gateReplicaDispatch,Vr as geoTableName,wi as globalShapeReadKey,zo as groupUnmappedRows,gi as guardWriter,ui as handleReplicaControl,Ln as hasTrigger,ea as haversineMeters,a as importShardRows,Lt as indexKeysForRow,yi as isDevEnvironment,zr as isFtsAvailable,Wn as isInternalTableName,Za as isLossyBody,Ye as isMemoryTable,Ot as isPushableWhere,Ht as isRelationPredicate,Uo as isSoftDeleted,Go as isSourceDue,xa as isVacuousFilterClause,Qr as jsonPath,Yr as jsonPathSql,Dt as keysTouchRanges,Do as liftSourceId,rn as lintReadonlySql,xt as listReactorStates,Ea as listTables,_t as markUnvouchableReads,it as matchesRankStaticWhere,m as matchesStaticWhere,Fo as materializeExternalRows,yo as materializeExternalRowsIncremental,je as memoryTableNames,xn as mergeChangedKeys,A as mergeWhere,te as migrateCdcLog,ie as migrateCdcMeta,Ae as migrateClientWatermark,De as migrateCommitSeq,So as migrateDurableStreams,Ge as migrateGlobalShapeSnapshot,We as migrateIdempotency,Et as migrateReactorState,tr as migrateScheduleOutbox,pr as migrateSearchState,Tr as migrateShapePokeCursor,ne as minCdcReplayableSeq,se as minCdcSeq,Cr as minShapePokeCursor,ai as nextPromotionState,p as normalizeCountArgument,U as normalizeIdStructurally,Ha as normalizeOrderKeys,Po as normalizeSourceDocument,Oo as normalizeSourceValue,ao as param,ir as parkScheduleOutbox,t as parseExportShardArgs,i as parseImportShardArgs,g as planAggregateLookup,ra as pointInBoundingBox,nr as probeScheduleOutbox,Hi as projectColumns,qo as pullExternalSourceIncrementalTick,wo as pullExternalSourceTick,jr as qualifiedJsonPath,Jr as qualifiedJsonPathSql,Hn as quoteIdentifier,nt as rankKeyFromDoc,st as rankPivotConditionSql,lt as rankTableName,St as reactiveCacheKey,ht as reactorNeedsRun,T as readAggregateValue,xe as readArchivedCdcChanges,M as readAuditLog,Ba as readBookmark,Oa as readCapturedMail,Ee as readCdcArchivedThrough,le as readCdcChangeKeys,de as readCdcChanges,ce as readCdcCursor,me as readCdcEpoch,ge as readClientWatermark,Pe as readCommitSeq,Ni as readDeployInfo,sr as readDueScheduleOutbox,No as readExternalSourceBaseline,qe as readGlobalShapeSnapshot,Xe as readIdempotent,Pr as readMigrationStatus,$a as readQueueMessageById,et as readQueueMessages,Tt as readReactorState,bi as readSchemaHistory,Li as readSchemaVersion,Sr as readSearchBackfillState,Rr as readShapePokeCursor,uo as readStreamChunks,fo as readStreamRun,ha as readTablePage,Ma as recordCapturedMail,En as recordChangedKeys,Ta as recordFanoutPass,Ca as recordGlobalPollPass,rt as recordQueueMessages,lr as recordScheduleOutbox,Di as recordSchemaVersion,Ra as recordShapeProbePass,Jt as relationHooks,ti as relayCountFor,to as renderSql,hi as reprojectableFields,Kn as reprojectionMigrationId,Ti as reprojectionTables,dt as resolveRankPartition,$e as resolveRankSeekTuple,Vt as resolveRelationPredicates,Zt as resolveWith,Zr as rowToDocument,Or as runDataMigration,Ur as runDrizzle,ko as runExternalSourceTick,on as runReadonlySql,$t as runRowValidators,zn as runShardMigrations,Ji as runSocketPool,Gr as runSql,Dn as runTriggers,On as selectExpiredIds,n as selectExportTables,_ as selectIndexForAggregate,I as selectIndexForCount,b as selectIndexForGroupBy,Aa as selectMatchingIds,Ir as selectShapeMembers,br as selectShapeRows,Oi as serializeSqlValue,Bn as serverInList,ii as shapeRoutingKey,Va as softDeleteScope,ct as sortColumnName,io as sqliteInList,Yn as stableStringify,Jn as stableWireKey,G as stripReservedPatchFields,Yi as stubByName,pn as subscriptionFrames,Sn as subscriptionListDeltas,ga as summarizeFanoutTopics,_a as summarizeSubscriptions,$r as tableColumns,kr as tableFromDepKey,S as throwingScheduler,za as tiebreakDirectionFor,pe as trimCdcChanges,He as trimIdempotent,dr as trimScheduleOutbox,xo as trimStreamRuns,eo as tryRowToDocument,un as trySendFrame,no as unionAll,Qa as uniqueIndexFields,s as validateImportRow,Mt as whereFilter,Ft as whereOfFilter,he as writeCdcArchivedThrough,we as writeGlobalShapeSnapshot,Ve as writeIdempotent,Ct as writeReactorState,ur as writeSearchBackfillState,Ar as writeShapePokeCursor,gr as writeShapePokeCursors,hn as writeTouchesMemo};
1
+ import{exportShardRows as o,importShardRows as a,parseExportShardArgs as t,parseImportShardArgs as s,selectExportTables as i,validateImportRow as l}from"./packem_shared/exportShardRows-CTDgQEF8.mjs";import{AGGREGATE_SQL_FUNCTION as d,aggregateSqlFunction as c,matchesStaticWhere as m,normalizeCountArgument as p,throwingScheduler as S}from"./packem_shared/AGGREGATE_SQL_FUNCTION-BMtvQHac.mjs";import{aggregateTableName as f,coerceAggregateNumber as h,encodeAggregateKey as x,foldAggregateTally as E,readAggregateValue as T}from"./packem_shared/aggregateTableName-DbAttCNH.mjs";import{CountRlsUnsupportedError as C,mergeWhere as A,planAggregateLookup as g,selectIndexForAggregate as _,selectIndexForCount as I,selectIndexForGroupBy as b}from"./packem_shared/CountRlsUnsupportedError-BvsDqfO2.mjs";import{AUDIT_LOG_TABLE as D,appendAuditEntry as P,ensureAuditTable as O,readAuditLog as F}from"./packem_shared/AUDIT_LOG_TABLE-CZNxCRLv.mjs";import{NotUniqueError as y,assertNoExplicitUndefined as N,assertValidClientId as k,createShardCtxDb as B,normalizeIdStructurally as U,stripReservedPatchFields as G}from"./packem_shared/NotUniqueError-B4X0Amvc.mjs";import{backfillAggregateIndexes as q,backfillRankIndexes as v,backfillSearchIndexes as K,backfillSearchIndexesForTable as W}from"./packem_shared/backfillAggregateIndexes-CJrtolQ9.mjs";import{CDC_LOG_TABLE as H,CDC_LOG_TABLE_SEQ_INDEX as V,CDC_META_TABLE as z,appendCdcChange as Q,applyCdcChanges as Y,bumpCdcEpoch as j,cdcCanVouchFor as J,cdcForkedError as Z,cdcSeqLeavingRows as $,cdcTouchesTables as ee,cdcTrimmedError as re,compactCdcDocs as oe,cursorBelowRetainedFloor as ae,migrateCdcLog as te,migrateCdcMeta as se,minCdcReplayableSeq as ie,minCdcSeq as le,readCdcChangeKeys as ne,readCdcChanges as de,readCdcCursor as ce,readCdcEpoch as me,trimCdcChanges as pe}from"./packem_shared/CDC_LOG_TABLE-BPEzVAil.mjs";import{archiveCdcSegment as ue,cdcArchiveRewound as fe,readArchivedCdcChanges as he,readCdcArchivedThrough as xe,writeCdcArchivedThrough as Ee}from"./packem_shared/archiveCdcSegment-BON69Nug.mjs";import{CLIENT_WATERMARK_TABLE as Re,advanceClientWatermark as Ce,migrateClientWatermark as Ae,readClientWatermark as ge}from"./packem_shared/CLIENT_WATERMARK_TABLE-vLjfNhBR.mjs";import{COMMIT_SEQ_FIELD as Ie,COMMIT_SEQ_TABLE as be,allocateCommitSeq as Le,migrateCommitSeq as De,readCommitSeq as Pe}from"./packem_shared/COMMIT_SEQ_FIELD-BY_vc9bw.mjs";import{clearCompanionSignatures as Fe}from"./packem_shared/clearCompanionSignatures-C2CSfkeQ.mjs";import{createCompanionSync as ye}from"./packem_shared/createCompanionSync-B7dV2y4L.mjs";import{GLOBAL_SHAPE_SNAPSHOT_TABLE as ke,deleteGlobalShapeSnapshot as Be,deleteGlobalShapeSnapshotsForConnection as Ue,migrateGlobalShapeSnapshot as Ge,readGlobalShapeSnapshot as we,writeGlobalShapeSnapshot as qe}from"./packem_shared/GLOBAL_SHAPE_SNAPSHOT_TABLE-pMxZ-obU.mjs";import{IDEMPOTENCY_TABLE as Ke,migrateIdempotency as We,readIdempotent as Xe,trimIdempotent as He,writeIdempotent as Ve}from"./packem_shared/IDEMPOTENCY_TABLE-AOJCuq5U.mjs";import{clearMemoryTables as Qe,isMemoryTable as Ye,memoryTableNames as je}from"./packem_shared/clearMemoryTables-CogAvVHR.mjs";import{computeRankPage as Ze,resolveRankSeekTuple as $e}from"./packem_shared/computeRankPage-CFeFkZ_k.mjs";import{SCHEDULE_OUTBOX_TABLE as rr,deferScheduleOutbox as or,forgetScheduleOutbox as ar,migrateScheduleOutbox as tr,parkScheduleOutbox as sr,probeScheduleOutbox as ir,readDueScheduleOutbox as lr,recordScheduleOutbox as nr,trimScheduleOutbox as dr}from"./packem_shared/SCHEDULE_OUTBOX_TABLE-CgLvGxpY.mjs";import{S as mr,m as pr,r as Sr,w as ur}from"./packem_shared/ctx-db-search-state-DVCp4JQf.mjs";import{SHAPE_POKE_CURSOR_TABLE as hr,deleteShapePokeCursor as xr,deleteShapePokeCursorsForConnection as Er,migrateShapePokeCursor as Tr,minShapePokeCursor as Rr,readShapePokeCursor as Cr,writeShapePokeCursor as Ar,writeShapePokeCursors as gr}from"./packem_shared/SHAPE_POKE_CURSOR_TABLE-cn0stGAL.mjs";import{selectShapeMembers as Ir,selectShapeRows as br}from"./packem_shared/selectShapeMembers-CU8Kl2Bq.mjs";import{DATA_MIGRATION_STATE_TABLE as Dr,readMigrationStatus as Pr,runDataMigration as Or}from"./packem_shared/DATA_MIGRATION_STATE_TABLE-CqPrNKql.mjs";import{SCAN_DEP as Mr,createDependencyTracker as yr,depKey as Nr,tableFromDepKey as kr}from"./packem_shared/SCAN_DEP-D7qE3iUe.mjs";import{runDrizzle as Ur,runSql as Gr}from"./packem_shared/runDrizzle-Du5HLitO.mjs";import{A as qr,a as vr,b as Kr,D as Wr,c as Xr,d as Hr,g as Vr,i as zr,j as Qr,e as Yr,q as jr,f as Jr,r as Zr,t as $r,h as eo}from"./packem_shared/do-sql-Cg3zXJpF.mjs";import{WORKERD_SQLITE_LIMITS as oo,param as ao,renderSql as to,sqliteInList as so,unionAll as io}from"./packem_shared/WORKERD_SQLITE_LIMITS-DBH23L_S.mjs";import{appendStreamChunk as no,claimStreamRun as co,deleteStreamRun as mo,finishStreamRun as po,migrateDurableStreams as So,readStreamChunks as uo,readStreamRun as fo,trimStreamRuns as ho}from"./packem_shared/appendStreamChunk-7ZyAZGg_.mjs";import{DurableStreamRunner as Eo,MAX_DURABLE_STREAM_BYTES as To,MAX_DURABLE_STREAM_CHUNKS as Ro,decideDurableAttach as Co}from"./packem_shared/DurableStreamRunner-y2CRbfuZ.mjs";import{envOptionalPositiveInt as go,envPositiveInt as _o}from"./packem_shared/envOptionalPositiveInt-D2pY-c64.mjs";import{diffExternalSource as bo}from"./packem_shared/diffExternalSource-DgDJhslq.mjs";import{liftSourceId as Do,normalizeSourceDocument as Po,normalizeSourceValue as Oo}from"./packem_shared/liftSourceId-CA3ENhXj.mjs";import{materializeExternalRows as Mo,materializeExternalRowsIncremental as yo,readExternalSourceBaseline as No,runExternalSourceTick as ko}from"./packem_shared/materializeExternalRows-Cx6_A2W3.mjs";import{isSoftDeleted as Uo,isSourceDue as Go,pullExternalSourceIncrementalTick as wo,pullExternalSourceTick as qo}from"./packem_shared/isSoftDeleted-BTGu2iBl.mjs";import{f as Ko,a as Wo,b as Xo,c as Ho,d as Vo,g as zo}from"./packem_shared/fts-companion-pUdD6kF-.mjs";import{GEO_DEFAULT_PRECISION as Yo,boundingBoxCenter as jo,boundingBoxGeohashes as Jo,coveringGeohashes as Zo,encodeGeohash as $o,haversineMeters as ea,pointInBoundingBox as ra}from"./packem_shared/GEO_DEFAULT_PRECISION-CqpQZ-J_.mjs";import{default as aa}from"./packem_shared/GlobalPollTick-BNK4o-XT.mjs";import{ADMIN_FUNCTIONS as sa,ADMIN_FUNCTION_PREFIX as ia,DEFAULT_FANOUT_TOPIC_LIMIT as la,FLAGS_FUNCTION_PREFIX as na,MAX_PAGE_SIZE as da,RELATION_FUNCTION_PREFIX as ca,createFanoutCounters as ma,createGlobalPollCounters as pa,createShapeProbeCounters as Sa,facetColumn as ua,findStorageReferences as fa,isVacuousFilterClause as ha,listTables as xa,readTablePage as Ea,recordFanoutPass as Ta,recordGlobalPollPass as Ra,recordShapeProbePass as Ca,selectMatchingIds as Aa,summarizeFanoutTopics as ga,summarizeSubscriptions as _a}from"./packem_shared/ADMIN_FUNCTIONS-Bsvi2ytY.mjs";import{MAIL_RETENTION as ba,MAIL_TABLE as La,clearCapturedMail as Da,ensureMailTable as Pa,readCapturedMail as Oa,recordCapturedMail as Fa}from"./packem_shared/MAIL_RETENTION-BxAGL3hK.mjs";import{NotFoundError as ya}from"./packem_shared/NotFoundError-BhF7FeFr.mjs";import{assertPatchAllowed as ka,operatorFields as Ba,patchDependsOnRow as Ua,readPatchField as Ga,resolvePatch as wa}from"./packem_shared/assertPatchAllowed-BJ_2LgkQ.mjs";import{armRestore as va,readBookmark as Ka}from"./packem_shared/armRestore-Bu1_8SUa.mjs";import{CURSOR_PREFIX as Xa,applySelect as Ha,buildSeekBeforeWhere as Va,buildSeekWhere as za,decodeCursor as Qa,encodeCursor as Ya,equalityPinnedFields as ja,normalizeOrderKeys as Ja,nullsFirstOf as Za,nullsOrderSuffix as $a,softDeleteScope as et,tiebreakDirectionFor as rt,uniqueIndexFields as ot}from"./packem_shared/CURSOR_PREFIX-BztyXqNP.mjs";import{QUEUE_TABLE as tt,clearQueueMessages as st,isLossyBody as it,readQueueMessageById as lt,readQueueMessages as nt,recordQueueMessages as dt}from"./packem_shared/QUEUE_TABLE-DKANxmEZ.mjs";import{RANK_TIEBREAK as mt,encodePartitionKey as pt,matchesRankStaticWhere as St,rankKeyFromDoc as ut,rankPivotConditionSql as ft,rankTableName as ht,resolveRankPartition as xt,sortColumnName as Et}from"./packem_shared/RANK_TIEBREAK-BKugKf70.mjs";import{ReactiveCache as Rt,reactiveCacheKey as Ct}from"./packem_shared/ReactiveCache-Bdzsahf3.mjs";import{REACTOR_STATE_TABLE as gt,listReactorStates as _t,migrateReactorState as It,reactorNeedsRun as bt,readReactorState as Lt,writeReactorState as Dt}from"./packem_shared/REACTOR_STATE_TABLE-B8IehLv8.mjs";import{UNVOUCHABLE_DEP as Ot,createReadFootprint as Ft,markUnvouchableReads as Mt}from"./packem_shared/UNVOUCHABLE_DEP-C68htACn.mjs";import{buildIndexRange as Nt,indexKeysForRow as kt,keysTouchRanges as Bt}from"./packem_shared/buildIndexRange-6nIZDf4m.mjs";import{isPushableWhere as Gt,whereFilter as wt,whereOfFilter as qt}from"./packem_shared/isPushableWhere-BeYAOjUb.mjs";import{RELATED_DEFAULT_LIMIT as Kt,RELATED_DEPTH_DECAY as Wt,RELATED_MAX_DEPTH as Xt,RELATED_MAX_LIMIT as Ht,deriveRelationEdges as Vt,findRelated as zt}from"./packem_shared/RELATED_DEFAULT_LIMIT-Me5elP-K.mjs";import{DEFAULT_MAX_RELATION_KEYS as Yt,assertFlatPredicate as jt,assertShapeShardable as Jt,composeReadPredicate as Zt,containsRelationPredicate as $t,isRelationPredicate as es,resolveRelationPredicates as rs}from"./packem_shared/DEFAULT_MAX_RELATION_KEYS-BPSfUl2O.mjs";import{describeRelationWrites as as}from"./packem_shared/describeRelationWrites-z-ocXMtj.mjs";import{applyOnDelete as ss,distinctValues as is,fanOutScalarCounts as ls,relationHooks as ns,resolveWith as ds,runRowValidators as cs}from"./packem_shared/applyOnDelete-CeqSZSQu.mjs";import{DEFAULT_PROMOTION_THRESHOLDS as ps,clampPromotionThresholds as Ss,nextPromotionState as us,relayCountFor as fs,shapeRoutingKey as hs}from"./packem_shared/DEFAULT_PROMOTION_THRESHOLDS-DEURXMvk.mjs";import{DEFAULT_MAX_RELAYS as Es,OwnerRelay as Ts,RelayMember as Rs,createRelayLink as Cs}from"./packem_shared/DEFAULT_MAX_RELAYS-BqSpObEl.mjs";import{createReplicaLink as gs,gateReplicaDispatch as _s,handleReplicaControl as Is}from"./packem_shared/createReplicaLink-B9F5PAQ0.mjs";import{buildReprojectionMigration as Ls,countLegacyRows as Ds,reprojectableFields as Ps,reprojectionTables as Os}from"./packem_shared/buildReprojectionMigration-CRS4SNgc.mjs";import{RLS_UNWRAP_SYMBOL as Ms,RlsRequiredError as ys,guardWriter as Ns}from"./packem_shared/RLS_UNWRAP_SYMBOL-qYcAxjuk.mjs";import{SCHEMA_HISTORY_MAX_VERSIONS as Bs,readSchemaHistory as Us,readSchemaVersion as Gs,recordSchemaVersion as ws}from"./packem_shared/SCHEMA_HISTORY_MAX_VERSIONS-BMcUIqBY.mjs";import{serializeSqlValue as vs}from"./packem_shared/serializeSqlValue-BbZ5hKM7.mjs";import{buildSettings as Ws,isDevEnvironment as Xs,readDeployInfo as Hs}from"./packem_shared/buildSettings-BRkZd6_E.mjs";import{buildShapeDiff as zs}from"./packem_shared/buildShapeDiff-C3hPtSKO.mjs";import{ShapeDiffCache as Ys,createShapeDiffCache as js,globalShapeReadKey as Js}from"./packem_shared/ShapeDiffCache-Br3kxusw.mjs";import{buildPokeFrames as $s,diffGlobalMembership as ei,encodeRowsPatch as ri,projectColumns as oi}from"./packem_shared/buildPokeFrames-CDOP-XYp.mjs";import{ShardRunner as ti}from"./packem_shared/ShardRunner-CrveaPId.mjs";import{stubByName as ii}from"./packem_shared/stubByName-C_P73AOx.mjs";import{runSocketPool as ni}from"./packem_shared/runSocketPool-CZJ2X9cF.mjs";import{MAX_SQL_ROWS as ci,assertReadonly as mi,lintReadonlySql as pi,runReadonlySql as Si}from"./packem_shared/MAX_SQL_ROWS-Dh_Ty0Zo.mjs";import{BIGINT_KEY_DIGITS as fi,bigintSqlKey as hi,decodeBigintSqlKey as xi,decodeFloat64SqlKey as Ei,float64SqlKey as Ti}from"./packem_shared/BIGINT_KEY_DIGITS-C9a7Ix7k.mjs";import{awaitWsDrain as Ci,subscriptionFrames as Ai,subscriptionListDeltas as gi,trySendFrame as _i}from"./packem_shared/awaitWsDrain-D4E7Oiwo.mjs";import{mergeChangedKeys as bi,recordChangedKeys as Li,writeTouchesMemo as Di}from"./packem_shared/mergeChangedKeys-DH9RAARR.mjs";import{createSystemReader as Oi}from"./packem_shared/createSystemReader-DcDLFfC-.mjs";import{ConflictError as Mi}from"./packem_shared/ConflictError-C8GtJmjS.mjs";import{DEFAULT_TRANSACTION_LIMITS as Ni,TransactionHeadroomTracker as ki}from"./packem_shared/DEFAULT_TRANSACTION_LIMITS-DiR5z5EX.mjs";import{hasTrigger as Ui,runTriggers as Gi}from"./packem_shared/hasTrigger-CjlwI4le.mjs";import{selectExpiredIds as qi}from"./packem_shared/selectExpiredIds-CilDdUr2.mjs";import{VECTOR_BACKFILL_MAX_PAGES as Ki,backfillVectorIndexes as Wi}from"./packem_shared/VECTOR_BACKFILL_MAX_PAGES-D9DeCfM2.mjs";import{c as Hi,s as Vi}from"./packem_shared/where-sql-Dn9trjRu.mjs";import{RELATION_EXISTS_KEY as Qi}from"./packem_shared/RELATION_EXISTS_KEY-wxgj6rSL.mjs";import{REPROJECTION_MIGRATION_PREFIX as ji,reprojectionMigrationId as Ji}from"./packem_shared/REPROJECTION_MIGRATION_PREFIX-Czcb6_mO.mjs";import{isInternalTableName as $i}from"./packem_shared/isInternalTableName-BoljO2tP.mjs";import{quoteIdentifier as rl}from"./packem_shared/quoteIdentifier-CObIFRhb.mjs";import{runShardMigrations as al}from"./packem_shared/runShardMigrations-eqHNBW6S.mjs";import{stableStringify as sl}from"./packem_shared/stableStringify-DibjylKD.mjs";import{stableWireKey as ll}from"./packem_shared/stableWireKey-Bdh5JSdg.mjs";export{sa as ADMIN_FUNCTIONS,ia as ADMIN_FUNCTION_PREFIX,d as AGGREGATE_SQL_FUNCTION,qr as AGG_COUNT,vr as AGG_KEY,Kr as AGG_VALUE,D as AUDIT_LOG_TABLE,fi as BIGINT_KEY_DIGITS,H as CDC_LOG_TABLE,V as CDC_LOG_TABLE_SEQ_INDEX,z as CDC_META_TABLE,Re as CLIENT_WATERMARK_TABLE,Ie as COMMIT_SEQ_FIELD,be as COMMIT_SEQ_TABLE,Xa as CURSOR_PREFIX,Mi as ConflictError,C as CountRlsUnsupportedError,Dr as DATA_MIGRATION_STATE_TABLE,la as DEFAULT_FANOUT_TOPIC_LIMIT,Yt as DEFAULT_MAX_RELATION_KEYS,Es as DEFAULT_MAX_RELAYS,ps as DEFAULT_PROMOTION_THRESHOLDS,Ni as DEFAULT_TRANSACTION_LIMITS,Wr as DOC_COLUMN,Eo as DurableStreamRunner,na as FLAGS_FUNCTION_PREFIX,Yo as GEO_DEFAULT_PRECISION,ke as GLOBAL_SHAPE_SNAPSHOT_TABLE,aa as GlobalPollTick,Ke as IDEMPOTENCY_TABLE,ba as MAIL_RETENTION,La as MAIL_TABLE,To as MAX_DURABLE_STREAM_BYTES,Ro as MAX_DURABLE_STREAM_CHUNKS,da as MAX_PAGE_SIZE,ci as MAX_SQL_ROWS,ya as NotFoundError,y as NotUniqueError,Ts as OwnerRelay,tt as QUEUE_TABLE,mt as RANK_TIEBREAK,gt as REACTOR_STATE_TABLE,Kt as RELATED_DEFAULT_LIMIT,Wt as RELATED_DEPTH_DECAY,Xt as RELATED_MAX_DEPTH,Ht as RELATED_MAX_LIMIT,Qi as RELATION_EXISTS_KEY,ca as RELATION_FUNCTION_PREFIX,ji as REPROJECTION_MIGRATION_PREFIX,Ms as RLS_UNWRAP_SYMBOL,Rt as ReactiveCache,Rs as RelayMember,ys as RlsRequiredError,Mr as SCAN_DEP,rr as SCHEDULE_OUTBOX_TABLE,Bs as SCHEMA_HISTORY_MAX_VERSIONS,mr as SEARCH_STATE_TABLE,hr as SHAPE_POKE_CURSOR_TABLE,Ys as ShapeDiffCache,ti as ShardRunner,ki as TransactionHeadroomTracker,Ot as UNVOUCHABLE_DEP,Ki as VECTOR_BACKFILL_MAX_PAGES,oo as WORKERD_SQLITE_LIMITS,Ce as advanceClientWatermark,Xr as aggUpsertSql,c as aggregateSqlFunction,f as aggregateTableName,Le as allocateCommitSeq,P as appendAuditEntry,Q as appendCdcChange,no as appendStreamChunk,Y as applyCdcChanges,ss as applyOnDelete,Ha as applySelect,ue as archiveCdcSegment,va as armRestore,jt as assertFlatPredicate,N as assertNoExplicitUndefined,ka as assertPatchAllowed,mi as assertReadonly,Jt as assertShapeShardable,k as assertValidClientId,Ci as awaitWsDrain,q as backfillAggregateIndexes,v as backfillRankIndexes,K as backfillSearchIndexes,W as backfillSearchIndexesForTable,Wi as backfillVectorIndexes,hi as bigintSqlKey,jo as boundingBoxCenter,Jo as boundingBoxGeohashes,Nt as buildIndexRange,$s as buildPokeFrames,Ls as buildReprojectionMigration,Va as buildSeekBeforeWhere,za as buildSeekWhere,Ws as buildSettings,zs as buildShapeDiff,j as bumpCdcEpoch,fe as cdcArchiveRewound,J as cdcCanVouchFor,Z as cdcForkedError,$ as cdcSeqLeavingRows,ee as cdcTouchesTables,re as cdcTrimmedError,co as claimStreamRun,Ss as clampPromotionThresholds,Da as clearCapturedMail,Fe as clearCompanionSignatures,Qe as clearMemoryTables,st as clearQueueMessages,h as coerceAggregateNumber,oe as compactCdcDocs,Hi as compileWhereSql,Zt as composeReadPredicate,Ze as computeRankPage,$t as containsRelationPredicate,Ds as countLegacyRows,Zo as coveringGeohashes,ye as createCompanionSync,yr as createDependencyTracker,ma as createFanoutCounters,pa as createGlobalPollCounters,Hr as createIndexSql,Ft as createReadFootprint,Cs as createRelayLink,gs as createReplicaLink,js as createShapeDiffCache,Sa as createShapeProbeCounters,B as createShardCtxDb,Oi as createSystemReader,ae as cursorBelowRetainedFloor,Co as decideDurableAttach,xi as decodeBigintSqlKey,Qa as decodeCursor,Ei as decodeFloat64SqlKey,or as deferScheduleOutbox,Be as deleteGlobalShapeSnapshot,Ue as deleteGlobalShapeSnapshotsForConnection,xr as deleteShapePokeCursor,Er as deleteShapePokeCursorsForConnection,mo as deleteStreamRun,Nr as depKey,Vt as deriveRelationEdges,as as describeRelationWrites,bo as diffExternalSource,ei as diffGlobalMembership,is as distinctValues,x as encodeAggregateKey,Ya as encodeCursor,$o as encodeGeohash,pt as encodePartitionKey,ri as encodeRowsPatch,O as ensureAuditTable,Pa as ensureMailTable,go as envOptionalPositiveInt,_o as envPositiveInt,ja as equalityPinnedFields,o as exportShardRows,ua as facetColumn,ls as fanOutScalarCounts,zt as findRelated,fa as findStorageReferences,po as finishStreamRun,Ti as float64SqlKey,E as foldAggregateTally,ar as forgetScheduleOutbox,Ko as ftsCompanionDdl,Wo as ftsPurgeDocument,Xo as ftsRowidMapName,Ho as ftsUnmappedPage,Vo as ftsWriteDocument,_s as gateReplicaDispatch,Vr as geoTableName,Js as globalShapeReadKey,zo as groupUnmappedRows,Ns as guardWriter,Is as handleReplicaControl,Ui as hasTrigger,ea as haversineMeters,a as importShardRows,kt as indexKeysForRow,Xs as isDevEnvironment,zr as isFtsAvailable,$i as isInternalTableName,it as isLossyBody,Ye as isMemoryTable,Gt as isPushableWhere,es as isRelationPredicate,Uo as isSoftDeleted,Go as isSourceDue,ha as isVacuousFilterClause,Qr as jsonPath,Yr as jsonPathSql,Bt as keysTouchRanges,Do as liftSourceId,pi as lintReadonlySql,_t as listReactorStates,xa as listTables,Mt as markUnvouchableReads,St as matchesRankStaticWhere,m as matchesStaticWhere,Mo as materializeExternalRows,yo as materializeExternalRowsIncremental,je as memoryTableNames,bi as mergeChangedKeys,A as mergeWhere,te as migrateCdcLog,se as migrateCdcMeta,Ae as migrateClientWatermark,De as migrateCommitSeq,So as migrateDurableStreams,Ge as migrateGlobalShapeSnapshot,We as migrateIdempotency,It as migrateReactorState,tr as migrateScheduleOutbox,pr as migrateSearchState,Tr as migrateShapePokeCursor,ie as minCdcReplayableSeq,le as minCdcSeq,Rr as minShapePokeCursor,us as nextPromotionState,p as normalizeCountArgument,U as normalizeIdStructurally,Ja as normalizeOrderKeys,Po as normalizeSourceDocument,Oo as normalizeSourceValue,Za as nullsFirstOf,$a as nullsOrderSuffix,Ba as operatorFields,ao as param,sr as parkScheduleOutbox,t as parseExportShardArgs,s as parseImportShardArgs,Ua as patchDependsOnRow,g as planAggregateLookup,ra as pointInBoundingBox,ir as probeScheduleOutbox,oi as projectColumns,wo as pullExternalSourceIncrementalTick,qo as pullExternalSourceTick,jr as qualifiedJsonPath,Jr as qualifiedJsonPathSql,rl as quoteIdentifier,ut as rankKeyFromDoc,ft as rankPivotConditionSql,ht as rankTableName,Ct as reactiveCacheKey,bt as reactorNeedsRun,T as readAggregateValue,he as readArchivedCdcChanges,F as readAuditLog,Ka as readBookmark,Oa as readCapturedMail,xe as readCdcArchivedThrough,ne as readCdcChangeKeys,de as readCdcChanges,ce as readCdcCursor,me as readCdcEpoch,ge as readClientWatermark,Pe as readCommitSeq,Hs as readDeployInfo,lr as readDueScheduleOutbox,No as readExternalSourceBaseline,we as readGlobalShapeSnapshot,Xe as readIdempotent,Pr as readMigrationStatus,Ga as readPatchField,lt as readQueueMessageById,nt as readQueueMessages,Lt as readReactorState,Us as readSchemaHistory,Gs as readSchemaVersion,Sr as readSearchBackfillState,Cr as readShapePokeCursor,uo as readStreamChunks,fo as readStreamRun,Ea as readTablePage,Fa as recordCapturedMail,Li as recordChangedKeys,Ta as recordFanoutPass,Ra as recordGlobalPollPass,dt as recordQueueMessages,nr as recordScheduleOutbox,ws as recordSchemaVersion,Ca as recordShapeProbePass,ns as relationHooks,fs as relayCountFor,to as renderSql,Ps as reprojectableFields,Ji as reprojectionMigrationId,Os as reprojectionTables,wa as resolvePatch,xt as resolveRankPartition,$e as resolveRankSeekTuple,rs as resolveRelationPredicates,ds as resolveWith,Zr as rowToDocument,Or as runDataMigration,Ur as runDrizzle,ko as runExternalSourceTick,Si as runReadonlySql,cs as runRowValidators,al as runShardMigrations,ni as runSocketPool,Gr as runSql,Gi as runTriggers,qi as selectExpiredIds,i as selectExportTables,_ as selectIndexForAggregate,I as selectIndexForCount,b as selectIndexForGroupBy,Aa as selectMatchingIds,Ir as selectShapeMembers,br as selectShapeRows,vs as serializeSqlValue,Vi as serverInList,hs as shapeRoutingKey,et as softDeleteScope,Et as sortColumnName,so as sqliteInList,sl as stableStringify,ll as stableWireKey,G as stripReservedPatchFields,ii as stubByName,Ai as subscriptionFrames,gi as subscriptionListDeltas,ga as summarizeFanoutTopics,_a as summarizeSubscriptions,$r as tableColumns,kr as tableFromDepKey,S as throwingScheduler,rt as tiebreakDirectionFor,pe as trimCdcChanges,He as trimIdempotent,dr as trimScheduleOutbox,ho as trimStreamRuns,eo as tryRowToDocument,_i as trySendFrame,io as unionAll,ot as uniqueIndexFields,l as validateImportRow,wt as whereFilter,qt as whereOfFilter,Ee as writeCdcArchivedThrough,qe as writeGlobalShapeSnapshot,Ve as writeIdempotent,Dt as writeReactorState,ur as writeSearchBackfillState,Ar as writeShapePokeCursor,gr as writeShapePokeCursors,Di as writeTouchesMemo};