@prisma-next/family-sql 0.3.0-pr.94.2 → 0.3.0-pr.95.2

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 (87) hide show
  1. package/dist/chunk-H7CGY6OH.js +611 -0
  2. package/dist/chunk-H7CGY6OH.js.map +1 -0
  3. package/dist/chunk-SU7LN2UH.js +96 -0
  4. package/dist/chunk-SU7LN2UH.js.map +1 -0
  5. package/dist/chunk-XH2Y5NTD.js +715 -0
  6. package/dist/chunk-XH2Y5NTD.js.map +1 -0
  7. package/dist/core/assembly.d.ts +36 -0
  8. package/dist/core/assembly.d.ts.map +1 -0
  9. package/dist/core/control-adapter.d.ts +42 -0
  10. package/dist/core/control-adapter.d.ts.map +1 -0
  11. package/dist/core/descriptor.d.ts +25 -0
  12. package/dist/core/descriptor.d.ts.map +1 -0
  13. package/dist/core/instance.d.ts +140 -0
  14. package/dist/core/instance.d.ts.map +1 -0
  15. package/dist/core/migrations/plan-helpers.d.ts +20 -0
  16. package/dist/core/migrations/plan-helpers.d.ts.map +1 -0
  17. package/dist/core/migrations/policies.d.ts +6 -0
  18. package/dist/core/migrations/policies.d.ts.map +1 -0
  19. package/dist/core/migrations/types.d.ts +280 -0
  20. package/dist/core/migrations/types.d.ts.map +1 -0
  21. package/dist/core/runtime-descriptor.d.ts +19 -0
  22. package/dist/core/runtime-descriptor.d.ts.map +1 -0
  23. package/dist/core/runtime-instance.d.ts +54 -0
  24. package/dist/core/runtime-instance.d.ts.map +1 -0
  25. package/dist/core/schema-verify/verify-helpers.d.ts +96 -0
  26. package/dist/core/schema-verify/verify-helpers.d.ts.map +1 -0
  27. package/dist/core/schema-verify/verify-sql-schema.d.ts +45 -0
  28. package/dist/core/schema-verify/verify-sql-schema.d.ts.map +1 -0
  29. package/dist/core/verify.d.ts +39 -0
  30. package/dist/core/verify.d.ts.map +1 -0
  31. package/dist/exports/control-adapter.d.ts +2 -0
  32. package/dist/exports/control-adapter.d.ts.map +1 -0
  33. package/dist/exports/control-adapter.js +1 -0
  34. package/dist/exports/control-adapter.js.map +1 -0
  35. package/dist/exports/control.d.ts +13 -0
  36. package/dist/exports/control.d.ts.map +1 -0
  37. package/dist/exports/control.js +149 -0
  38. package/dist/exports/control.js.map +1 -0
  39. package/dist/exports/runtime.d.ts +8 -0
  40. package/dist/exports/runtime.d.ts.map +1 -0
  41. package/dist/exports/runtime.js +64 -0
  42. package/dist/exports/runtime.js.map +1 -0
  43. package/dist/exports/schema-verify.d.ts +11 -0
  44. package/dist/exports/schema-verify.d.ts.map +1 -0
  45. package/dist/exports/schema-verify.js +15 -0
  46. package/dist/exports/schema-verify.js.map +1 -0
  47. package/dist/exports/test-utils.d.ts +7 -0
  48. package/dist/exports/test-utils.d.ts.map +1 -0
  49. package/dist/exports/test-utils.js +17 -0
  50. package/dist/exports/test-utils.js.map +1 -0
  51. package/dist/exports/verify.d.ts +2 -0
  52. package/dist/exports/verify.d.ts.map +1 -0
  53. package/dist/exports/verify.js +11 -0
  54. package/dist/exports/verify.js.map +1 -0
  55. package/package.json +44 -31
  56. package/src/core/assembly.ts +48 -0
  57. package/src/core/instance.ts +4 -1
  58. package/dist/control-adapter.d.mts +0 -47
  59. package/dist/control-adapter.d.mts.map +0 -1
  60. package/dist/control-adapter.mjs +0 -1
  61. package/dist/control.d.mts +0 -65
  62. package/dist/control.d.mts.map +0 -1
  63. package/dist/control.mjs +0 -136
  64. package/dist/control.mjs.map +0 -1
  65. package/dist/instance-B_PdDN4y.mjs +0 -525
  66. package/dist/instance-B_PdDN4y.mjs.map +0 -1
  67. package/dist/instance-wm4TrZN0.d.mts +0 -130
  68. package/dist/instance-wm4TrZN0.d.mts.map +0 -1
  69. package/dist/runtime.d.mts +0 -70
  70. package/dist/runtime.d.mts.map +0 -1
  71. package/dist/runtime.mjs +0 -74
  72. package/dist/runtime.mjs.map +0 -1
  73. package/dist/schema-verify.d.mts +0 -85
  74. package/dist/schema-verify.d.mts.map +0 -1
  75. package/dist/schema-verify.mjs +0 -3
  76. package/dist/test-utils.d.mts +0 -31
  77. package/dist/test-utils.d.mts.map +0 -1
  78. package/dist/test-utils.mjs +0 -5
  79. package/dist/types-D5CPT9N4.d.mts +0 -270
  80. package/dist/types-D5CPT9N4.d.mts.map +0 -1
  81. package/dist/verify-DhFytkFC.mjs +0 -108
  82. package/dist/verify-DhFytkFC.mjs.map +0 -1
  83. package/dist/verify-sql-schema-BnLVoeWI.mjs +0 -686
  84. package/dist/verify-sql-schema-BnLVoeWI.mjs.map +0 -1
  85. package/dist/verify.d.mts +0 -31
  86. package/dist/verify.d.mts.map +0 -1
  87. package/dist/verify.mjs +0 -3
@@ -1,130 +0,0 @@
1
- import { OperationRegistry } from "@prisma-next/operations";
2
- import { ControlAdapterDescriptor, ControlDriverInstance, ControlExtensionDescriptor, ControlFamilyInstance, ControlTargetDescriptor, EmitContractResult, OperationContext, SignDatabaseResult, VerifyDatabaseResult, VerifyDatabaseSchemaResult } from "@prisma-next/core-control-plane/types";
3
- import { SqlSchemaIR } from "@prisma-next/sql-schema-ir/types";
4
- import { ContractIR } from "@prisma-next/contract/ir";
5
- import { TypesImportSpec } from "@prisma-next/contract/types";
6
- import { TargetBoundComponentDescriptor } from "@prisma-next/contract/framework-components";
7
- import { OperationManifest } from "@prisma-next/contract/pack-manifest-types";
8
- import { CoreSchemaView } from "@prisma-next/core-control-plane/schema-view";
9
- import { SqlOperationSignature } from "@prisma-next/sql-operations";
10
-
11
- //#region src/core/instance.d.ts
12
-
13
- /**
14
- * Converts an OperationManifest (descriptor declarative data) to a SqlOperationSignature.
15
- * This is SQL-family-specific conversion logic used by instance creation and test utilities.
16
- */
17
- declare function convertOperationManifest(manifest: OperationManifest): SqlOperationSignature;
18
- /**
19
- * Type metadata for SQL storage types.
20
- * Maps contract storage type IDs to native database types.
21
- */
22
- interface SqlTypeMetadata {
23
- readonly typeId: string;
24
- readonly familyId: 'sql';
25
- readonly targetId: string;
26
- readonly nativeType?: string;
27
- }
28
- /**
29
- * Registry mapping type IDs to their metadata.
30
- * Keyed by contract storage type ID (e.g., 'pg/int4@1').
31
- */
32
- type SqlTypeMetadataRegistry = Map<string, SqlTypeMetadata>;
33
- /**
34
- * State fields for SQL family instance that hold assembly data.
35
- */
36
- interface SqlFamilyInstanceState {
37
- readonly operationRegistry: OperationRegistry;
38
- readonly codecTypeImports: ReadonlyArray<TypesImportSpec>;
39
- readonly operationTypeImports: ReadonlyArray<TypesImportSpec>;
40
- readonly extensionIds: ReadonlyArray<string>;
41
- readonly typeMetadataRegistry: SqlTypeMetadataRegistry;
42
- }
43
- /**
44
- * Options for schema verification.
45
- */
46
- interface SchemaVerifyOptions {
47
- readonly driver: ControlDriverInstance<'sql', string>;
48
- readonly contractIR: unknown;
49
- readonly strict: boolean;
50
- readonly context?: OperationContext;
51
- /**
52
- * Active framework components participating in this composition.
53
- * All components must have matching familyId ('sql') and targetId.
54
- */
55
- readonly frameworkComponents: ReadonlyArray<TargetBoundComponentDescriptor<'sql', string>>;
56
- }
57
- /**
58
- * SQL control family instance interface.
59
- * Extends ControlFamilyInstance with SQL-specific domain actions.
60
- */
61
- interface SqlControlFamilyInstance extends ControlFamilyInstance<'sql'>, SqlFamilyInstanceState {
62
- /**
63
- * Validates a contract JSON and returns a validated ContractIR (without mappings).
64
- * Mappings are runtime-only and should not be part of ContractIR.
65
- */
66
- validateContractIR(contractJson: unknown): ContractIR;
67
- /**
68
- * Verifies the database marker against the contract.
69
- * Compares target, coreHash, and profileHash.
70
- */
71
- verify(options: {
72
- readonly driver: ControlDriverInstance<'sql', string>;
73
- readonly contractIR: unknown;
74
- readonly expectedTargetId: string;
75
- readonly contractPath: string;
76
- readonly configPath?: string;
77
- }): Promise<VerifyDatabaseResult>;
78
- /**
79
- * Verifies the database schema against the contract.
80
- * Compares contract requirements against live database schema.
81
- */
82
- schemaVerify(options: SchemaVerifyOptions): Promise<VerifyDatabaseSchemaResult>;
83
- /**
84
- * Signs the database with the contract marker.
85
- * Writes or updates the contract marker if schema verification passes.
86
- * This operation is idempotent - if the marker already matches, no changes are made.
87
- */
88
- sign(options: {
89
- readonly driver: ControlDriverInstance<'sql', string>;
90
- readonly contractIR: unknown;
91
- readonly contractPath: string;
92
- readonly configPath?: string;
93
- }): Promise<SignDatabaseResult>;
94
- /**
95
- * Introspects the database schema and returns a family-specific schema IR.
96
- *
97
- * This is a read-only operation that returns a snapshot of the live database schema.
98
- * The method is family-owned and delegates to target/adapter-specific introspectors
99
- * to perform the actual schema introspection.
100
- *
101
- * @param options - Introspection options
102
- * @param options.driver - Control plane driver for database connection
103
- * @param options.contractIR - Optional contract IR for contract-guided introspection.
104
- * When provided, families may use it for filtering, optimization, or validation
105
- * during introspection. The contract IR does not change the meaning of "what exists"
106
- * in the database - it only guides how introspection is performed.
107
- * @returns Promise resolving to the family-specific Schema IR (e.g., `SqlSchemaIR` for SQL).
108
- * The IR represents the complete schema snapshot at the time of introspection.
109
- */
110
- introspect(options: {
111
- readonly driver: ControlDriverInstance<'sql', string>;
112
- readonly contractIR?: unknown;
113
- }): Promise<SqlSchemaIR>;
114
- /**
115
- * Projects a SQL Schema IR into a core schema view for CLI visualization.
116
- * Converts SqlSchemaIR (tables, columns, indexes, extensions) into a tree structure.
117
- */
118
- toSchemaView(schema: SqlSchemaIR): CoreSchemaView;
119
- /**
120
- * Emits contract JSON and DTS as strings.
121
- * Uses the instance's preassembled state (operation registry, type imports, extension IDs).
122
- * Handles stripping mappings and validation internally.
123
- */
124
- emitContract(options: {
125
- readonly contractIR: ContractIR | unknown;
126
- }): Promise<EmitContractResult>;
127
- }
128
- //#endregion
129
- export { SqlControlFamilyInstance as n, convertOperationManifest as r, SchemaVerifyOptions as t };
130
- //# sourceMappingURL=instance-wm4TrZN0.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"instance-wm4TrZN0.d.mts","names":[],"sources":["../src/core/instance.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;AA4CA;AAsCC;AAuII,iBA7KW,wBAAA,CA6K2B,QAAA,EA7KQ,iBA6KjB,CAAA,EA7KqC,qBA6KrC;AAAA;;;;UAXxB,eAAA,CAmBqC;EAAd,SAAA,MAAA,EAAA,MAAA;EACR,SAAA,QAAA,EAAA,KAAA;EACQ,SAAA,QAAA,EAAA,MAAA;EAAuB,SAAA,UAAA,CAAA,EAAA,MAAA;AAMxD;;;;;KAhBK,uBAAA,GAA0B,GAyBc,CAAA,MAAA,EAzBF,eAyBE,CAAA;AAO7C;;;UA3BU,sBAAA,CA8CI;EAAR,SAAA,iBAAA,EA7CwB,iBA6CxB;EAMkB,SAAA,gBAAA,EAlDK,aAkDL,CAlDmB,eAkDnB,CAAA;EAA8B,SAAA,oBAAA,EAjDrB,aAiDqB,CAjDP,eAiDO,CAAA;EAAR,SAAA,YAAA,EAhDrB,aAgDqB,CAAA,MAAA,CAAA;EAQzB,SAAA,oBAAA,EAvDY,uBAuDZ;;;;;AAyBf,UA1EW,mBAAA,CA0EX;EAMiB,SAAA,MAAA,EA/EJ,qBA+EI,CAAA,KAAA,EAAA,MAAA,CAAA;EAAc,SAAA,UAAA,EAAA,OAAA;EAOU,SAAA,MAAA,EAAA,OAAA;EAAiC,SAAA,OAAA,CAAA,EAnF3D,gBAmF2D;EAAR;;;;gCA9ExC,cAAc;;;;;;UAO7B,wBAAA,SACP,8BACN;;;;;6CAKyC;;;;;;qBAOxB;;;;;MAKf,QAAQ;;;;;wBAMU,sBAAsB,QAAQ;;;;;;;qBAQjC;;;;MAIf,QAAQ;;;;;;;;;;;;;;;;;;qBAmBO;;MAEf,QAAQ;;;;;uBAMS,cAAc;;;;;;;yBAOU;MAAyB,QAAQ"}
@@ -1,70 +0,0 @@
1
- import { Runtime, SqlRuntimeAdapterInstance } from "@prisma-next/sql-runtime";
2
- import { SqlContract, SqlStorage } from "@prisma-next/sql-contract/types";
3
- import { RuntimeAdapterDescriptor, RuntimeDriverDescriptor, RuntimeDriverInstance, RuntimeExtensionDescriptor, RuntimeFamilyDescriptor, RuntimeFamilyInstance, RuntimeTargetDescriptor } from "@prisma-next/core-execution-plane/types";
4
- import { Log, Plugin, RuntimeVerifyOptions } from "@prisma-next/runtime-executor";
5
- import { Adapter, LoweredStatement, SelectAst, SqlDriver } from "@prisma-next/sql-relational-core/ast";
6
-
7
- //#region src/core/runtime-instance.d.ts
8
-
9
- /**
10
- * SQL runtime driver instance type.
11
- * Combines identity properties with SQL-specific behavior methods.
12
- */
13
- type SqlRuntimeDriverInstance<TTargetId extends string = string> = RuntimeDriverInstance<'sql', TTargetId> & SqlDriver;
14
- /**
15
- * SQL runtime family instance interface.
16
- * Extends base RuntimeFamilyInstance with SQL-specific runtime creation method.
17
- */
18
- interface SqlRuntimeFamilyInstance extends RuntimeFamilyInstance<'sql'> {
19
- /**
20
- * Creates a SQL runtime from contract, driver options, and verification settings.
21
- *
22
- * Extension packs are routed through composition (at instance creation time),
23
- * not through this method. This aligns with control-plane composition patterns.
24
- *
25
- * @param options - Runtime creation options
26
- * @param options.contract - SQL contract
27
- * @param options.driverOptions - Driver options (e.g., PostgresDriverOptions)
28
- * @param options.verify - Runtime verification options
29
- * @param options.plugins - Optional plugins
30
- * @param options.mode - Optional runtime mode
31
- * @param options.log - Optional log instance
32
- * @returns Runtime instance
33
- */
34
- createRuntime<TContract extends SqlContract<SqlStorage>>(options: {
35
- readonly contract: TContract;
36
- readonly driverOptions: unknown;
37
- readonly verify: RuntimeVerifyOptions;
38
- readonly plugins?: readonly Plugin<TContract, Adapter<SelectAst, SqlContract<SqlStorage>, LoweredStatement>, SqlDriver>[];
39
- readonly mode?: 'strict' | 'permissive';
40
- readonly log?: Log;
41
- }): Runtime;
42
- }
43
- //#endregion
44
- //#region src/core/runtime-descriptor.d.ts
45
- /**
46
- * SQL runtime family descriptor implementation.
47
- * Provides factory method to create SQL runtime family instance.
48
- */
49
- declare class SqlRuntimeFamilyDescriptor implements RuntimeFamilyDescriptor<'sql', SqlRuntimeFamilyInstance> {
50
- readonly kind: "family";
51
- readonly id = "sql";
52
- readonly familyId: "sql";
53
- readonly version = "0.0.1";
54
- create<TTargetId extends string>(options: {
55
- readonly target: RuntimeTargetDescriptor<'sql', TTargetId>;
56
- readonly adapter: RuntimeAdapterDescriptor<'sql', TTargetId, SqlRuntimeAdapterInstance<TTargetId>>;
57
- readonly driver: RuntimeDriverDescriptor<'sql', TTargetId, SqlRuntimeDriverInstance<TTargetId>>;
58
- readonly extensionPacks: readonly RuntimeExtensionDescriptor<'sql', TTargetId>[];
59
- }): SqlRuntimeFamilyInstance;
60
- }
61
- //#endregion
62
- //#region src/exports/runtime.d.ts
63
- /**
64
- * SQL runtime family descriptor for execution/runtime plane.
65
- * Provides factory method to create SQL runtime family instance.
66
- */
67
- declare const _default: SqlRuntimeFamilyDescriptor;
68
- //#endregion
69
- export { _default as default };
70
- //# sourceMappingURL=runtime.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtime.d.mts","names":[],"sources":["../src/core/runtime-instance.ts","../src/core/runtime-descriptor.ts","../src/exports/runtime.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;AA6BA;;AAA0E,KAA9D,wBAA8D,CAAA,kBAAA,MAAA,GAAA,MAAA,CAAA,GAAA,qBAAA,CAAA,KAAA,EAExE,SAFwE,CAAA,GAIxE,SAJwE;;AAa1E;;;AAiBuB,UAjBN,wBAAA,SAAiC,qBAiB3B,CAAA,KAAA,CAAA,CAAA;EAEF;;;;;;;;;;;;;;;kCAHa,YAAY;ICxCjC,SAAA,QAAA,EDyCU,SCxCrB;IAA0C,SAAA,aAAA,EAAA,OAAA;IAQQ,SAAA,MAAA,EDkC/B,oBClC+B;IAA/B,SAAA,OAAA,CAAA,EAAA,SDmCW,MCnCX,CDoCf,SCpCe,EDqCf,OCrCe,CDqCP,SCrCO,EDqCI,WCrCJ,CDqCgB,UCrChB,CAAA,EDqC6B,gBCrC7B,CAAA,EDsCf,SCtCe,CAAA,EAAA;IAGf,SAAA,IAAA,CAAA,EAAA,QAAA,GAAA,YAAA;IAC0B,SAAA,GAAA,CAAA,EDqCb,GCrCa;EAA1B,CAAA,CAAA,EDsCA,OCtCA;;;;;;;;cAbO,0BAAA,YACA,+BAA+B;EDUhC,SAAA,IAAA,EAAA,QAAA;EAEV,SAAA,EAAA,GAAA,KAAA;EAFwE,SAAA,QAAA,EAAA,KAAA;EAIxE,SAAA,OAAA,GAAA,OAAA;EAAS,MAAA,CAAA,kBAAA,MAAA,CAAA,CAAA,OAAA,EAAA;IASM,SAAA,MAAA,ECfI,uBDeqB,CAAA,KAAA,ECfU,SDeV,CAAA;IAgBI,SAAA,OAAA,EC9BxB,wBD8BwB,CAAA,KAAA,EC5BxC,SD4BwC,EC3BxC,yBD2BwC,CC3Bd,SD2Bc,CAAA,CAAA;IAAZ,SAAA,MAAA,ECzBb,uBDyBa,CAAA,KAAA,ECzBkB,SDyBlB,ECzB6B,wBDyB7B,CCzBsD,SDyBtD,CAAA,CAAA;IACX,SAAA,cAAA,EAAA,SCzBe,0BDyBf,CAAA,KAAA,ECzBiD,SDyBjD,CAAA,EAAA;EAEF,CAAA,CAAA,EC1Bf,wBD0Be;;;;;;;;cE7DmD,UAAA"}
package/dist/runtime.mjs DELETED
@@ -1,74 +0,0 @@
1
- import { createRuntime, createRuntimeContext } from "@prisma-next/sql-runtime";
2
- import { assertRuntimeContractRequirementsSatisfied } from "@prisma-next/core-execution-plane/framework-components";
3
-
4
- //#region src/core/runtime-instance.ts
5
- /**
6
- * Creates a SQL runtime family instance from runtime descriptors.
7
- *
8
- * Routes the same framework composition as control-plane:
9
- * family, target, adapter, driver, extensionPacks (all as descriptors with IDs).
10
- */
11
- function createSqlRuntimeFamilyInstance(options) {
12
- const { family: familyDescriptor, target: targetDescriptor, adapter: adapterDescriptor, driver: driverDescriptor, extensionPacks: extensionDescriptors = [] } = options;
13
- return {
14
- familyId: "sql",
15
- createRuntime(runtimeOptions) {
16
- assertRuntimeContractRequirementsSatisfied({
17
- contract: runtimeOptions.contract,
18
- family: familyDescriptor,
19
- target: targetDescriptor,
20
- adapter: adapterDescriptor,
21
- extensionPacks: extensionDescriptors
22
- });
23
- const driverInstance = driverDescriptor.create(runtimeOptions.driverOptions);
24
- const context = createRuntimeContext({
25
- contract: runtimeOptions.contract,
26
- target: targetDescriptor,
27
- adapter: adapterDescriptor,
28
- extensionPacks: extensionDescriptors
29
- });
30
- return createRuntime({
31
- driver: driverInstance,
32
- verify: runtimeOptions.verify,
33
- context,
34
- ...runtimeOptions.plugins ? { plugins: runtimeOptions.plugins } : {},
35
- ...runtimeOptions.mode ? { mode: runtimeOptions.mode } : {},
36
- ...runtimeOptions.log ? { log: runtimeOptions.log } : {}
37
- });
38
- }
39
- };
40
- }
41
-
42
- //#endregion
43
- //#region src/core/runtime-descriptor.ts
44
- /**
45
- * SQL runtime family descriptor implementation.
46
- * Provides factory method to create SQL runtime family instance.
47
- */
48
- var SqlRuntimeFamilyDescriptor = class {
49
- kind = "family";
50
- id = "sql";
51
- familyId = "sql";
52
- version = "0.0.1";
53
- create(options) {
54
- return createSqlRuntimeFamilyInstance({
55
- family: this,
56
- target: options.target,
57
- adapter: options.adapter,
58
- driver: options.driver,
59
- extensionPacks: options.extensionPacks
60
- });
61
- }
62
- };
63
-
64
- //#endregion
65
- //#region src/exports/runtime.ts
66
- /**
67
- * SQL runtime family descriptor for execution/runtime plane.
68
- * Provides factory method to create SQL runtime family instance.
69
- */
70
- var runtime_default = new SqlRuntimeFamilyDescriptor();
71
-
72
- //#endregion
73
- export { runtime_default as default };
74
- //# sourceMappingURL=runtime.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtime.mjs","names":[],"sources":["../src/core/runtime-instance.ts","../src/core/runtime-descriptor.ts","../src/exports/runtime.ts"],"sourcesContent":["import { assertRuntimeContractRequirementsSatisfied } from '@prisma-next/core-execution-plane/framework-components';\nimport type {\n RuntimeAdapterDescriptor,\n RuntimeDriverDescriptor,\n RuntimeDriverInstance,\n RuntimeFamilyDescriptor,\n RuntimeFamilyInstance,\n RuntimeTargetDescriptor,\n} from '@prisma-next/core-execution-plane/types';\nimport type { Log, Plugin, RuntimeVerifyOptions } from '@prisma-next/runtime-executor';\nimport type { SqlContract, SqlStorage } from '@prisma-next/sql-contract/types';\nimport type {\n Adapter,\n LoweredStatement,\n SelectAst,\n SqlDriver,\n} from '@prisma-next/sql-relational-core/ast';\nimport type {\n Runtime,\n RuntimeOptions,\n SqlRuntimeAdapterInstance,\n SqlRuntimeExtensionDescriptor,\n} from '@prisma-next/sql-runtime';\nimport { createRuntime, createRuntimeContext } from '@prisma-next/sql-runtime';\n\n/**\n * SQL runtime driver instance type.\n * Combines identity properties with SQL-specific behavior methods.\n */\nexport type SqlRuntimeDriverInstance<TTargetId extends string = string> = RuntimeDriverInstance<\n 'sql',\n TTargetId\n> &\n SqlDriver;\n\n// Re-export SqlRuntimeAdapterInstance from sql-runtime for consumers\nexport type { SqlRuntimeAdapterInstance } from '@prisma-next/sql-runtime';\n\n/**\n * SQL runtime family instance interface.\n * Extends base RuntimeFamilyInstance with SQL-specific runtime creation method.\n */\nexport interface SqlRuntimeFamilyInstance extends RuntimeFamilyInstance<'sql'> {\n /**\n * Creates a SQL runtime from contract, driver options, and verification settings.\n *\n * Extension packs are routed through composition (at instance creation time),\n * not through this method. This aligns with control-plane composition patterns.\n *\n * @param options - Runtime creation options\n * @param options.contract - SQL contract\n * @param options.driverOptions - Driver options (e.g., PostgresDriverOptions)\n * @param options.verify - Runtime verification options\n * @param options.plugins - Optional plugins\n * @param options.mode - Optional runtime mode\n * @param options.log - Optional log instance\n * @returns Runtime instance\n */\n createRuntime<TContract extends SqlContract<SqlStorage>>(options: {\n readonly contract: TContract;\n readonly driverOptions: unknown;\n readonly verify: RuntimeVerifyOptions;\n readonly plugins?: readonly Plugin<\n TContract,\n Adapter<SelectAst, SqlContract<SqlStorage>, LoweredStatement>,\n SqlDriver\n >[];\n readonly mode?: 'strict' | 'permissive';\n readonly log?: Log;\n }): Runtime;\n}\n\n/**\n * Creates a SQL runtime family instance from runtime descriptors.\n *\n * Routes the same framework composition as control-plane:\n * family, target, adapter, driver, extensionPacks (all as descriptors with IDs).\n */\nexport function createSqlRuntimeFamilyInstance<TTargetId extends string>(options: {\n readonly family: RuntimeFamilyDescriptor<'sql'>;\n readonly target: RuntimeTargetDescriptor<'sql', TTargetId>;\n readonly adapter: RuntimeAdapterDescriptor<\n 'sql',\n TTargetId,\n SqlRuntimeAdapterInstance<TTargetId>\n >;\n readonly driver: RuntimeDriverDescriptor<'sql', TTargetId, SqlRuntimeDriverInstance<TTargetId>>;\n readonly extensionPacks?: readonly SqlRuntimeExtensionDescriptor<TTargetId>[];\n}): SqlRuntimeFamilyInstance {\n const {\n family: familyDescriptor,\n target: targetDescriptor,\n adapter: adapterDescriptor,\n driver: driverDescriptor,\n extensionPacks: extensionDescriptors = [],\n } = options;\n\n return {\n familyId: 'sql' as const,\n createRuntime<TContract extends SqlContract<SqlStorage>>(runtimeOptions: {\n readonly contract: TContract;\n readonly driverOptions: unknown;\n readonly verify: RuntimeVerifyOptions;\n readonly plugins?: readonly Plugin<\n TContract,\n Adapter<SelectAst, SqlContract<SqlStorage>, LoweredStatement>,\n SqlDriver\n >[];\n readonly mode?: 'strict' | 'permissive';\n readonly log?: Log;\n }): Runtime {\n // Validate contract requirements against provided descriptors\n assertRuntimeContractRequirementsSatisfied({\n contract: runtimeOptions.contract,\n family: familyDescriptor,\n target: targetDescriptor,\n adapter: adapterDescriptor,\n extensionPacks: extensionDescriptors,\n });\n\n // Create driver instance\n const driverInstance = driverDescriptor.create(runtimeOptions.driverOptions);\n\n // Create context via descriptor-first API\n const context = createRuntimeContext<TContract, TTargetId>({\n contract: runtimeOptions.contract,\n target: targetDescriptor,\n adapter: adapterDescriptor,\n extensionPacks: extensionDescriptors,\n });\n\n const runtimeOptions_: RuntimeOptions<TContract> = {\n driver: driverInstance,\n verify: runtimeOptions.verify,\n context,\n ...(runtimeOptions.plugins ? { plugins: runtimeOptions.plugins } : {}),\n ...(runtimeOptions.mode ? { mode: runtimeOptions.mode } : {}),\n ...(runtimeOptions.log ? { log: runtimeOptions.log } : {}),\n };\n\n return createRuntime(runtimeOptions_);\n },\n };\n}\n","import type {\n RuntimeAdapterDescriptor,\n RuntimeDriverDescriptor,\n RuntimeExtensionDescriptor,\n RuntimeFamilyDescriptor,\n RuntimeTargetDescriptor,\n} from '@prisma-next/core-execution-plane/types';\nimport {\n createSqlRuntimeFamilyInstance,\n type SqlRuntimeAdapterInstance,\n type SqlRuntimeDriverInstance,\n type SqlRuntimeFamilyInstance,\n} from './runtime-instance';\n\n/**\n * SQL runtime family descriptor implementation.\n * Provides factory method to create SQL runtime family instance.\n */\nexport class SqlRuntimeFamilyDescriptor\n implements RuntimeFamilyDescriptor<'sql', SqlRuntimeFamilyInstance>\n{\n readonly kind = 'family' as const;\n readonly id = 'sql';\n readonly familyId = 'sql' as const;\n readonly version = '0.0.1';\n\n create<TTargetId extends string>(options: {\n readonly target: RuntimeTargetDescriptor<'sql', TTargetId>;\n readonly adapter: RuntimeAdapterDescriptor<\n 'sql',\n TTargetId,\n SqlRuntimeAdapterInstance<TTargetId>\n >;\n readonly driver: RuntimeDriverDescriptor<'sql', TTargetId, SqlRuntimeDriverInstance<TTargetId>>;\n readonly extensionPacks: readonly RuntimeExtensionDescriptor<'sql', TTargetId>[];\n }): SqlRuntimeFamilyInstance {\n return createSqlRuntimeFamilyInstance({\n family: this,\n target: options.target,\n adapter: options.adapter,\n driver: options.driver,\n extensionPacks: options.extensionPacks,\n });\n }\n}\n","import { SqlRuntimeFamilyDescriptor } from '../core/runtime-descriptor';\n\n/**\n * SQL runtime family descriptor for execution/runtime plane.\n * Provides factory method to create SQL runtime family instance.\n */\nexport default new SqlRuntimeFamilyDescriptor();\n"],"mappings":";;;;;;;;;;AA8EA,SAAgB,+BAAyD,SAU5C;CAC3B,MAAM,EACJ,QAAQ,kBACR,QAAQ,kBACR,SAAS,mBACT,QAAQ,kBACR,gBAAgB,uBAAuB,EAAE,KACvC;AAEJ,QAAO;EACL,UAAU;EACV,cAAyD,gBAW7C;AAEV,8CAA2C;IACzC,UAAU,eAAe;IACzB,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,gBAAgB;IACjB,CAAC;GAGF,MAAM,iBAAiB,iBAAiB,OAAO,eAAe,cAAc;GAG5E,MAAM,UAAU,qBAA2C;IACzD,UAAU,eAAe;IACzB,QAAQ;IACR,SAAS;IACT,gBAAgB;IACjB,CAAC;AAWF,UAAO,cAT4C;IACjD,QAAQ;IACR,QAAQ,eAAe;IACvB;IACA,GAAI,eAAe,UAAU,EAAE,SAAS,eAAe,SAAS,GAAG,EAAE;IACrE,GAAI,eAAe,OAAO,EAAE,MAAM,eAAe,MAAM,GAAG,EAAE;IAC5D,GAAI,eAAe,MAAM,EAAE,KAAK,eAAe,KAAK,GAAG,EAAE;IAC1D,CAEoC;;EAExC;;;;;;;;;AC5HH,IAAa,6BAAb,MAEA;CACE,AAAS,OAAO;CAChB,AAAS,KAAK;CACd,AAAS,WAAW;CACpB,AAAS,UAAU;CAEnB,OAAiC,SASJ;AAC3B,SAAO,+BAA+B;GACpC,QAAQ;GACR,QAAQ,QAAQ;GAChB,SAAS,QAAQ;GACjB,QAAQ,QAAQ;GAChB,gBAAgB,QAAQ;GACzB,CAAC;;;;;;;;;;ACpCN,sBAAe,IAAI,4BAA4B"}
@@ -1,85 +0,0 @@
1
- import "./instance-wm4TrZN0.mjs";
2
- import { r as ComponentDatabaseDependency } from "./types-D5CPT9N4.mjs";
3
- import { OperationContext, SchemaIssue, SchemaVerificationNode, VerifyDatabaseSchemaResult } from "@prisma-next/core-control-plane/types";
4
- import { SqlIndexIR, SqlSchemaIR, SqlUniqueIR } from "@prisma-next/sql-schema-ir/types";
5
- import { SqlContract, SqlStorage } from "@prisma-next/sql-contract/types";
6
- import { TargetBoundComponentDescriptor } from "@prisma-next/contract/framework-components";
7
-
8
- //#region src/core/schema-verify/verify-helpers.d.ts
9
-
10
- /**
11
- * Compares two arrays of strings for equality (order-sensitive).
12
- */
13
- declare function arraysEqual(a: readonly string[], b: readonly string[]): boolean;
14
- /**
15
- * Checks if a unique constraint requirement is satisfied by the given columns.
16
- *
17
- * Semantic satisfaction: a unique constraint requirement can be satisfied by:
18
- * - A unique constraint with the same columns, OR
19
- * - A unique index with the same columns
20
- *
21
- * @param uniques - The unique constraints in the schema table
22
- * @param indexes - The indexes in the schema table
23
- * @param columns - The columns required by the unique constraint
24
- * @returns true if the requirement is satisfied
25
- */
26
- declare function isUniqueConstraintSatisfied(uniques: readonly SqlUniqueIR[], indexes: readonly SqlIndexIR[], columns: readonly string[]): boolean;
27
- /**
28
- * Checks if an index requirement is satisfied by the given columns.
29
- *
30
- * Semantic satisfaction: a non-unique index requirement can be satisfied by:
31
- * - Any index (unique or non-unique) with the same columns, OR
32
- * - A unique constraint with the same columns (stronger satisfies weaker)
33
- *
34
- * @param indexes - The indexes in the schema table
35
- * @param uniques - The unique constraints in the schema table
36
- * @param columns - The columns required by the index
37
- * @returns true if the requirement is satisfied
38
- */
39
- declare function isIndexSatisfied(indexes: readonly SqlIndexIR[], uniques: readonly SqlUniqueIR[], columns: readonly string[]): boolean;
40
- /**
41
- * Verifies database dependencies are installed using component-owned verification hooks.
42
- * Each dependency provides a pure verifyDatabaseDependencyInstalled function that checks
43
- * whether the dependency is satisfied based on the in-memory schema IR (no DB I/O).
44
- *
45
- * Returns verification nodes for the tree.
46
- */
47
- declare function verifyDatabaseDependencies(dependencies: ReadonlyArray<ComponentDatabaseDependency<unknown>>, schema: SqlSchemaIR, issues: SchemaIssue[]): SchemaVerificationNode[];
48
- //#endregion
49
- //#region src/core/schema-verify/verify-sql-schema.d.ts
50
- /**
51
- * Options for the pure schema verification function.
52
- */
53
- interface VerifySqlSchemaOptions {
54
- /** The validated SQL contract to verify against */
55
- readonly contract: SqlContract<SqlStorage>;
56
- /** The schema IR from introspection (or another source) */
57
- readonly schema: SqlSchemaIR;
58
- /** Whether to run in strict mode (detects extra tables/columns) */
59
- readonly strict: boolean;
60
- /** Optional operation context for metadata */
61
- readonly context?: OperationContext;
62
- /** Type metadata registry for codec consistency warnings */
63
- readonly typeMetadataRegistry: ReadonlyMap<string, {
64
- nativeType?: string;
65
- }>;
66
- /**
67
- * Active framework components participating in this composition.
68
- * All components must have matching familyId ('sql') and targetId.
69
- */
70
- readonly frameworkComponents: ReadonlyArray<TargetBoundComponentDescriptor<'sql', string>>;
71
- }
72
- /**
73
- * Verifies that a SqlSchemaIR matches a SqlContract.
74
- *
75
- * This is a pure function that does NOT perform any database I/O.
76
- * It takes an already-introspected schema IR and compares it against
77
- * the contract requirements.
78
- *
79
- * @param options - Verification options
80
- * @returns VerifyDatabaseSchemaResult with verification tree and issues
81
- */
82
- declare function verifySqlSchema(options: VerifySqlSchemaOptions): VerifyDatabaseSchemaResult;
83
- //#endregion
84
- export { type VerifySqlSchemaOptions, arraysEqual, isIndexSatisfied, isUniqueConstraintSatisfied, verifyDatabaseDependencies, verifySqlSchema };
85
- //# sourceMappingURL=schema-verify.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"schema-verify.d.mts","names":[],"sources":["../src/core/schema-verify/verify-helpers.ts","../src/core/schema-verify/verify-sql-schema.ts"],"sourcesContent":[],"mappings":";;;;;;;;;AAuBA;AA+BA;AA0BA;AAgXgB,iBAzaA,WAAA,CAya0B,CAAA,EAAA,SAAA,MAAA,EAAA,EAAA,CAAA,EAAA,SAAA,MAAA,EAAA,CAAA,EAAA,OAAA;;;;;;;;;;ACja1C;;;AAImB,iBDmBH,2BAAA,CCnBG,OAAA,EAAA,SDoBC,WCpBD,EAAA,EAAA,OAAA,EAAA,SDqBC,UCrBD,EAAA,EAAA,OAAA,EAAA,SAAA,MAAA,EAAA,CAAA,EAAA,OAAA;;;;;;AAwBnB;;;;;;;iBDqBgB,gBAAA,mBACI,gCACA;;;;;;;;iBA8WJ,0BAAA,eACA,cAAc,+CACpB,qBACA,gBACP;;;AAJH;;;AAEU,UCnaO,sBAAA,CDmaP;EACA;EACP,SAAA,QAAA,ECnakB,WDmalB,CCna8B,UDma9B,CAAA;EAAsB;mBCjaN;;;EAJF;EAEgB,SAAA,OAAA,CAAA,EAMZ,gBANY;EAAZ;EAEF,SAAA,oBAAA,EAMc,WANd,CAAA,MAAA,EAAA;IAIE,UAAA,CAAA,EAAA,MAAA;EAEY,CAAA,CAAA;EAKa;;;AAa9C;gCAbgC,cAAc;;;;;;;;;;;;iBAa9B,eAAA,UAAyB,yBAAyB"}
@@ -1,3 +0,0 @@
1
- import { a as verifyDatabaseDependencies, i as isUniqueConstraintSatisfied, n as arraysEqual, r as isIndexSatisfied, t as verifySqlSchema } from "./verify-sql-schema-BnLVoeWI.mjs";
2
-
3
- export { arraysEqual, isIndexSatisfied, isUniqueConstraintSatisfied, verifyDatabaseDependencies, verifySqlSchema };
@@ -1,31 +0,0 @@
1
- import { r as convertOperationManifest } from "./instance-wm4TrZN0.mjs";
2
- import { OperationRegistry, OperationSignature } from "@prisma-next/operations";
3
- import { ControlAdapterDescriptor, ControlExtensionDescriptor, ControlTargetDescriptor } from "@prisma-next/core-control-plane/types";
4
- import { TypesImportSpec } from "@prisma-next/contract/types";
5
- import { OperationManifest } from "@prisma-next/contract/pack-manifest-types";
6
-
7
- //#region src/core/assembly.d.ts
8
-
9
- /**
10
- * Assembles an operation registry from descriptors (adapter, target, extensions).
11
- * Loops over descriptors, extracts operations, converts them using the provided
12
- * conversion function, and registers them in a new registry.
13
- */
14
- declare function assembleOperationRegistry(descriptors: ReadonlyArray<ControlTargetDescriptor<'sql', string> | ControlAdapterDescriptor<'sql', string> | ControlExtensionDescriptor<'sql', string>>, convertOperationManifest: (manifest: OperationManifest) => OperationSignature): OperationRegistry;
15
- /**
16
- * Extracts codec type imports from descriptors for contract.d.ts generation.
17
- */
18
- declare function extractCodecTypeImports(descriptors: ReadonlyArray<ControlTargetDescriptor<'sql', string> | ControlAdapterDescriptor<'sql', string> | ControlExtensionDescriptor<'sql', string>>): ReadonlyArray<TypesImportSpec>;
19
- /**
20
- * Extracts operation type imports from descriptors for contract.d.ts generation.
21
- */
22
- declare function extractOperationTypeImports(descriptors: ReadonlyArray<ControlTargetDescriptor<'sql', string> | ControlAdapterDescriptor<'sql', string> | ControlExtensionDescriptor<'sql', string>>): ReadonlyArray<TypesImportSpec>;
23
- /**
24
- * Extracts extension IDs from descriptors in deterministic order:
25
- * [adapter.id, target.id, ...extensions.map(e => e.id)]
26
- * Deduplicates while preserving stable order.
27
- */
28
- declare function extractExtensionIds(adapter: ControlAdapterDescriptor<'sql', string>, target: ControlTargetDescriptor<'sql', string>, extensions: ReadonlyArray<ControlExtensionDescriptor<'sql', string>>): ReadonlyArray<string>;
29
- //#endregion
30
- export { assembleOperationRegistry, convertOperationManifest, extractCodecTypeImports, extractExtensionIds, extractOperationTypeImports };
31
- //# sourceMappingURL=test-utils.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"test-utils.d.mts","names":[],"sources":["../src/core/assembly.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;AAeA;;AAGM,iBAHU,yBAAA,CAGV,WAAA,EAFS,aAET,CADA,uBACA,CAAA,KAAA,EAAA,MAAA,CAAA,GAAA,wBAAA,CAAA,KAAA,EAAA,MAAA,CAAA,GACA,0BADA,CAAA,KAAA,EAAA,MAAA,CAAA,CAAA,EAAA,wBAAA,EAAA,CAAA,QAAA,EAGiC,iBAHjC,EAAA,GAGuD,kBAHvD,CAAA,EAIH,iBAJG;;;;AAGuD,iBAkB7C,uBAAA,CAlB6C,WAAA,EAmB9C,aAnB8C,CAoBvD,uBApBuD,CAAA,KAAA,EAAA,MAAA,CAAA,GAqBvD,wBArBuD,CAAA,KAAA,EAAA,MAAA,CAAA,GAsBvD,0BAtBuD,CAAA,KAAA,EAAA,MAAA,CAAA,CAAA,CAAA,EAwB1D,aAxB0D,CAwB5C,eAxB4C,CAAA;;;AAkB7D;AAEM,iBAqBU,2BAAA,CArBV,WAAA,EAsBS,aAtBT,CAuBA,uBAvBA,CAAA,KAAA,EAAA,MAAA,CAAA,GAwBA,wBAxBA,CAAA,KAAA,EAAA,MAAA,CAAA,GAyBA,0BAzBA,CAAA,KAAA,EAAA,MAAA,CAAA,CAAA,CAAA,EA2BH,aA3BG,CA2BW,eA3BX,CAAA;;;;;;AAIU,iBA0CA,mBAAA,CA1CA,OAAA,EA2CL,wBA3CK,CAAA,KAAA,EAAA,MAAA,CAAA,EAAA,MAAA,EA4CN,uBA5CM,CAAA,KAAA,EAAA,MAAA,CAAA,EAAA,UAAA,EA6CF,aA7CE,CA6CY,0BA7CZ,CAAA,KAAA,EAAA,MAAA,CAAA,CAAA,CAAA,EA8Cb,aA9Ca,CAAA,MAAA,CAAA"}
@@ -1,5 +0,0 @@
1
- import { a as extractExtensionIds, i as extractCodecTypeImports, o as extractOperationTypeImports, r as assembleOperationRegistry, t as convertOperationManifest } from "./instance-B_PdDN4y.mjs";
2
- import "./verify-sql-schema-BnLVoeWI.mjs";
3
- import "./verify-DhFytkFC.mjs";
4
-
5
- export { assembleOperationRegistry, convertOperationManifest, extractCodecTypeImports, extractExtensionIds, extractOperationTypeImports };