@prisma-next/sql-runtime 0.14.0 → 0.15.0-dev.10

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.
@@ -1,14 +1,423 @@
1
- import { C as SqlRuntimeTargetDescriptor, S as SqlRuntimeExtensionInstance, b as SqlRuntimeDriverInstance, f as ExecutionContext, i as Runtime, o as RuntimeOptions, v as SqlRuntimeAdapterDescriptor, x as SqlRuntimeExtensionDescriptor, y as SqlRuntimeAdapterInstance } from "../prepared-statement-FQyyQnkC.mjs";
1
+ import { C as SqlRuntimeTargetDescriptor, H as decodeRow, S as SqlRuntimeExtensionInstance, V as buildDecodeContext, b as SqlRuntimeDriverInstance, f as ExecutionContext, i as Runtime, o as RuntimeOptions, v as SqlRuntimeAdapterDescriptor, x as SqlRuntimeExtensionDescriptor, y as SqlRuntimeAdapterInstance } from "../prepared-statement-BiwAFEou.mjs";
2
2
  import { CodecDescriptor } from "@prisma-next/framework-components/codec";
3
3
  import { ResultType } from "@prisma-next/framework-components/runtime";
4
4
  import { Adapter, AnyQueryAst, Codec, ContractCodecRegistry, LoweredStatement, SelectAst } from "@prisma-next/sql-relational-core/ast";
5
5
  import { RuntimeDriverDescriptor } from "@prisma-next/framework-components/execution";
6
- import { Contract, ContractModelBase } from "@prisma-next/contract/types";
7
- import { SqlStorage, SqlStorageInput, StorageTableInput, buildSqlNamespace } from "@prisma-next/sql-contract/types";
6
+ import { ColumnDefault, Contract, ContractModelBase, ControlPolicy, JsonValue, NamespaceId, ValueSetRef } from "@prisma-next/contract/types";
7
+ import { IRNodeBase, NamespaceBase } from "@prisma-next/framework-components/ir";
8
+ import { SqlStorage, SqlStorageInput, StorageTableInput } from "@prisma-next/sql-contract/types";
8
9
  import { DevDatabase, collectAsync, createDevDatabase, teardownTestDatabase, withClient } from "@prisma-next/test-utils";
9
10
  import { SqlExecutionPlan, SqlQueryPlan } from "@prisma-next/sql-relational-core/plan";
10
11
  import { Client } from "pg";
11
-
12
+ //#region ../1-core/contract/src/ir/sql-node.d.ts
13
+ /**
14
+ * SQL family IR node base. Carries the family-level `kind` discriminator
15
+ * `'sql'` and inherits the framework's `freezeNode` affordance.
16
+ *
17
+ * Single family-level discriminator (not per-leaf) reflects the fact that
18
+ * SQL IR has no polymorphic dispatch today — verifiers and serializers
19
+ * walk by structural position (`storage.tables[name].columns[name]`),
20
+ * not by inspecting `kind`. The abstract bar for per-leaf discriminators
21
+ * isn't earned until a future polymorphic consumer arrives.
22
+ *
23
+ * `kind` is installed as a non-enumerable own property on every instance,
24
+ * which keeps three things clean simultaneously:
25
+ *
26
+ * - `JSON.stringify(node)` produces the canonical pre-lift JSON envelope
27
+ * shape (no `kind` field), so emitted contract.json files and the
28
+ * `validateSqlContractFully` arktype schemas stay unchanged.
29
+ * - Test assertions that use `toEqual({...})` against the pre-lift flat
30
+ * shape continue to pass — only enumerable own properties are
31
+ * compared.
32
+ * - Direct access (`node.kind`) and runtime narrowing
33
+ * (`if (node.kind === 'sql')`) still work, so future polymorphic
34
+ * dispatch can begin reading `kind` without a runtime change.
35
+ *
36
+ * Future per-leaf overrides land cleanly: a class that gains a
37
+ * polymorphic-dispatch consumer (e.g. an enum type instance walked
38
+ * alongside other types) overrides `kind` with its narrower literal
39
+ * at that leaf level. Per-leaf overrides will use enumerable kind
40
+ * (matching the Mongo per-class-discriminator precedent) because they
41
+ * encode dispatch-relevant information that callers need to see in
42
+ * JSON envelopes; the family-level `'sql'` is uniform across all SQL
43
+ * IR and carries no dispatch-relevant information.
44
+ */
45
+ declare abstract class SqlNode extends IRNodeBase {
46
+ readonly kind?: string;
47
+ constructor();
48
+ }
49
+ //#endregion
50
+ //#region ../1-core/contract/src/ir/check-constraint.d.ts
51
+ /**
52
+ * Hydration / construction input shape for {@link CheckConstraint}.
53
+ * Mirrors the on-disk storage JSON envelope so the serializer hydration
54
+ * walker can hand a validated literal straight to `new`.
55
+ */
56
+ interface CheckConstraintInput {
57
+ readonly name: string;
58
+ readonly column: string;
59
+ readonly valueSet: ValueSetRef;
60
+ }
61
+ /**
62
+ * SQL Contract IR node for a table-level check constraint that restricts
63
+ * a column to the permitted values of a value-set.
64
+ *
65
+ * The constraint is **structured** (names a column and a value-set
66
+ * reference), not a raw SQL expression. Each target renders its own DDL
67
+ * from the structured form, keeping the contract target-agnostic.
68
+ *
69
+ * Construction is idempotent: passing an existing `CheckConstraint`
70
+ * instance as input produces a new instance with identical fields.
71
+ * The constructor does not use `instanceof` for input discrimination —
72
+ * it reads plain named properties, which is sufficient since
73
+ * `CheckConstraintInput` is a structural type.
74
+ */
75
+ declare class CheckConstraint extends SqlNode {
76
+ readonly name: string;
77
+ readonly column: string;
78
+ readonly valueSet: ValueSetRef;
79
+ constructor(input: CheckConstraintInput);
80
+ }
81
+ //#endregion
82
+ //#region ../1-core/contract/src/ir/foreign-key-reference.d.ts
83
+ /**
84
+ * Input for a foreign-key reference (one side of a foreign-key declaration).
85
+ *
86
+ * When `spaceId` is absent the reference is local — the referenced table lives
87
+ * in the same contract-space. When `spaceId` is present the reference is
88
+ * cross-space — the referenced table lives in a different contract-space
89
+ * identified by `spaceId`.
90
+ *
91
+ * Presence-based discrimination keeps local FK JSON byte-identical to
92
+ * contracts authored before cross-space support was added.
93
+ */
94
+ interface ForeignKeyReferenceInput {
95
+ readonly namespaceId: string;
96
+ readonly tableName: string;
97
+ readonly columns: readonly string[];
98
+ readonly spaceId?: string;
99
+ }
100
+ /**
101
+ * SQL Contract IR node for one side (source or target) of a foreign-key
102
+ * declaration. Carries the full coordinate: namespace, table, and columns.
103
+ *
104
+ * Cross-space discrimination is based on `spaceId` presence: absent means
105
+ * local (same contract-space); present means cross-space (the referenced
106
+ * table lives in the contract-space identified by `spaceId`).
107
+ *
108
+ * For local references `spaceId` is absent from JSON, keeping the serialized
109
+ * shape byte-identical to contracts authored before cross-space support was
110
+ * added. For cross-space references `spaceId` appears in JSON so round-trips
111
+ * are lossless.
112
+ *
113
+ * Use `UNBOUND_NAMESPACE_ID` from `@prisma-next/framework-components/ir`
114
+ * as the sentinel `namespaceId` for single-namespace (unbound) references.
115
+ */
116
+ declare class ForeignKeyReference extends SqlNode {
117
+ readonly namespaceId: NamespaceId;
118
+ readonly tableName: string;
119
+ readonly columns: readonly string[];
120
+ readonly spaceId?: string;
121
+ constructor(input: ForeignKeyReferenceInput);
122
+ }
123
+ //#endregion
124
+ //#region ../1-core/contract/src/ir/foreign-key.d.ts
125
+ type ReferentialAction = 'noAction' | 'restrict' | 'cascade' | 'setNull' | 'setDefault';
126
+ interface ForeignKeyInput {
127
+ readonly source: ForeignKeyReference | ForeignKeyReferenceInput;
128
+ readonly target: ForeignKeyReference | ForeignKeyReferenceInput;
129
+ readonly name?: string;
130
+ readonly onDelete?: ReferentialAction;
131
+ readonly onUpdate?: ReferentialAction;
132
+ }
133
+ /**
134
+ * SQL Contract IR node for a table-level foreign-key declaration — the
135
+ * referential constraint only (source, target, `onDelete`/`onUpdate`).
136
+ *
137
+ * A persisted `foreignKeys[]` entry always denotes a real constraint: whether
138
+ * to emit the constraint at all, and whether to back it with an index, are
139
+ * authoring-time decisions (PSL `@relation(index:)`, TS `fk({ constraint,
140
+ * index })`) resolved once at `contract emit` — a `constraint: false` FK
141
+ * simply has no entry here, and a backing index (if any) is its own discrete,
142
+ * named entry in the table's `indexes[]`.
143
+ *
144
+ * Each FK carries explicit `source` and `target` {@link ForeignKeyReference}
145
+ * coordinates (namespace, table, columns). For single-namespace contracts the
146
+ * sentinel `UNBOUND_NAMESPACE_ID` appears on both sides.
147
+ *
148
+ * The nested references are normalised to {@link ForeignKeyReference}
149
+ * instances inside the constructor so downstream walks see a uniform AST
150
+ * regardless of whether the input was a JSON literal or an already-constructed
151
+ * class instance.
152
+ */
153
+ declare class ForeignKey extends SqlNode {
154
+ readonly source: ForeignKeyReference;
155
+ readonly target: ForeignKeyReference;
156
+ readonly name?: string;
157
+ readonly onDelete?: ReferentialAction;
158
+ readonly onUpdate?: ReferentialAction;
159
+ constructor(input: ForeignKeyInput);
160
+ }
161
+ //#endregion
162
+ //#region ../1-core/contract/src/ir/primary-key.d.ts
163
+ interface PrimaryKeyInput {
164
+ readonly columns: readonly string[];
165
+ readonly name?: string;
166
+ }
167
+ /**
168
+ * SQL Contract IR node for a table's primary-key constraint.
169
+ */
170
+ declare class PrimaryKey extends SqlNode {
171
+ readonly columns: readonly string[];
172
+ readonly name?: string;
173
+ constructor(input: PrimaryKeyInput);
174
+ }
175
+ //#endregion
176
+ //#region ../1-core/contract/src/ir/sql-index.d.ts
177
+ interface IndexInput {
178
+ readonly columns: readonly string[];
179
+ readonly name?: string;
180
+ readonly type?: string;
181
+ readonly options?: Record<string, unknown>;
182
+ }
183
+ /**
184
+ * SQL Contract IR node for a table-level secondary index.
185
+ *
186
+ * Note that this class shadows the global TypeScript `Index` lib type
187
+ * at the family-shared name; consumer files that need both should
188
+ * alias one (e.g.
189
+ * `import { Index as SqlIndexNode } from '@prisma-next/sql-contract/types'`).
190
+ */
191
+ declare class Index extends SqlNode {
192
+ readonly columns: readonly string[];
193
+ readonly name?: string;
194
+ readonly type?: string;
195
+ readonly options?: Record<string, unknown>;
196
+ constructor(input: IndexInput);
197
+ }
198
+ //#endregion
199
+ //#region ../1-core/contract/src/ir/storage-column.d.ts
200
+ /**
201
+ * Hydration / construction input shape for {@link StorageColumn}. Mirrors
202
+ * the on-disk storage JSON envelope exactly so the family-base
203
+ * serializer's hydration walker can hand an arktype-validated literal
204
+ * straight to `new`.
205
+ *
206
+ * `typeParams` and `typeRef` remain mutually exclusive (one or the
207
+ * other, not both); the constructor preserves whichever caller-side
208
+ * choice the input encodes.
209
+ */
210
+ interface StorageColumnInput {
211
+ readonly nativeType: string;
212
+ readonly codecId: string;
213
+ readonly nullable: boolean;
214
+ readonly many?: boolean;
215
+ readonly typeParams?: Record<string, unknown>;
216
+ readonly typeRef?: string;
217
+ readonly default?: ColumnDefault;
218
+ readonly control?: ControlPolicy;
219
+ readonly valueSet?: ValueSetRef;
220
+ }
221
+ /**
222
+ * SQL Contract IR node for a single column entry in `StorageTable.columns`.
223
+ *
224
+ * Single concrete family-shared class — every SQL target reads the
225
+ * same column shape today, so there is no per-target subclass. The
226
+ * class type accepts any caller that constructs via
227
+ * `new StorageColumn(input)`; literal construction sites must pass
228
+ * through the constructor or the family-base hydration walker.
229
+ *
230
+ * The column's `name` is not on the class — columns are keyed by name
231
+ * in the parent `StorageTable.columns: Record<string, StorageColumn>`
232
+ * map, so a `name` field would be redundant with the key.
233
+ */
234
+ declare class StorageColumn extends SqlNode {
235
+ readonly nativeType: string;
236
+ readonly codecId: string;
237
+ readonly nullable: boolean;
238
+ readonly many?: boolean;
239
+ readonly typeParams?: Record<string, unknown>;
240
+ readonly typeRef?: string;
241
+ readonly default?: ColumnDefault;
242
+ readonly control?: ControlPolicy;
243
+ readonly valueSet?: ValueSetRef;
244
+ constructor(input: StorageColumnInput);
245
+ }
246
+ //#endregion
247
+ //#region ../1-core/contract/src/ir/unique-constraint.d.ts
248
+ interface UniqueConstraintInput {
249
+ readonly columns: readonly string[];
250
+ readonly name?: string;
251
+ }
252
+ /**
253
+ * SQL Contract IR node for a table-level unique constraint.
254
+ */
255
+ declare class UniqueConstraint extends SqlNode {
256
+ readonly columns: readonly string[];
257
+ readonly name?: string;
258
+ constructor(input: UniqueConstraintInput);
259
+ }
260
+ //#endregion
261
+ //#region ../1-core/contract/src/ir/storage-table.d.ts
262
+ interface StorageTableInput$1 {
263
+ readonly columns: Record<string, StorageColumn | StorageColumnInput>;
264
+ readonly primaryKey?: PrimaryKey | PrimaryKeyInput;
265
+ readonly uniques: ReadonlyArray<UniqueConstraint | UniqueConstraintInput>;
266
+ readonly indexes: ReadonlyArray<Index | IndexInput>;
267
+ readonly foreignKeys: ReadonlyArray<ForeignKey | ForeignKeyInput>;
268
+ readonly control?: ControlPolicy;
269
+ readonly checks?: ReadonlyArray<CheckConstraint | CheckConstraintInput>;
270
+ }
271
+ /**
272
+ * SQL Contract IR node for a single table entry in a namespace's
273
+ * `tables` map.
274
+ *
275
+ * The constructor normalises nested IR-class fields (columns, primary
276
+ * key, uniques, indexes, foreign keys) into the appropriate class
277
+ * instances so downstream walks see a uniform AST regardless of whether
278
+ * the input was a JSON literal or an already-constructed class.
279
+ *
280
+ * The table's `name` is not on the class — tables are keyed by name in
281
+ * the parent namespace's `tables: Record<string, StorageTable>` map.
282
+ */
283
+ declare class StorageTable extends SqlNode {
284
+ readonly columns: Readonly<Record<string, StorageColumn>>;
285
+ readonly uniques: ReadonlyArray<UniqueConstraint>;
286
+ readonly indexes: ReadonlyArray<Index>;
287
+ readonly foreignKeys: ReadonlyArray<ForeignKey>;
288
+ readonly primaryKey?: PrimaryKey;
289
+ readonly control?: ControlPolicy;
290
+ readonly checks?: ReadonlyArray<CheckConstraint>;
291
+ constructor(input: StorageTableInput$1);
292
+ /**
293
+ * Runtime guard that a namespace `table` entry is really a `StorageTable`.
294
+ * The compiler already types the entry as `StorageTable`, but a
295
+ * freshly-deserialized contract may carry plain JSON at that slot until
296
+ * hydration; this duck-types the structural shape. Accepts `undefined` so
297
+ * optional-chained entry lookups pass straight through.
298
+ */
299
+ static is(value: StorageTable | undefined): value is StorageTable;
300
+ static assert(value: StorageTable | undefined, coordinate: string): asserts value is StorageTable;
301
+ }
302
+ //#endregion
303
+ //#region ../1-core/contract/src/ir/storage-value-set.d.ts
304
+ /**
305
+ * Hydration / construction input shape for {@link StorageValueSet}.
306
+ * Mirrors the on-disk storage JSON envelope so the serializer hydration
307
+ * walker can hand a validated literal straight to `new`.
308
+ */
309
+ interface StorageValueSetInput {
310
+ readonly kind: 'valueSet';
311
+ /** Ordered permitted values, codec-encoded. Declaration order is preserved. */
312
+ readonly values: readonly JsonValue[];
313
+ }
314
+ /**
315
+ * SQL Contract IR node for a value-set entry in a namespace's `valueSet`
316
+ * map (`SqlNamespace.entries.valueSet`).
317
+ *
318
+ * A value-set records the ordered set of permitted codec-encoded values for
319
+ * an enum-like column restriction. It does not carry a `codecId` — the
320
+ * column that references it already holds the codec; the value-set holds
321
+ * only the permitted values.
322
+ *
323
+ * The node's `kind` is enumerable (`'valueSet'`) so the JSON envelope
324
+ * carries the discriminator and the serializer hydration walker can
325
+ * dispatch on it. This follows the per-leaf enumerable-kind convention
326
+ * established in the SQL-node comment (future polymorphic dispatch on
327
+ * namespace entries needs the discriminator in JSON).
328
+ *
329
+ * The entry's name is not on the class — value-sets are keyed by name in
330
+ * the parent namespace's `valueSet: Record<string, StorageValueSet>` map.
331
+ */
332
+ declare class StorageValueSet extends SqlNode {
333
+ readonly kind: "valueSet";
334
+ readonly values: readonly JsonValue[];
335
+ constructor(input: StorageValueSetInput);
336
+ }
337
+ //#endregion
338
+ //#region ../1-core/contract/src/ir/sql-storage.d.ts
339
+ interface SqlNamespaceInput {
340
+ readonly id: string;
341
+ readonly entries: Readonly<Record<string, Readonly<Record<string, unknown>>>>;
342
+ }
343
+ /**
344
+ * SQL Contract IR root node for the `storage` field.
345
+ *
346
+ * Single concrete family-shared class — both Postgres and SQLite
347
+ * consume this class today. Per-target storage subclasses are
348
+ * introduced when each target's namespace shape earns its
349
+ * target-specific concretion (target-specific derived fields,
350
+ * target-specific storage extensions).
351
+ *
352
+ * Honours the framework `Storage` interface: every SQL IR carries a
353
+ * `namespaces` map keyed by namespace id. Callers must supply fully
354
+ * constructed `Namespace` instances — construction discipline lives
355
+ * in the authoring builders and deserializer hydration paths.
356
+ *
357
+ * The constructor normalises optional `types` into class instances.
358
+ * `types` is polymorphic per Decision 18 Option B: codec-triple inputs
359
+ * are stamped with `kind: 'codec-instance'`; hydration of raw JSON
360
+ * class-instance entries (carrying their narrower `kind` literal) is
361
+ * the per-target serializer's responsibility (so the family base does
362
+ * not import target-specific subclasses).
363
+ */
364
+ /**
365
+ * The typed `entries` shape for SQL family namespaces. The open dictionary
366
+ * is intersected with optional known-kind maps so that `ns.entries.table`
367
+ * and `ns.entries.valueSet` resolve without a cast, while unknown pack-
368
+ * contributed kinds remain valid (the `Record` part allows any string key).
369
+ */
370
+ type SqlNamespaceEntries = Readonly<Record<string, Readonly<Record<string, unknown>>>> & {
371
+ readonly table?: Readonly<Record<string, StorageTable>>;
372
+ readonly valueSet?: Readonly<Record<string, StorageValueSet>>;
373
+ };
374
+ /**
375
+ * Structural interface for SQL family namespaces. Generated `.d.ts` contract
376
+ * types satisfy this structurally (no prototype methods). The runtime
377
+ * abstract class `SqlNamespaceBase` extends this.
378
+ *
379
+ * `qualifyTable` and `isUnbound` are optional so JSON-shaped contract types
380
+ * (which carry no methods) are accepted where `SqlNamespace` is required.
381
+ * Hydrated `SqlNamespaceBase` instances always have both.
382
+ */
383
+ interface SqlNamespace {
384
+ readonly kind: string;
385
+ readonly id: string;
386
+ readonly entries: SqlNamespaceEntries;
387
+ readonly isUnbound?: boolean;
388
+ qualifyTable?(tableName: string): string;
389
+ }
390
+ /**
391
+ * Abstract SQL family namespace base class. Target concretions (`PostgresSchema`,
392
+ * `SqliteDatabase`, …) extend this — it is never instantiated directly.
393
+ * `entries` is the open ADR 224 dictionary: `entries[entityKind][entityName]`
394
+ * addresses any entity.
395
+ */
396
+ declare abstract class SqlNamespaceBase extends NamespaceBase implements SqlNamespace {
397
+ abstract readonly id: string;
398
+ abstract readonly entries: SqlNamespaceEntries;
399
+ abstract qualifyTable(tableName: string): string;
400
+ }
401
+ //#endregion
402
+ //#region ../1-core/contract/test/test-support.d.ts
403
+ /**
404
+ * Minimal concrete `SqlNamespaceBase` for use in `packages/2-sql/**` unit tests.
405
+ *
406
+ * This is a legitimate target concretion — not a materialised family
407
+ * namespace. Production code never constructs one; the target-specific
408
+ * concretions (`PostgresSchema`, `SqliteDatabase`) are used in production.
409
+ */
410
+ declare class TestSqlNamespace extends SqlNamespaceBase {
411
+ readonly kind: 'test-sql-namespace';
412
+ readonly id: string;
413
+ readonly entries: SqlNamespaceEntries;
414
+ constructor(input: SqlNamespaceInput);
415
+ get table(): Readonly<Record<string, StorageTable>>;
416
+ get valueSet(): Readonly<Record<string, StorageValueSet>> | undefined;
417
+ qualifyTable(tableName: string): string;
418
+ }
419
+ declare function createTestSqlNamespace(input: SqlNamespaceInput): TestSqlNamespace;
420
+ //#endregion
12
421
  //#region test/utils.d.ts
13
422
  type CreateTestRuntimeOptions<TContract extends Contract<SqlStorage>> = Omit<RuntimeOptions<TContract>, 'adapter'> & {
14
423
  readonly stackInstance: {
@@ -99,7 +508,7 @@ type StubAdapter = Adapter<SelectAst, Contract<SqlStorage>, LoweredStatement> &
99
508
  * The stub adapter includes simple codecs for common test types (pg/int4@1, pg/text@1, pg/timestamptz@1) to enable type inference in tests without requiring the postgres adapter package.
100
509
  */
101
510
  declare function createStubAdapter(): StubAdapter;
102
- declare function unboundNamespaceWithTables(tables: Record<string, StorageTableInput>): ReturnType<typeof buildSqlNamespace>;
511
+ declare function unboundNamespaceWithTables(tables: Record<string, StorageTableInput>): ReturnType<typeof createTestSqlNamespace>;
103
512
  declare function emptySqlTestDomain(): import("@prisma-next/contract/types").ApplicationDomain;
104
513
  declare function createTestContract(contract: Partial<Omit<Contract<SqlStorage>, 'profileHash' | 'storage' | 'domain'>> & {
105
514
  storageHash?: string;
@@ -110,5 +519,5 @@ declare function createTestContract(contract: Partial<Omit<Contract<SqlStorage>,
110
519
  }): Contract<SqlStorage>;
111
520
  declare function stubAst(): AnyQueryAst;
112
521
  //#endregion
113
- export { type DevDatabase, SeedMarkerInput, StubAdapter, buildTestContractCodecs, collectAsync, createDevDatabase, createStubAdapter, createTestAdapterDescriptor, createTestContext, createTestContract, createTestRuntime, createTestStackInstance, createTestTargetDescriptor, descriptorsFromCodecs, drainPlanExecution, emptySqlTestDomain, executePlanAndCollect, seedTestMarker, setupTestDatabase, stubAst, teardownTestDatabase, unboundNamespaceWithTables, withClient, writeTestContractMarker };
522
+ export { type DevDatabase, SeedMarkerInput, StubAdapter, buildDecodeContext, buildTestContractCodecs, collectAsync, createDevDatabase, createStubAdapter, createTestAdapterDescriptor, createTestContext, createTestContract, createTestRuntime, createTestStackInstance, createTestTargetDescriptor, decodeRow, descriptorsFromCodecs, drainPlanExecution, emptySqlTestDomain, executePlanAndCollect, seedTestMarker, setupTestDatabase, stubAst, teardownTestDatabase, unboundNamespaceWithTables, withClient, writeTestContractMarker };
114
523
  //# sourceMappingURL=utils.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.mts","names":[],"sources":["../../test/utils.ts"],"mappings":";;;;;;;;;;;;KAgEK,wBAAA,mBAA2C,QAAA,CAAS,UAAA,KAAe,IAAA,CACtE,cAAA,CAAe,SAAA;EAAA,SAGN,aAAA;IAAA,SAA0B,OAAA,EAAS,cAAA,CAAe,SAAA;EAAA;AAAA;;;;;;iBAQ7C,iBAAA,mBAAoC,QAAA,CAAS,UAAA,GAC3D,OAAA,EAAS,wBAAA,CAAyB,SAAA,IACjC,OAAA;;;;iBAgBmB,qBAAA,WACV,gBAAA,CAAiB,UAAA,CAAW,CAAA,KAAM,YAAA,CAAa,UAAA,CAAW,CAAA,IACpE,OAAA,EAAS,OAAA,EAAS,IAAA,EAAM,CAAA,GAAI,OAAA,CAAQ,UAAA,CAAW,CAAA;;;;iBAQ3B,kBAAA,CACpB,OAAA,EAAS,OAAA,EACT,IAAA,EAAM,gBAAA,GAAmB,YAAA,YACxB,OAAA;;;;;;;AAvCmE;iBAkDhD,iBAAA,CACpB,MAAA,EAAQ,MAAA,EACR,QAAA,EAAU,QAAA,CAAS,UAAA,GACnB,OAAA,GAAU,MAAA,EAAQ,MAAA,KAAW,OAAA,QAC7B,qBAAA,GAAwB,MAAA,EAAQ,MAAA,KAAW,OAAA,SAC1C,OAAA;AAAA,UAUc,eAAA;EAzDgB;EAAA,SA2DtB,KAAA;EAAA,SACA,WAAA;EAAA,SACA,WAAA;EAAA,SACA,YAAA;EAAA,SACA,gBAAA;EAAA,SACA,UAAA;AAAA;;;;;;;iBASW,cAAA,CAAe,MAAA,EAAQ,MAAA,EAAQ,KAAA,EAAO,eAAA,GAAkB,OAAA;;AAvEpE;AAgBV;;iBA2EsB,uBA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,iBA2BI,OAAA,IAAW,WAAW"}
1
+ {"version":3,"file":"utils.d.mts","names":[],"sources":["../../../1-core/contract/src/ir/sql-node.ts","../../../1-core/contract/src/ir/check-constraint.ts","../../../1-core/contract/src/ir/foreign-key-reference.ts","../../../1-core/contract/src/ir/foreign-key.ts","../../../1-core/contract/src/ir/primary-key.ts","../../../1-core/contract/src/ir/sql-index.ts","../../../1-core/contract/src/ir/storage-column.ts","../../../1-core/contract/src/ir/unique-constraint.ts","../../../1-core/contract/src/ir/storage-table.ts","../../../1-core/contract/src/ir/storage-value-set.ts","../../../1-core/contract/src/ir/sql-storage.ts","../../../1-core/contract/test/test-support.ts","../../test/utils.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAkCA;;;;;;;;;;;;ACzBA;;;;;;;uBDyBsB,OAAA,SAAgB,UAAU;EAAA,SACrC,IAAA;;;;;;;;;;UC1BM,oBAAA;EAAA,SACN,IAAA;EAAA,SACA,MAAA;EAAA,SACA,QAAA,EAAU,WAAW;AAAA;;;ADsBhC;;;;;;;;;;;;cCLa,eAAA,SAAwB,OAAA;EAAA,SAC1B,IAAA;EAAA,SACA,MAAA;EAAA,SACA,QAAA,EAAU,WAAA;cAEP,KAAA,EAAO,oBAAA;AAAA;;;;;;;;;;;;;;UCnBJ,wBAAA;EAAA,SACN,WAAA;EAAA,SACA,SAAA;EAAA,SACA,OAAA;EAAA,SACA,OAAA;AAAA;;;;;;;;ADVX;;;;;;;;;cC6Ba,mBAAA,SAA4B,OAAA;EAAA,SAC9B,WAAA,EAAa,WAAA;EAAA,SACb,SAAA;EAAA,SACA,OAAA;EAAA,SACQ,OAAA;cAEL,KAAA,EAAO,wBAAA;AAAA;;;KCxCT,iBAAA;AAAA,UAEK,eAAA;EAAA,SACN,MAAA,EAAQ,mBAAA,GAAsB,wBAAA;EAAA,SAC9B,MAAA,EAAQ,mBAAA,GAAsB,wBAAA;EAAA,SAC9B,IAAA;EAAA,SACA,QAAA,GAAW,iBAAA;EAA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