@prisma-next/family-sql 0.14.0-dev.4 → 0.14.0-dev.40

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 (66) hide show
  1. package/dist/{authoring-type-constructors-CjFfO6LM.mjs → authoring-type-constructors-CXd-8ydc.mjs} +7 -30
  2. package/dist/authoring-type-constructors-CXd-8ydc.mjs.map +1 -0
  3. package/dist/contract-to-schema-ir-S-evq8E6.mjs +264 -0
  4. package/dist/contract-to-schema-ir-S-evq8E6.mjs.map +1 -0
  5. package/dist/{control-adapter-Cmw9LvEP.d.mts → control-adapter-DHYFuOBy.d.mts} +12 -7
  6. package/dist/{control-adapter-Cmw9LvEP.d.mts.map → control-adapter-DHYFuOBy.d.mts.map} +1 -1
  7. package/dist/control-adapter.d.mts +1 -1
  8. package/dist/control.d.mts +18 -3
  9. package/dist/control.d.mts.map +1 -1
  10. package/dist/control.mjs +81 -943
  11. package/dist/control.mjs.map +1 -1
  12. package/dist/{schema-verify.d.mts → diff.d.mts} +5 -5
  13. package/dist/diff.d.mts.map +1 -0
  14. package/dist/{verify-sql-schema-xT4udQLQ.mjs → diff.mjs} +169 -253
  15. package/dist/diff.mjs.map +1 -0
  16. package/dist/ir.d.mts +9 -6
  17. package/dist/ir.d.mts.map +1 -1
  18. package/dist/ir.mjs +1 -1
  19. package/dist/migration.d.mts +11 -2
  20. package/dist/migration.d.mts.map +1 -1
  21. package/dist/migration.mjs +7 -0
  22. package/dist/migration.mjs.map +1 -1
  23. package/dist/pack.mjs +1 -1
  24. package/dist/psl-infer.d.mts +80 -0
  25. package/dist/psl-infer.d.mts.map +1 -0
  26. package/dist/psl-infer.mjs +334 -0
  27. package/dist/psl-infer.mjs.map +1 -0
  28. package/dist/{sql-contract-serializer-BR2vC7Z-.mjs → sql-contract-serializer-CYtXg_zs.mjs} +17 -20
  29. package/dist/sql-contract-serializer-CYtXg_zs.mjs.map +1 -0
  30. package/dist/{verify-sql-schema-thU-jKpf.d.mts → sql-schema-diff-6z36dZt6.d.mts} +44 -5
  31. package/dist/sql-schema-diff-6z36dZt6.d.mts.map +1 -0
  32. package/dist/{types-kgstZ_Zd.d.mts → types-CkOIJXxU.d.mts} +84 -17
  33. package/dist/types-CkOIJXxU.d.mts.map +1 -0
  34. package/package.json +23 -23
  35. package/src/core/authoring-entity-types.ts +12 -37
  36. package/src/core/control-adapter.ts +10 -5
  37. package/src/core/control-instance.ts +174 -41
  38. package/src/core/{schema-verify/verify-sql-schema.ts → diff/sql-schema-diff.ts} +208 -16
  39. package/src/core/{schema-verify → diff}/verify-helpers.ts +12 -0
  40. package/src/core/ir/sql-contract-serializer-base.ts +23 -55
  41. package/src/core/ir/sql-contract-serializer.ts +5 -7
  42. package/src/core/migrations/contract-to-schema-ir.ts +49 -12
  43. package/src/core/migrations/field-event-planner.ts +2 -2
  44. package/src/core/migrations/schema-differ.ts +40 -0
  45. package/src/core/migrations/types.ts +43 -2
  46. package/src/core/psl-contract-infer/printer-config.ts +0 -6
  47. package/src/core/sql-migration.ts +12 -1
  48. package/src/exports/control.ts +1 -0
  49. package/src/exports/diff.ts +18 -0
  50. package/src/exports/psl-infer.ts +36 -0
  51. package/dist/authoring-type-constructors-CjFfO6LM.mjs.map +0 -1
  52. package/dist/schema-verify.d.mts.map +0 -1
  53. package/dist/schema-verify.mjs +0 -2
  54. package/dist/sql-contract-serializer-BR2vC7Z-.mjs.map +0 -1
  55. package/dist/test-utils.d.mts +0 -2
  56. package/dist/test-utils.mjs +0 -2
  57. package/dist/types-kgstZ_Zd.d.mts.map +0 -1
  58. package/dist/verify-sql-schema-thU-jKpf.d.mts.map +0 -1
  59. package/dist/verify-sql-schema-xT4udQLQ.mjs.map +0 -1
  60. package/src/core/psl-contract-infer/postgres-default-mapping.ts +0 -16
  61. package/src/core/psl-contract-infer/postgres-type-map.ts +0 -157
  62. package/src/core/psl-contract-infer/sql-schema-ir-to-psl-ast.ts +0 -795
  63. package/src/exports/schema-verify.ts +0 -18
  64. package/src/exports/test-utils.ts +0 -9
  65. /package/src/core/{schema-verify → diff}/control-verify-emit.ts +0 -0
  66. /package/src/core/{schema-verify → diff}/verifier-disposition.ts +0 -0
@@ -82,13 +82,14 @@ function convertColumn(
82
82
  // typeRef and produces `"vector(1536)"` — making diffs on the same
83
83
  // contract falsely report a `type_mismatch`.
84
84
  const resolved = resolveColumnTypeMetadata(column, storageTypes);
85
- const nativeType = expandNativeType
85
+ const baseNativeType = expandNativeType
86
86
  ? expandNativeType({
87
87
  nativeType: resolved.nativeType,
88
88
  codecId: resolved.codecId,
89
89
  ...ifDefined('typeParams', resolved.typeParams),
90
90
  })
91
91
  : resolved.nativeType;
92
+ const nativeType = column.many ? `${baseNativeType}[]` : baseNativeType;
92
93
  return {
93
94
  name,
94
95
  nativeType,
@@ -303,7 +304,7 @@ export function detectDestructiveChanges(
303
304
 
304
305
  for (const tableName of Object.keys(fromTables)) {
305
306
  const toTableRaw = toNs?.entries.table?.[tableName];
306
- if (!(toTableRaw instanceof StorageTable)) {
307
+ if (!StorageTable.is(toTableRaw)) {
307
308
  conflicts.push({
308
309
  kind: 'tableRemoved',
309
310
  summary: `Table "${tableName}" was removed`,
@@ -313,7 +314,7 @@ export function detectDestructiveChanges(
313
314
  const toTable = toTableRaw;
314
315
 
315
316
  const fromTableRaw = fromTables[tableName];
316
- if (!(fromTableRaw instanceof StorageTable)) continue;
317
+ if (!StorageTable.is(fromTableRaw)) continue;
317
318
  const fromTable = fromTableRaw;
318
319
 
319
320
  for (const columnName of Object.keys(fromTable.columns)) {
@@ -358,6 +359,48 @@ export interface ContractToSchemaIROptions {
358
359
  *
359
360
  * Returns an empty schema IR when `contract` is `null` (new project).
360
361
  */
362
+ /**
363
+ * Converts the tables of a single namespace into a `SqlSchemaIR`, keyed by
364
+ * table name within that namespace. Unlike {@link contractToSchemaIR}, which
365
+ * flattens every namespace's tables into one bare-keyed record (and throws on a
366
+ * cross-namespace name collision), this scopes the table iteration to one
367
+ * namespace so the same table name can exist in two schemas.
368
+ *
369
+ * The full `storage` is still passed to `convertTable`, so value-set / enum /
370
+ * type resolution that legitimately spans namespaces is unaffected. Foreign
371
+ * keys are built purely from the FK descriptor (`fk.target`), so cross-namespace
372
+ * FKs survive per-namespace conversion. The `annotations` block (storage-type
373
+ * derived) is omitted here — the per-namespace tree consumer reads only the
374
+ * per-table fields.
375
+ */
376
+ export function contractNamespaceToSchemaIR(
377
+ storage: SqlStorage,
378
+ namespaceId: string,
379
+ options: ContractToSchemaIROptions,
380
+ ): SqlSchemaIR {
381
+ if (options.annotationNamespace.length === 0) {
382
+ throw new Error('annotationNamespace must be a non-empty string');
383
+ }
384
+ const namespace = storage.namespaces[namespaceId];
385
+ if (!namespace) {
386
+ return { tables: {} };
387
+ }
388
+ const storageTypes: ResolvedStorageTypes = { ...(storage.types ?? {}) };
389
+ const tables: Record<string, SqlTableIR> = {};
390
+ for (const [tableName, tableDefRaw] of Object.entries(namespace.entries.table ?? {})) {
391
+ StorageTable.assert(tableDefRaw, `namespaces.${namespaceId}.entries.table.${tableName}`);
392
+ tables[tableName] = convertTable(
393
+ tableName,
394
+ tableDefRaw,
395
+ storageTypes,
396
+ options.expandNativeType,
397
+ options.renderDefault,
398
+ storage,
399
+ );
400
+ }
401
+ return { tables };
402
+ }
403
+
361
404
  export function contractToSchemaIR(
362
405
  contract: Contract<SqlStorage> | null,
363
406
  options: ContractToSchemaIROptions,
@@ -371,17 +414,11 @@ export function contractToSchemaIR(
371
414
  }
372
415
 
373
416
  const storage = contract.storage;
374
- const storageTypes: ResolvedStorageTypes = {
375
- ...((storage.types ?? {}) as ResolvedStorageTypes),
376
- };
417
+ const storageTypes: ResolvedStorageTypes = { ...(storage.types ?? {}) };
377
418
  const tables: Record<string, SqlTableIR> = {};
378
419
  for (const ns of Object.values(storage.namespaces)) {
379
420
  for (const [tableName, tableDefRaw] of Object.entries(ns.entries.table ?? {})) {
380
- if (!(tableDefRaw instanceof StorageTable)) {
381
- throw new Error(
382
- `contractToSchemaIR: expected StorageTable at namespaces.${ns.id}.entries.table.${tableName}`,
383
- );
384
- }
421
+ StorageTable.assert(tableDefRaw, `namespaces.${ns.id}.entries.table.${tableName}`);
385
422
  const tableDef = tableDefRaw;
386
423
  if (tables[tableName] !== undefined) {
387
424
  throw new Error(
@@ -418,7 +455,7 @@ function deriveAnnotations(
418
455
  ): SqlAnnotations | undefined {
419
456
  const storageTypes: Record<string, StorageTypeInstance> = {};
420
457
 
421
- for (const typeInstance of Object.values((storage.types ?? {}) as ResolvedStorageTypes)) {
458
+ for (const typeInstance of Object.values(storage.types ?? {})) {
422
459
  if (isStorageTypeInstance(typeInstance)) {
423
460
  storageTypes[typeInstance.nativeType] = typeInstance;
424
461
  }
@@ -88,8 +88,8 @@ export function planFieldEventOperations(
88
88
  for (const tableName of tableNames) {
89
89
  const priorTableRaw = priorTables?.[tableName];
90
90
  const newTableRaw = newTables?.[tableName];
91
- const priorTable = priorTableRaw instanceof StorageTable ? priorTableRaw : undefined;
92
- const newTable = newTableRaw instanceof StorageTable ? newTableRaw : undefined;
91
+ const priorTable = StorageTable.is(priorTableRaw) ? priorTableRaw : undefined;
92
+ const newTable = StorageTable.is(newTableRaw) ? newTableRaw : undefined;
93
93
  const fieldNames = unionSorted(
94
94
  priorTable ? Object.keys(priorTable.columns) : [],
95
95
  newTable ? Object.keys(newTable.columns) : [],
@@ -0,0 +1,40 @@
1
+ import type { Contract } from '@prisma-next/contract/types';
2
+ import type { TargetBoundComponentDescriptor } from '@prisma-next/framework-components/components';
3
+ import type {
4
+ SchemaDiffer,
5
+ VerifyDatabaseSchemaResult,
6
+ } from '@prisma-next/framework-components/control';
7
+ import type { SqlStorage } from '@prisma-next/sql-contract/types';
8
+ import type { SqlSchemaIRNode } from '@prisma-next/sql-schema-ir/types';
9
+
10
+ /**
11
+ * Inputs to a SQL target's schema-differ (`diffDatabaseSchema` /
12
+ * `verifyDatabaseSchema` on the descriptor): the contract (the expected side
13
+ * derives from it), the introspected actual schema node, and the resolution
14
+ * context the relational diff needs.
15
+ */
16
+ export interface DiffDatabaseSchemaInput {
17
+ readonly contract: Contract<SqlStorage>;
18
+ readonly schema: SqlSchemaIRNode;
19
+ readonly strict: boolean;
20
+ readonly typeMetadataRegistry: ReadonlyMap<string, { readonly nativeType?: string }>;
21
+ readonly frameworkComponents: ReadonlyArray<TargetBoundComponentDescriptor<'sql', string>>;
22
+ }
23
+
24
+ /**
25
+ * The `SchemaDiffer` a SQL target implements: the black-box comparison of the
26
+ * contract's expected schema against the introspected actual schema, projected
27
+ * to the two issue lists. How it computes them is private to the target.
28
+ */
29
+ export type SqlDiffDatabaseSchema = SchemaDiffer<DiffDatabaseSchemaInput>['diff'];
30
+
31
+ /**
32
+ * The same combined comparison as {@link SqlDiffDatabaseSchema}, wrapped in the
33
+ * verify envelope (`ok`/`summary`/`code`/`target`/`timings`) plus the
34
+ * pass/warn/fail tree the CLI renders. Verify calls this instead of the diff so
35
+ * the relational walk that produces the tree runs once per verify, not once for
36
+ * the diff and again for the tree.
37
+ */
38
+ export type SqlVerifyDatabaseSchema = (
39
+ input: DiffDatabaseSchemaInput,
40
+ ) => VerifyDatabaseSchemaResult;
@@ -5,6 +5,7 @@ import type {
5
5
  ContractSpace,
6
6
  ControlAdapterDescriptor,
7
7
  ControlExtensionDescriptor,
8
+ DiffIssue,
8
9
  MigratableTargetDescriptor,
9
10
  MigrationOperationPolicy,
10
11
  MigrationPlan,
@@ -21,6 +22,7 @@ import type {
21
22
  SchemaIssue,
22
23
  SchemaVerifier,
23
24
  } from '@prisma-next/framework-components/control';
25
+ import type { PslDocumentAst } from '@prisma-next/framework-components/psl-ast';
24
26
  import type { AggregateMigrationEdgeRef } from '@prisma-next/migration-tools/aggregate';
25
27
  import type {
26
28
  SqlControlDriverInstance,
@@ -30,10 +32,11 @@ import type {
30
32
  StorageTypeInstance,
31
33
  } from '@prisma-next/sql-contract/types';
32
34
  import type { SqlOperationDescriptors } from '@prisma-next/sql-operations';
33
- import type { SqlSchemaIR } from '@prisma-next/sql-schema-ir/types';
35
+ import type { SqlSchemaIR, SqlSchemaIRNode } from '@prisma-next/sql-schema-ir/types';
34
36
  import type { Result } from '@prisma-next/utils/result';
35
37
  import type { SqlControlAdapter } from '../control-adapter';
36
38
  import type { SqlControlFamilyInstance } from '../control-instance';
39
+ import type { SqlDiffDatabaseSchema, SqlVerifyDatabaseSchema } from './schema-differ';
37
40
 
38
41
  export type AnyRecord = Readonly<Record<string, unknown>>;
39
42
 
@@ -308,7 +311,12 @@ export type SqlPlannerResult<TTargetDetails> =
308
311
 
309
312
  export interface SqlMigrationPlannerPlanOptions {
310
313
  readonly contract: Contract<SqlStorage>;
311
- readonly schema: SqlSchemaIR;
314
+ /**
315
+ * The "from"/live schema as the target's introspected node (SQLite a flat
316
+ * `SqlSchemaIR`, Postgres a `PostgresDatabaseSchemaNode` root). Structure-aware
317
+ * consumers narrow the concrete shape before walking it.
318
+ */
319
+ readonly schema: SqlSchemaIRNode;
312
320
  readonly policy: MigrationOperationPolicy;
313
321
  readonly schemaName?: string;
314
322
  /**
@@ -343,6 +351,16 @@ export interface SqlMigrationPlannerPlanOptions {
343
351
  * All components must have matching familyId ('sql') and targetId.
344
352
  */
345
353
  readonly frameworkComponents: ReadonlyArray<TargetBoundComponentDescriptor<'sql', string>>;
354
+ /**
355
+ * Caller-supplied keep-predicate the planner applies to its schema diff
356
+ * (via `SchemaDiff.filter`) before building operations. The orchestration
357
+ * constructs it so the diff findings reaching op-building are exactly the
358
+ * contract space's own — e.g. dropping the `extra` findings for elements a
359
+ * sibling contract space declares, so the planner never emits DROP ops
360
+ * against another space's tables. The planner applies it blindly and holds
361
+ * no ownership logic. Absent for single-space plans.
362
+ */
363
+ readonly keepDiffIssue?: (issue: DiffIssue) => boolean;
346
364
  }
347
365
 
348
366
  export interface SqlMigrationPlanner<TTargetDetails> {
@@ -476,6 +494,29 @@ export interface SqlControlTargetDescriptor<
476
494
  * the base, the target-specific dispatch on the subclass.
477
495
  */
478
496
  readonly schemaVerifier: SchemaVerifier<TContract, SqlSchemaIR>;
497
+ /**
498
+ * Database→PSL inference for `contract infer`. Target logic (owns the dialect
499
+ * maps), so it lives on the descriptor. Optional: targets without `contract
500
+ * infer` (Mongo) omit it, and the family instance throws when it is absent.
501
+ */
502
+ readonly inferPslContract?: (schema: SqlSchemaIRNode) => PslDocumentAst;
503
+ /**
504
+ * The single combined database-schema diff of two derived representations —
505
+ * the target's black-box comparison. Every SQL target provides it (Postgres
506
+ * returns relational + policy issues; SQLite returns relational only). It is
507
+ * schema logic on the target, not database I/O, so it lives here rather than
508
+ * on the control adapter. How it computes the two issue sets is private.
509
+ * See {@link SqlDiffDatabaseSchema} / {@link SqlVerifyDatabaseSchema}.
510
+ */
511
+ readonly diffDatabaseSchema: SqlDiffDatabaseSchema;
512
+ /**
513
+ * The same combined comparison as {@link diffDatabaseSchema}, wrapped in the
514
+ * verify envelope (`ok`/`summary`/`code`/`target`/`timings`) plus the
515
+ * pass/warn/fail tree the CLI renders. Verify calls this instead of
516
+ * `diffDatabaseSchema` so the relational walk that produces the tree runs
517
+ * once per verify, not once for the diff and again for the tree.
518
+ */
519
+ readonly verifyDatabaseSchema: SqlVerifyDatabaseSchema;
479
520
  createPlanner(adapter: SqlControlAdapter<TTargetId>): SqlMigrationPlanner<TTargetDetails>;
480
521
  createRunner(family: SqlControlFamilyInstance): SqlMigrationRunner<TTargetDetails>;
481
522
  }
@@ -1,12 +1,6 @@
1
1
  import type { ColumnDefault } from '@prisma-next/contract/types';
2
2
  import type { DefaultMappingOptions } from './default-mapping';
3
3
 
4
- /**
5
- * Internal printer-shaped configuration, used by the SQL family's
6
- * `sqlSchemaIrToPslAst` helper (M2). The framework-level psl-printer no longer
7
- * exposes these — they're consumed only inside the SQL family.
8
- */
9
-
10
4
  export type PslNativeTypeAttribute = {
11
5
  readonly name: string;
12
6
  readonly args?: readonly string[];
@@ -1,5 +1,7 @@
1
+ import type { Contract } from '@prisma-next/contract/types';
1
2
  import { deriveProvidedInvariants } from '@prisma-next/migration-tools/invariants';
2
3
  import { Migration } from '@prisma-next/migration-tools/migration';
4
+ import type { SqlStorage } from '@prisma-next/sql-contract/types';
3
5
  import { isThenable } from '@prisma-next/utils/promise';
4
6
  import type { SqlMigrationPlanOperation, SqlPlanTargetDetails } from './migrations/types';
5
7
 
@@ -14,13 +16,22 @@ import type { SqlMigrationPlanOperation, SqlPlanTargetDetails } from './migratio
14
16
  * fully concrete operation shape. Target-free code in SQL family / tooling
15
17
  * parameterises over `TDetails` (and usually `TTargetId = string`).
16
18
  *
19
+ * The `Start` / `End` contract generics are forwarded to the framework
20
+ * `Migration` base so the derived `describe()` and the per-target view getters
21
+ * (`PostgresMigration` / `SqliteMigration`) carry each migration's precise
22
+ * contract types. The view getters themselves live on the per-target bases
23
+ * because the SQL ContractView shapes differ per target (SQLite unwraps its
24
+ * sole namespace to the root; Postgres is schema-qualified).
25
+ *
17
26
  * Keeps target-free contract/runtime features in the family layer while
18
27
  * letting adapters own target shape.
19
28
  */
20
29
  export abstract class SqlMigration<
21
30
  TDetails extends SqlPlanTargetDetails,
22
31
  TTargetId extends string = string,
23
- > extends Migration<SqlMigrationPlanOperation<TDetails>, 'sql', TTargetId> {
32
+ Start extends Contract<SqlStorage> = Contract<SqlStorage>,
33
+ End extends Contract<SqlStorage> = Contract<SqlStorage>,
34
+ > extends Migration<SqlMigrationPlanOperation<TDetails>, 'sql', TTargetId, Start, End> {
24
35
  /**
25
36
  * Sorted, deduplicated invariant ids declared by this migration's
26
37
  * data-transform ops. Derived from `this.operations` so the field remains
@@ -22,6 +22,7 @@ export type {
22
22
  } from '../core/migrations/contract-to-schema-ir';
23
23
  // Contract → SchemaIR conversion for offline migration planning
24
24
  export {
25
+ contractNamespaceToSchemaIR,
25
26
  contractToSchemaIR,
26
27
  detectDestructiveChanges,
27
28
  resolveValueSetValues,
@@ -0,0 +1,18 @@
1
+ /**
2
+ * SQL relational schema-diff exports.
3
+ *
4
+ * The shared relational diff that each SQL target descriptor's
5
+ * `diffDatabaseSchema` composes (Postgres adds its structural policy diff on
6
+ * top; SQLite is relational only). Pure — no database connection required.
7
+ */
8
+
9
+ export type {
10
+ NativeTypeNormalizer,
11
+ VerifySqlSchemaOptions,
12
+ } from '../core/diff/sql-schema-diff';
13
+ export { verifySqlSchema, verifySqlSchemaTree } from '../core/diff/sql-schema-diff';
14
+ export {
15
+ arraysEqual,
16
+ isIndexSatisfied,
17
+ isUniqueConstraintSatisfied,
18
+ } from '../core/diff/verify-helpers';
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Shape-neutral database→PSL inference utilities.
3
+ *
4
+ * These leaf transforms (name normalization, relation inference, generic
5
+ * default mapping, the printer-config types, raw-default parsing) carry no
6
+ * dialect knowledge, so they live in the SQL family and are imported by the
7
+ * target that owns the dialect maps and walks its own schema tree (Postgres).
8
+ * The framework owns `PslDocumentAst` + `printPsl`; the target owns the
9
+ * Postgres type/default maps.
10
+ */
11
+
12
+ export type {
13
+ DefaultMappingOptions,
14
+ DefaultMappingResult,
15
+ } from '../core/psl-contract-infer/default-mapping';
16
+ export { mapDefault } from '../core/psl-contract-infer/default-mapping';
17
+ export {
18
+ deriveBackRelationFieldName,
19
+ deriveRelationFieldName,
20
+ pluralize,
21
+ toEnumName,
22
+ toFieldName,
23
+ toModelName,
24
+ toNamedTypeName,
25
+ } from '../core/psl-contract-infer/name-transforms';
26
+ export type {
27
+ EnumInfo,
28
+ PslNativeTypeAttribute,
29
+ PslPrinterOptions,
30
+ PslTypeMap,
31
+ PslTypeResolution,
32
+ RelationField,
33
+ } from '../core/psl-contract-infer/printer-config';
34
+ export { parseRawDefault } from '../core/psl-contract-infer/raw-default-parser';
35
+ export type { InferredRelations } from '../core/psl-contract-infer/relation-inference';
36
+ export { inferRelations } from '../core/psl-contract-infer/relation-inference';
@@ -1 +0,0 @@
1
- {"version":3,"file":"authoring-type-constructors-CjFfO6LM.mjs","names":[],"sources":["../src/core/authoring-entity-types.ts","../src/core/authoring-field-presets.ts","../src/core/authoring-type-constructors.ts"],"sourcesContent":["import type { JsonValue } from '@prisma-next/contract/types';\nimport type {\n AuthoringEntityContext,\n AuthoringEntityTypeDescriptor,\n AuthoringEntityTypeNamespace,\n AuthoringPslBlockDescriptorNamespace,\n PslExtensionBlock,\n} from '@prisma-next/framework-components/authoring';\nimport { type EnumTypeHandle, enumType } from '@prisma-next/sql-contract-ts/contract-builder';\nimport { blindCast } from '@prisma-next/utils/casts';\n\nfunction parseQuotedString(raw: string): string | undefined {\n if (raw.startsWith('\"') && raw.endsWith('\"') && raw.length >= 2) {\n return raw.slice(1, -1);\n }\n return undefined;\n}\n\nexport const sqlFamilyEnumEntityDescriptor = {\n kind: 'entity' as const,\n discriminator: 'enum',\n output: {\n factory: (\n block: PslExtensionBlock,\n ctx: AuthoringEntityContext,\n ): EnumTypeHandle | undefined => {\n const sourceId = ctx.sourceId ?? 'unknown';\n const diagnostics = ctx.diagnostics;\n\n const typeAttr = block.blockAttributes.find((a) => a.name === 'type');\n if (!typeAttr) {\n diagnostics?.push({\n code: 'PSL_ENUM_MISSING_TYPE',\n message: `enum \"${block.name}\" is missing a @@type(\"codecId\") attribute`,\n sourceId,\n span: block.span,\n });\n return undefined;\n }\n\n const rawCodecArg = typeAttr.args[0]?.value;\n const codecId = rawCodecArg !== undefined ? parseQuotedString(rawCodecArg) : undefined;\n if (!codecId) {\n diagnostics?.push({\n code: 'PSL_ENUM_MISSING_TYPE',\n message: `enum \"${block.name}\" @@type attribute must have a quoted codec id argument`,\n sourceId,\n span: typeAttr.span,\n });\n return undefined;\n }\n\n const nativeType = ctx.codecLookup?.targetTypesFor(codecId)?.[0];\n if (nativeType === undefined) {\n const typeArgSpan = typeAttr.args[0]?.span ?? typeAttr.span;\n diagnostics?.push({\n code: 'PSL_EXTENSION_INVALID_VALUE',\n message: `enum \"${block.name}\" @@type references unknown codec \"${codecId}\"`,\n sourceId,\n span: typeArgSpan,\n });\n return undefined;\n }\n\n const codec = ctx.codecLookup?.get(codecId);\n if (codec === undefined) {\n const typeArgSpan = typeAttr.args[0]?.span ?? typeAttr.span;\n diagnostics?.push({\n code: 'PSL_EXTENSION_INVALID_VALUE',\n message: `enum \"${block.name}\" @@type codec \"${codecId}\" resolves in targetTypesFor but is absent from codecLookup.get`,\n sourceId,\n span: typeArgSpan,\n });\n return undefined;\n }\n\n const seenValues = new Set<string>();\n const members: { name: string; value: unknown }[] = [];\n let memberError = false;\n\n for (const [memberName, paramValue] of Object.entries(block.parameters)) {\n let value: unknown;\n if (paramValue.kind === 'bare') {\n try {\n value = codec.decodeJson(memberName);\n } catch {\n diagnostics?.push({\n code: 'PSL_ENUM_BARE_MEMBER_NON_STRING_CODEC',\n message: `enum \"${block.name}\" member \"${memberName}\" has no value and codec \"${codecId}\" does not accept a bare name as input`,\n sourceId,\n span: paramValue.span,\n });\n memberError = true;\n continue;\n }\n } else if (paramValue.kind === 'value') {\n let jsonValue: unknown;\n try {\n jsonValue = JSON.parse(paramValue.raw);\n } catch {\n diagnostics?.push({\n code: 'PSL_EXTENSION_INVALID_VALUE',\n message: `enum \"${block.name}\" member \"${memberName}\" value \"${paramValue.raw}\" is not valid JSON`,\n sourceId,\n span: paramValue.span,\n });\n memberError = true;\n continue;\n }\n try {\n value = codec.decodeJson(\n blindCast<JsonValue, 'JSON.parse returns a JsonValue-compatible value'>(jsonValue),\n );\n } catch (err) {\n const reason = err instanceof Error ? err.message : String(err);\n diagnostics?.push({\n code: 'PSL_EXTENSION_INVALID_VALUE',\n message: `enum \"${block.name}\" member \"${memberName}\" was rejected by codec \"${codecId}\": ${reason}`,\n sourceId,\n span: paramValue.span,\n });\n memberError = true;\n continue;\n }\n } else {\n continue;\n }\n\n const valueKey = String(value);\n if (seenValues.has(valueKey)) {\n diagnostics?.push({\n code: 'PSL_ENUM_DUPLICATE_MEMBER_VALUE',\n message: `enum \"${block.name}\": duplicate member value \"${valueKey}\"`,\n sourceId,\n span: paramValue.span,\n });\n memberError = true;\n continue;\n }\n seenValues.add(valueKey);\n members.push({ name: memberName, value });\n }\n\n if (memberError) return undefined;\n\n if (members.length === 0) {\n diagnostics?.push({\n code: 'PSL_ENUM_MISSING_TYPE',\n message: `enum \"${block.name}\" must have at least one member`,\n sourceId,\n span: block.span,\n });\n return undefined;\n }\n\n return enumType(\n block.name,\n { codecId, nativeType },\n ...members.map((m) => ({ name: m.name, value: m.value })),\n );\n },\n },\n} satisfies AuthoringEntityTypeDescriptor;\n\nexport const sqlFamilyEntityTypes: AuthoringEntityTypeNamespace = {\n enum: sqlFamilyEnumEntityDescriptor,\n};\n\nexport const sqlFamilyPslBlockDescriptors = {\n enum: {\n kind: 'pslBlock',\n keyword: 'enum',\n discriminator: 'enum',\n name: { required: true },\n parameters: {},\n variadicParameters: true,\n },\n} as const satisfies AuthoringPslBlockDescriptorNamespace;\n","import type { AuthoringFieldNamespace } from '@prisma-next/framework-components/authoring';\n\n/**\n * Family-level SQL authoring field presets.\n *\n * Only presets whose codec IDs align with the ID generator metadata live here\n * (see `@prisma-next/ids`). These presets are target-agnostic because the\n * generator metadata fixes their codec/native-type to `sql/char@1`\n * (`character`) regardless of target, and the PSL interpreter lets the\n * generator override the scalar descriptor.\n *\n * The `uuidString` / `id.uuidv4String` / `id.uuidv7String` presets store UUID\n * values as `character(36)` — portable across all SQL targets. For a native\n * Postgres `uuid` column use `uuidNative` / `id.uuidv4Native` /\n * `id.uuidv7Native` from `@prisma-next/target-postgres`.\n *\n * Scalar presets that map to target-specific codecs (e.g. `text`, `int`,\n * `boolean`, `dateTime`) are contributed by the target pack (see\n * `postgresAuthoringFieldPresets` in `@prisma-next/target-postgres`) so the\n * TS callback surface and the PSL scalar surface lower to byte-identical\n * contracts for the active target.\n */\n\nconst CHARACTER_CODEC_ID = 'sql/char@1';\nconst CHARACTER_NATIVE_TYPE = 'character';\n\nconst nanoidOptionsArgument = {\n kind: 'object',\n optional: true,\n properties: {\n size: {\n kind: 'number',\n optional: true,\n integer: true,\n minimum: 2,\n maximum: 255,\n },\n },\n} as const;\n\nexport const sqlFamilyAuthoringFieldPresets = {\n uuidString: {\n kind: 'fieldPreset',\n output: {\n codecId: CHARACTER_CODEC_ID,\n nativeType: CHARACTER_NATIVE_TYPE,\n typeParams: {\n length: 36,\n },\n },\n },\n ulid: {\n kind: 'fieldPreset',\n output: {\n codecId: CHARACTER_CODEC_ID,\n nativeType: CHARACTER_NATIVE_TYPE,\n typeParams: {\n length: 26,\n },\n },\n },\n nanoid: {\n kind: 'fieldPreset',\n args: [nanoidOptionsArgument],\n output: {\n codecId: CHARACTER_CODEC_ID,\n nativeType: CHARACTER_NATIVE_TYPE,\n typeParams: {\n length: {\n kind: 'arg',\n index: 0,\n path: ['size'],\n default: 21,\n },\n },\n },\n },\n cuid2: {\n kind: 'fieldPreset',\n output: {\n codecId: CHARACTER_CODEC_ID,\n nativeType: CHARACTER_NATIVE_TYPE,\n typeParams: {\n length: 24,\n },\n },\n },\n ksuid: {\n kind: 'fieldPreset',\n output: {\n codecId: CHARACTER_CODEC_ID,\n nativeType: CHARACTER_NATIVE_TYPE,\n typeParams: {\n length: 27,\n },\n },\n },\n id: {\n uuidv4String: {\n kind: 'fieldPreset',\n output: {\n codecId: CHARACTER_CODEC_ID,\n nativeType: CHARACTER_NATIVE_TYPE,\n typeParams: {\n length: 36,\n },\n executionDefaults: {\n onCreate: {\n kind: 'generator',\n id: 'uuidv4',\n },\n },\n id: true,\n },\n },\n uuidv7String: {\n kind: 'fieldPreset',\n output: {\n codecId: CHARACTER_CODEC_ID,\n nativeType: CHARACTER_NATIVE_TYPE,\n typeParams: {\n length: 36,\n },\n executionDefaults: {\n onCreate: {\n kind: 'generator',\n id: 'uuidv7',\n },\n },\n id: true,\n },\n },\n ulid: {\n kind: 'fieldPreset',\n output: {\n codecId: CHARACTER_CODEC_ID,\n nativeType: CHARACTER_NATIVE_TYPE,\n typeParams: {\n length: 26,\n },\n executionDefaults: {\n onCreate: {\n kind: 'generator',\n id: 'ulid',\n },\n },\n id: true,\n },\n },\n nanoid: {\n kind: 'fieldPreset',\n args: [nanoidOptionsArgument],\n output: {\n codecId: CHARACTER_CODEC_ID,\n nativeType: CHARACTER_NATIVE_TYPE,\n typeParams: {\n length: {\n kind: 'arg',\n index: 0,\n path: ['size'],\n default: 21,\n },\n },\n executionDefaults: {\n onCreate: {\n kind: 'generator',\n id: 'nanoid',\n params: {\n size: {\n kind: 'arg',\n index: 0,\n path: ['size'],\n },\n },\n },\n },\n id: true,\n },\n },\n cuid2: {\n kind: 'fieldPreset',\n output: {\n codecId: CHARACTER_CODEC_ID,\n nativeType: CHARACTER_NATIVE_TYPE,\n typeParams: {\n length: 24,\n },\n executionDefaults: {\n onCreate: {\n kind: 'generator',\n id: 'cuid2',\n },\n },\n id: true,\n },\n },\n ksuid: {\n kind: 'fieldPreset',\n output: {\n codecId: CHARACTER_CODEC_ID,\n nativeType: CHARACTER_NATIVE_TYPE,\n typeParams: {\n length: 27,\n },\n executionDefaults: {\n onCreate: {\n kind: 'generator',\n id: 'ksuid',\n },\n },\n id: true,\n },\n },\n },\n} as const satisfies AuthoringFieldNamespace;\n","import type { AuthoringTypeNamespace } from '@prisma-next/framework-components/authoring';\n\nexport const sqlFamilyAuthoringTypes = {\n sql: {\n String: {\n kind: 'typeConstructor',\n args: [{ kind: 'number', name: 'length', integer: true, minimum: 1, maximum: 10485760 }],\n output: {\n codecId: 'sql/varchar@1',\n nativeType: 'character varying',\n typeParams: {\n length: { kind: 'arg', index: 0 },\n },\n },\n },\n },\n} as const satisfies AuthoringTypeNamespace;\n"],"mappings":";;;AAWA,SAAS,kBAAkB,KAAiC;CAC1D,IAAI,IAAI,WAAW,IAAG,KAAK,IAAI,SAAS,IAAG,KAAK,IAAI,UAAU,GAC5D,OAAO,IAAI,MAAM,GAAG,EAAE;AAG1B;AAoJA,MAAa,uBAAqD,EAChE,MAAM;CAlJN,MAAM;CACN,eAAe;CACf,QAAQ,EACN,UACE,OACA,QAC+B;EAC/B,MAAM,WAAW,IAAI,YAAY;EACjC,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;GACN;EACF;EACA,MAAM;GACJ,MAAM;GACN,QAAQ;IACN,SAAS;IACT,YAAY;IACZ,YAAY,EACV,QAAQ,GACV;IACA,mBAAmB,EACjB,UAAU;KACR,MAAM;KACN,IAAI;IACN,EACF;IACA,IAAI;GACN;EACF;EACA,QAAQ;GACN,MAAM;GACN,MAAM,CAAC,qBAAqB;GAC5B,QAAQ;IACN,SAAS;IACT,YAAY;IACZ,YAAY,EACV,QAAQ;KACN,MAAM;KACN,OAAO;KACP,MAAM,CAAC,MAAM;KACb,SAAS;IACX,EACF;IACA,mBAAmB,EACjB,UAAU;KACR,MAAM;KACN,IAAI;KACJ,QAAQ,EACN,MAAM;MACJ,MAAM;MACN,OAAO;MACP,MAAM,CAAC,MAAM;KACf,EACF;IACF,EACF;IACA,IAAI;GACN;EACF;EACA,OAAO;GACL,MAAM;GACN,QAAQ;IACN,SAAS;IACT,YAAY;IACZ,YAAY,EACV,QAAQ,GACV;IACA,mBAAmB,EACjB,UAAU;KACR,MAAM;KACN,IAAI;IACN,EACF;IACA,IAAI;GACN;EACF;EACA,OAAO;GACL,MAAM;GACN,QAAQ;IACN,SAAS;IACT,YAAY;IACZ,YAAY,EACV,QAAQ,GACV;IACA,mBAAmB,EACjB,UAAU;KACR,MAAM;KACN,IAAI;IACN,EACF;IACA,IAAI;GACN;EACF;CACF;AACF;;;ACpNA,MAAa,0BAA0B,EACrC,KAAK,EACH,QAAQ;CACN,MAAM;CACN,MAAM,CAAC;EAAE,MAAM;EAAU,MAAM;EAAU,SAAS;EAAM,SAAS;EAAG,SAAS;CAAS,CAAC;CACvF,QAAQ;EACN,SAAS;EACT,YAAY;EACZ,YAAY,EACV,QAAQ;GAAE,MAAM;GAAO,OAAO;EAAE,EAClC;CACF;AACF,EACF,EACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"schema-verify.d.mts","names":[],"sources":["../src/core/schema-verify/verify-helpers.ts"],"mappings":";;;;;;;;;iBAgEgB,WAAA,CAAY,CAAA,qBAAsB,CAAoB;AA+BtE;;;;;;;;;;AAG4B;AAuB5B;AA1BA,iBAAgB,2BAAA,CACd,OAAA,WAAkB,WAAA,IAClB,OAAA,WAAkB,UAAU,IAC5B,OAAA;;;;;;;;;AA0B0B;;;;iBAHZ,gBAAA,CACd,OAAA,WAAkB,UAAA,IAClB,OAAA,WAAkB,WAAW,IAC7B,OAAA"}
@@ -1,2 +0,0 @@
1
- import { i as isUniqueConstraintSatisfied, n as arraysEqual, r as isIndexSatisfied, t as verifySqlSchema } from "./verify-sql-schema-xT4udQLQ.mjs";
2
- export { arraysEqual, isIndexSatisfied, isUniqueConstraintSatisfied, verifySqlSchema };
@@ -1 +0,0 @@
1
- {"version":3,"file":"sql-contract-serializer-BR2vC7Z-.mjs","names":[],"sources":["../src/core/ir/sql-contract-serializer-base.ts","../src/core/ir/sql-contract-serializer.ts"],"sourcesContent":["import { ContractValidationError } from '@prisma-next/contract/contract-validation-error';\nimport { isPlainRecord } from '@prisma-next/contract/is-plain-record';\nimport type { Contract } from '@prisma-next/contract/types';\nimport type { ContractSerializer } from '@prisma-next/framework-components/control';\nimport {\n type AnyEntityKindDescriptor,\n hydrateNamespaceEntities,\n type Namespace,\n NamespaceBase,\n UNBOUND_NAMESPACE_ID,\n} from '@prisma-next/framework-components/ir';\nimport { sqlContractCanonicalizationHooks } from '@prisma-next/sql-contract/canonicalization-hooks';\nimport { composeSqlEntityKinds } from '@prisma-next/sql-contract/entity-kinds';\nimport {\n buildSqlNamespace,\n type SqlNamespaceTablesInput,\n SqlStorage,\n type SqlStorageInput,\n type SqlStorageTypeEntry,\n SqlUnboundNamespace,\n} from '@prisma-next/sql-contract/types';\nimport {\n createSqlContractSchema,\n validateSqlContractFully,\n} from '@prisma-next/sql-contract/validators';\nimport { blindCast } from '@prisma-next/utils/casts';\nimport { ifDefined } from '@prisma-next/utils/defined';\nimport type { JsonObject } from '@prisma-next/utils/json';\nimport { type Type, type } from 'arktype';\n\nconst NamespaceRawSchema = type({\n id: 'string',\n 'kind?': 'string',\n entries: type({\n '+': 'ignore',\n }),\n});\n\nexport type SqlEntityHydrationFactory = (entry: unknown) => unknown;\n\n/**\n * SQL family `ContractSerializer` abstract base. Carries the SQL-shared\n * deserialization pipeline:\n *\n * 1. `parseSqlContractStructure` validates the on-disk JSON envelope\n * against the SQL contract arktype schema (`validateSqlContractFully`)\n * and returns the validated flat-data shape.\n * 2. `hydrateSqlStorage` walks the validated `storage` subtree and\n * constructs the family-shared SQL Contract IR class hierarchy\n * (`SqlStorage` -> `StorageTable` -> `StorageColumn` / `PrimaryKey`\n * / …). The rest of the contract envelope is JSON-clean primitive\n * data and passes through unchanged.\n * 3. `constructTargetContract` is the target-specific extension hook;\n * defaults to identity. Targets that need to attach target-only\n * fields (e.g. target-specific derived storage fields) override it.\n *\n * Default `serializeContract` is identity over the contract — concrete\n * SQL targets ship JSON-clean class instances, so the contract value\n * can be stringified directly. The non-enumerable family-level `kind`\n * discriminator on `SqlNode` instances stays out of the persisted\n * envelope automatically. Targets that need to canonicalize on the way\n * out (key ordering, dropping computed-only fields) override\n * `serializeContract` directly.\n */\nexport abstract class SqlContractSerializerBase<TContract extends Contract<SqlStorage>>\n implements ContractSerializer<TContract>\n{\n private readonly contractSchema: Type<unknown> | undefined;\n private readonly entryKinds: ReadonlyMap<string, AnyEntityKindDescriptor>;\n\n constructor(\n protected readonly entityHydrationRegistry: ReadonlyMap<\n string,\n SqlEntityHydrationFactory\n > = new Map(),\n packEntityKinds: readonly AnyEntityKindDescriptor[] = [],\n ) {\n this.entryKinds = composeSqlEntityKinds(packEntityKinds);\n this.contractSchema =\n packEntityKinds.length > 0 ? createSqlContractSchema(this.entryKinds) : undefined;\n }\n\n deserializeContract<T extends TContract = TContract>(json: unknown): T {\n const validated = this.parseSqlContractStructure(json);\n const hydrated = this.hydrateSqlStorage(validated);\n return this.constructTargetContract(hydrated) as T;\n }\n\n serializeContract(contract: TContract): JsonObject {\n return contract as unknown as JsonObject;\n }\n\n shouldPreserveEmpty = sqlContractCanonicalizationHooks.shouldPreserveEmpty;\n\n sortStorage = sqlContractCanonicalizationHooks.sortStorage;\n\n protected parseSqlContractStructure(json: unknown): Contract<SqlStorage> {\n return validateSqlContractFully<Contract<SqlStorage>>(\n json,\n this.contractSchema !== undefined ? { contractSchema: this.contractSchema } : undefined,\n );\n }\n\n protected hydrateSqlStorage(validated: Contract<SqlStorage>): Contract<SqlStorage> {\n const types = validated.storage.types;\n const hydratedTypes =\n types !== undefined\n ? Object.fromEntries(\n Object.entries(types).map(([name, entry]) => [\n name,\n this.hydrateStorageTypeEntry(entry),\n ]),\n )\n : undefined;\n\n const rawNamespaces = validated.storage.namespaces;\n if (rawNamespaces === undefined) {\n throw new ContractValidationError(\n 'Contract storage.namespaces is required after structural validation',\n 'structural',\n );\n }\n const hydratedNamespaces = this.hydrateSqlNamespaceMap(rawNamespaces);\n // Compatibility shim: production code that addresses `__unbound__` for table\n // metadata lookups (collection-contract, query-plan-mutations, model-accessor,\n // query-plan-meta, where-binding) uses optional chaining and tolerates absence,\n // but runtime-qualification (TML-2605) has not yet landed cross-namespace table\n // routing. Injecting the empty singleton here keeps helpers that augment the\n // deserialized JSON (e.g. buildMixedPolyContract) working by providing a slot to\n // write into. Once runtime-qualification routes table lookups by namespace, this\n // shim should be removed.\n //\n // TML-2916: the shim only fires when the target's default namespace IS unbound\n // (SQLite, Mongo). On Postgres (`defaultNamespaceId === 'public'`) injecting an\n // empty `__unbound__` slot violates ADR 223 — un-namespaced PG models belong in\n // `public`, not `__unbound__`.\n const withInjectedUnbound =\n this.defaultNamespaceId === UNBOUND_NAMESPACE_ID\n ? {\n ...hydratedNamespaces,\n [UNBOUND_NAMESPACE_ID]:\n hydratedNamespaces[UNBOUND_NAMESPACE_ID] ?? SqlUnboundNamespace.instance,\n }\n : hydratedNamespaces;\n\n return {\n ...validated,\n storage: new SqlStorage({\n storageHash: validated.storage.storageHash,\n ...ifDefined('types', hydratedTypes),\n // Cast narrows the result of hydrateSqlNamespaceMap from the wider\n // framework `Namespace` to the SQL-family `SqlNamespace`.\n namespaces: blindCast<\n SqlStorageInput['namespaces'],\n 'hydrateSqlNamespaceMap builds each namespace through the SQL family concretions (SqlBoundNamespace / target schema), so every value is a SqlNamespace; the framework return type only promises the base Namespace.'\n >(withInjectedUnbound),\n }),\n };\n }\n\n protected abstract get defaultNamespaceId(): string;\n\n protected hydrateSqlNamespaceMap(\n namespaces: Readonly<Record<string, Namespace | Record<string, unknown>>>,\n ): Readonly<Record<string, Namespace>> {\n return Object.fromEntries(\n Object.entries(namespaces).map(([nsId, namespaceEntryRaw]) => {\n // Raw entries passed structural validation; hydrate materialises family IR class instances.\n const namespaceHydrated = this.hydrateSqlNamespaceEntry(nsId, namespaceEntryRaw);\n const namespaceMaterialised =\n namespaceHydrated instanceof NamespaceBase\n ? namespaceHydrated\n : buildSqlNamespace(\n blindCast<\n SqlNamespaceTablesInput,\n 'hydrateSqlNamespaceEntry returns SqlNamespaceTablesInput when raw is not a NamespaceBase'\n >(namespaceHydrated),\n );\n return [nsId, namespaceMaterialised];\n }),\n );\n }\n\n protected hydrateSqlNamespaceEntry(\n nsId: string,\n raw: Namespace | Record<string, unknown>,\n ): Namespace | SqlNamespaceTablesInput {\n if (raw instanceof NamespaceBase) {\n return raw;\n }\n const rawRecord = isPlainRecord(raw) ? raw : {};\n const id = typeof rawRecord['id'] === 'string' ? rawRecord['id'] : nsId;\n const parsed = NamespaceRawSchema({ ...rawRecord, id });\n if (parsed instanceof type.errors) {\n const messages = parsed.map((p: { message: string }) => p.message).join('; ');\n throw new ContractValidationError(`Namespace hydration failed: ${messages}`, 'structural');\n }\n const entriesRaw = parsed.entries;\n const rawEntriesMap = isPlainRecord(entriesRaw) ? entriesRaw : {};\n\n const entriesInput: Record<string, Readonly<Record<string, unknown>>> = {};\n for (const [key, innerMap] of Object.entries(rawEntriesMap)) {\n entriesInput[key] = isPlainRecord(innerMap) ? innerMap : Object.freeze({});\n }\n\n const entriesOutput = hydrateNamespaceEntities(entriesInput, this.entryKinds, 'fail', id);\n\n // Always ensure a 'table' key is present (may be empty).\n if (!Object.hasOwn(entriesOutput, 'table')) {\n entriesOutput['table'] = {};\n }\n\n return blindCast<\n SqlNamespaceTablesInput,\n 'entriesOutput holds the hydrated SQL entity-kind maps (table always present); this wraps them as the SqlNamespaceTablesInput the family createNamespace consumes.'\n >({\n id,\n entries: entriesOutput,\n });\n }\n\n protected hydrateStorageTypeEntry(entry: SqlStorageTypeEntry): SqlStorageTypeEntry {\n if (typeof entry !== 'object' || entry === null) {\n return entry;\n }\n const kind = (entry as { kind?: unknown }).kind;\n if (typeof kind !== 'string') {\n return entry;\n }\n const factory = this.entityHydrationRegistry.get(kind);\n if (factory === undefined) {\n return entry;\n }\n return blindCast<\n SqlStorageTypeEntry,\n 'entity registry factory returns SqlStorageTypeEntry for storage.types entries'\n >(factory(entry));\n }\n\n protected constructTargetContract(hydrated: Contract<SqlStorage>): TContract {\n return hydrated as TContract;\n }\n}\n","import type { Contract } from '@prisma-next/contract/types';\nimport { UNBOUND_NAMESPACE_ID } from '@prisma-next/framework-components/ir';\nimport type { SqlStorage } from '@prisma-next/sql-contract/types';\nimport { SqlContractSerializerBase } from './sql-contract-serializer-base';\n\n/**\n * Default SQL family `ContractSerializer` concretion. Inherits the\n * full SQL-shared deserialization pipeline (structural validation +\n * IR-class hydration) without pack-registered `storage.types`\n * hydration factories — targets that emit polymorphic JSON outside the\n * codec-typed envelope wire a target-specific subclass with a populated\n * registry (see Postgres). Family-level call sites instantiate this\n * default directly when no target serializer is supplied.\n */\nexport class SqlContractSerializer extends SqlContractSerializerBase<Contract<SqlStorage>> {\n constructor() {\n super(new Map());\n }\n\n // Family-level fallback when no target descriptor is wired in. Preserves the\n // pre-TML-2916 compatibility-shim behaviour for the unbound slot.\n protected override get defaultNamespaceId(): string {\n return UNBOUND_NAMESPACE_ID;\n }\n}\n"],"mappings":";;;;;;;;;;;AA8BA,MAAM,qBAAqB,KAAK;CAC9B,IAAI;CACJ,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A,GACd,OAAO;EAET,OAAO,UAGL,QAAQ,KAAK,CAAC;CAClB;CAEA,wBAAkC,UAA2C;EAC3E,OAAO;CACT;AACF;;;;;;;;;;;;ACpOA,IAAa,wBAAb,cAA2C,0BAAgD;CACzF,cAAc;EACZ,sBAAM,IAAI,IAAI,CAAC;CACjB;CAIA,IAAuB,qBAA6B;EAClD,OAAO;CACT;AACF"}
@@ -1,2 +0,0 @@
1
- import { extractCodecTypeImports, extractComponentIds, extractQueryOperationTypeImports } from "@prisma-next/framework-components/control";
2
- export { extractCodecTypeImports, extractComponentIds, extractQueryOperationTypeImports };
@@ -1,2 +0,0 @@
1
- import { extractCodecTypeImports, extractComponentIds, extractQueryOperationTypeImports } from "@prisma-next/framework-components/control";
2
- export { extractCodecTypeImports, extractComponentIds, extractQueryOperationTypeImports };
@@ -1 +0,0 @@
1
- {"version":3,"file":"types-kgstZ_Zd.d.mts","names":[],"sources":["../src/core/control-instance.ts","../src/core/migrations/types.ts"],"mappings":";;;;;;;;;;;;;;UA4KU,eAAA;EAAA,SACC,MAAA;EAAA,SACA,QAAA;EAAA,SACA,QAAA;EAAA,SACA,UAAA;AAAA;AAAA,KAGN,uBAAA,GAA0B,GAAG,SAAS,eAAA;AAAA,UAEjC,sBAAA;EAAA,SACC,gBAAA,EAAkB,aAAA,CAAc,eAAA;EAAA,SAChC,YAAA,EAAc,aAAA;EAAA,SACd,oBAAA,EAAsB,uBAAA;AAAA;AAAA,UAGhB,wBAAA,SACP,qBAAA,QAA6B,WAAA,GACnC,iBAAA,CAAkB,WAAA,GAClB,uBAAA,CAAwB,WAAA,GACxB,uBAAA,EACA,sBAAA;EAhBO;;AAAU;AAAA;;;;AAGqC;EAsBxD,mBAAA,CAAoB,YAAA,YAAwB,QAAA;EAE5C,MAAA,CAAO,OAAA;IAAA,SACI,MAAA,EAAQ,wBAAA;IAAA,SACR,QAAA;IAAA,SACA,gBAAA;IAAA,SACA,YAAA;IAAA,SACA,UAAA;EAAA,IACP,OAAA,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