@prisma-next/family-sql 0.3.0-dev.2 → 0.3.0-dev.21

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 (69) hide show
  1. package/dist/{exports/chunk-6P44BVZ4.js → chunk-F27CR6XZ.js} +12 -3
  2. package/dist/chunk-F27CR6XZ.js.map +1 -0
  3. package/dist/{exports/chunk-C3GKWCKA.js → chunk-SU7LN2UH.js} +1 -1
  4. package/dist/chunk-SU7LN2UH.js.map +1 -0
  5. package/dist/{exports/chunk-F252JMEU.js → chunk-XH2Y5NTD.js} +59 -116
  6. package/dist/chunk-XH2Y5NTD.js.map +1 -0
  7. package/dist/core/assembly.d.ts +25 -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 +24 -0
  12. package/dist/core/descriptor.d.ts.map +1 -0
  13. package/dist/{exports/instance-DiZi2k_2.d.ts → core/instance.d.ts} +28 -15
  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/{exports/types-Bh7ftf0Q.d.ts → core/migrations/types.d.ts} +41 -36
  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 -44
  32. package/dist/exports/control-adapter.d.ts.map +1 -0
  33. package/dist/exports/control.d.ts +8 -160
  34. package/dist/exports/control.d.ts.map +1 -0
  35. package/dist/exports/control.js +7 -7
  36. package/dist/exports/control.js.map +1 -1
  37. package/dist/exports/runtime.d.ts +3 -61
  38. package/dist/exports/runtime.d.ts.map +1 -0
  39. package/dist/exports/schema-verify.d.ts +8 -72
  40. package/dist/exports/schema-verify.d.ts.map +1 -0
  41. package/dist/exports/schema-verify.js +5 -1
  42. package/dist/exports/test-utils.d.ts +5 -31
  43. package/dist/exports/test-utils.d.ts.map +1 -0
  44. package/dist/exports/test-utils.js +3 -3
  45. package/dist/exports/verify.d.ts +2 -28
  46. package/dist/exports/verify.d.ts.map +1 -0
  47. package/dist/exports/verify.js +1 -1
  48. package/package.json +24 -25
  49. package/src/core/assembly.ts +117 -0
  50. package/src/core/control-adapter.ts +52 -0
  51. package/src/core/descriptor.ts +33 -0
  52. package/src/core/instance.ts +903 -0
  53. package/src/core/migrations/plan-helpers.ts +164 -0
  54. package/src/core/migrations/policies.ts +8 -0
  55. package/src/core/migrations/types.ts +380 -0
  56. package/src/core/runtime-descriptor.ts +45 -0
  57. package/src/core/runtime-instance.ts +144 -0
  58. package/src/core/schema-verify/verify-helpers.ts +532 -0
  59. package/src/core/schema-verify/verify-sql-schema.ts +588 -0
  60. package/src/core/verify.ts +177 -0
  61. package/src/exports/control-adapter.ts +1 -0
  62. package/src/exports/control.ts +56 -0
  63. package/src/exports/runtime.ts +7 -0
  64. package/src/exports/schema-verify.ts +16 -0
  65. package/src/exports/test-utils.ts +11 -0
  66. package/src/exports/verify.ts +1 -0
  67. package/dist/exports/chunk-6P44BVZ4.js.map +0 -1
  68. package/dist/exports/chunk-C3GKWCKA.js.map +0 -1
  69. package/dist/exports/chunk-F252JMEU.js.map +0 -1
@@ -0,0 +1,42 @@
1
+ import type { ControlAdapterInstance, ControlDriverInstance } from '@prisma-next/core-control-plane/types';
2
+ import type { SqlSchemaIR } from '@prisma-next/sql-schema-ir/types';
3
+ /**
4
+ * SQL control adapter interface for control-plane operations.
5
+ * Implemented by target-specific adapters (e.g., Postgres, MySQL).
6
+ *
7
+ * @template TTarget - The target ID (e.g., 'postgres', 'mysql')
8
+ */
9
+ export interface SqlControlAdapter<TTarget extends string = string> extends ControlAdapterInstance<'sql', TTarget> {
10
+ /**
11
+ * The target ID this adapter implements.
12
+ * Used for type tracking and runtime validation.
13
+ * @deprecated Use targetId from ControlAdapterInstance instead
14
+ */
15
+ readonly target: TTarget;
16
+ /**
17
+ * Introspects a database schema and returns a raw SqlSchemaIR.
18
+ *
19
+ * This is a pure schema discovery operation that queries the database catalog
20
+ * and returns the schema structure without type mapping or contract enrichment.
21
+ * Type mapping and enrichment are handled separately by enrichment helpers.
22
+ *
23
+ * @param driver - ControlDriverInstance instance for executing queries (target-specific)
24
+ * @param contractIR - Optional contract IR for contract-guided introspection (filtering, optimization)
25
+ * @param schema - Schema name to introspect (defaults to 'public')
26
+ * @returns Promise resolving to SqlSchemaIR representing the live database schema
27
+ */
28
+ introspect(driver: ControlDriverInstance<'sql', TTarget>, contractIR?: unknown, schema?: string): Promise<SqlSchemaIR>;
29
+ }
30
+ /**
31
+ * SQL control adapter descriptor interface.
32
+ * Provides a factory method to create control adapter instances.
33
+ *
34
+ * @template TTarget - The target ID (e.g., 'postgres', 'mysql')
35
+ */
36
+ export interface SqlControlAdapterDescriptor<TTarget extends string = string> {
37
+ /**
38
+ * Creates a SQL control adapter instance for control-plane operations.
39
+ */
40
+ create(): SqlControlAdapter<TTarget>;
41
+ }
42
+ //# sourceMappingURL=control-adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"control-adapter.d.ts","sourceRoot":"","sources":["../../src/core/control-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,sBAAsB,EACtB,qBAAqB,EACtB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAEpE;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM,CAChE,SAAQ,sBAAsB,CAAC,KAAK,EAAE,OAAO,CAAC;IAC9C;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IAEzB;;;;;;;;;;;OAWG;IACH,UAAU,CACR,MAAM,EAAE,qBAAqB,CAAC,KAAK,EAAE,OAAO,CAAC,EAC7C,UAAU,CAAC,EAAE,OAAO,EACpB,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,WAAW,CAAC,CAAC;CACzB;AAED;;;;;GAKG;AACH,MAAM,WAAW,2BAA2B,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM;IAC1E;;OAEG;IACH,MAAM,IAAI,iBAAiB,CAAC,OAAO,CAAC,CAAC;CACtC"}
@@ -0,0 +1,24 @@
1
+ import type { ControlFamilyDescriptor, ControlPlaneStack } from '@prisma-next/core-control-plane/types';
2
+ import { type SqlControlFamilyInstance } from './instance';
3
+ /**
4
+ * SQL family descriptor implementation.
5
+ * Provides the SQL family hook and factory method.
6
+ */
7
+ export declare class SqlFamilyDescriptor implements ControlFamilyDescriptor<'sql', SqlControlFamilyInstance> {
8
+ readonly kind: "family";
9
+ readonly id = "sql";
10
+ readonly familyId: "sql";
11
+ readonly version = "0.0.1";
12
+ readonly hook: {
13
+ readonly id: "sql";
14
+ readonly validateTypes: (ir: import("@prisma-next/contract/ir").ContractIR, _ctx: import("@prisma-next/contract/types").ValidationContext) => void;
15
+ readonly validateStructure: (ir: import("@prisma-next/contract/ir").ContractIR) => void;
16
+ readonly generateContractTypes: (ir: import("@prisma-next/contract/ir").ContractIR, codecTypeImports: ReadonlyArray<import("@prisma-next/contract/types").TypesImportSpec>, operationTypeImports: ReadonlyArray<import("@prisma-next/contract/types").TypesImportSpec>) => string;
17
+ readonly generateStorageType: (storage: import("@prisma-next/sql-contract/types").SqlStorage) => string;
18
+ readonly generateModelsType: (models: Record<string, import("@prisma-next/sql-contract/types").ModelDefinition> | undefined, storage: import("@prisma-next/sql-contract/types").SqlStorage) => string;
19
+ readonly generateRelationsType: (relations: Record<string, unknown> | undefined) => string;
20
+ readonly generateMappingsType: (models: Record<string, import("@prisma-next/sql-contract/types").ModelDefinition> | undefined, storage: import("@prisma-next/sql-contract/types").SqlStorage, codecTypes: string, operationTypes: string) => string;
21
+ };
22
+ create<TTargetId extends string>(stack: ControlPlaneStack<'sql', TTargetId>): SqlControlFamilyInstance;
23
+ }
24
+ //# sourceMappingURL=descriptor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"descriptor.d.ts","sourceRoot":"","sources":["../../src/core/descriptor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,iBAAiB,EAClB,MAAM,uCAAuC,CAAC;AAE/C,OAAO,EAA2B,KAAK,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAEpF;;;GAGG;AACH,qBAAa,mBACX,YAAW,uBAAuB,CAAC,KAAK,EAAE,wBAAwB,CAAC;IAEnE,QAAQ,CAAC,IAAI,EAAG,QAAQ,CAAU;IAClC,QAAQ,CAAC,EAAE,SAAS;IACpB,QAAQ,CAAC,QAAQ,EAAG,KAAK,CAAU;IACnC,QAAQ,CAAC,OAAO,WAAW;IAC3B,QAAQ,CAAC,IAAI;;;;;;;;;MAAuB;IAEpC,MAAM,CAAC,SAAS,SAAS,MAAM,EAC7B,KAAK,EAAE,iBAAiB,CAAC,KAAK,EAAE,SAAS,CAAC,GACzC,wBAAwB;CAU5B"}
@@ -1,18 +1,17 @@
1
- import { TargetBoundComponentDescriptor } from '@prisma-next/contract/framework-components';
2
- import { ContractIR } from '@prisma-next/contract/ir';
3
- import { OperationManifest } from '@prisma-next/contract/pack-manifest-types';
4
- import { TypesImportSpec } from '@prisma-next/contract/types';
5
- import { CoreSchemaView } from '@prisma-next/core-control-plane/schema-view';
6
- import { ControlFamilyInstance, ControlDriverInstance, VerifyDatabaseResult, OperationContext, VerifyDatabaseSchemaResult, SignDatabaseResult, EmitContractResult } from '@prisma-next/core-control-plane/types';
7
- import { OperationRegistry } from '@prisma-next/operations';
8
- import { SqlOperationSignature } from '@prisma-next/sql-operations';
9
- import { SqlSchemaIR } from '@prisma-next/sql-schema-ir/types';
10
-
1
+ import type { TargetBoundComponentDescriptor } from '@prisma-next/contract/framework-components';
2
+ import type { ContractIR } from '@prisma-next/contract/ir';
3
+ import type { OperationManifest } from '@prisma-next/contract/pack-manifest-types';
4
+ import type { TypesImportSpec } from '@prisma-next/contract/types';
5
+ import type { CoreSchemaView } from '@prisma-next/core-control-plane/schema-view';
6
+ import type { ControlAdapterDescriptor, ControlDriverInstance, ControlExtensionDescriptor, ControlFamilyInstance, ControlTargetDescriptor, EmitContractResult, OperationContext, SignDatabaseResult, VerifyDatabaseResult, VerifyDatabaseSchemaResult } from '@prisma-next/core-control-plane/types';
7
+ import type { OperationRegistry } from '@prisma-next/operations';
8
+ import type { SqlOperationSignature } from '@prisma-next/sql-operations';
9
+ import type { SqlSchemaIR } from '@prisma-next/sql-schema-ir/types';
11
10
  /**
12
11
  * Converts an OperationManifest (descriptor declarative data) to a SqlOperationSignature.
13
12
  * This is SQL-family-specific conversion logic used by instance creation and test utilities.
14
13
  */
15
- declare function convertOperationManifest(manifest: OperationManifest): SqlOperationSignature;
14
+ export declare function convertOperationManifest(manifest: OperationManifest): SqlOperationSignature;
16
15
  /**
17
16
  * Type metadata for SQL storage types.
18
17
  * Maps contract storage type IDs to native database types.
@@ -41,7 +40,7 @@ interface SqlFamilyInstanceState {
41
40
  /**
42
41
  * Options for schema verification.
43
42
  */
44
- interface SchemaVerifyOptions {
43
+ export interface SchemaVerifyOptions {
45
44
  readonly driver: ControlDriverInstance<'sql', string>;
46
45
  readonly contractIR: unknown;
47
46
  readonly strict: boolean;
@@ -56,7 +55,7 @@ interface SchemaVerifyOptions {
56
55
  * SQL control family instance interface.
57
56
  * Extends ControlFamilyInstance with SQL-specific domain actions.
58
57
  */
59
- interface SqlControlFamilyInstance extends ControlFamilyInstance<'sql'>, SqlFamilyInstanceState {
58
+ export interface SqlControlFamilyInstance extends ControlFamilyInstance<'sql'>, SqlFamilyInstanceState {
60
59
  /**
61
60
  * Validates a contract JSON and returns a validated ContractIR (without mappings).
62
61
  * Mappings are runtime-only and should not be part of ContractIR.
@@ -123,5 +122,19 @@ interface SqlControlFamilyInstance extends ControlFamilyInstance<'sql'>, SqlFami
123
122
  readonly contractIR: ContractIR | unknown;
124
123
  }): Promise<EmitContractResult>;
125
124
  }
126
-
127
- export { type SqlControlFamilyInstance as S, type SchemaVerifyOptions as a, convertOperationManifest as c };
125
+ /**
126
+ * SQL family instance type.
127
+ * Maintains backward compatibility with FamilyInstance while implementing SqlControlFamilyInstance.
128
+ */
129
+ export type SqlFamilyInstance = SqlControlFamilyInstance;
130
+ interface CreateSqlFamilyInstanceOptions<TTargetId extends string> {
131
+ readonly target: ControlTargetDescriptor<'sql', TTargetId>;
132
+ readonly adapter: ControlAdapterDescriptor<'sql', TTargetId>;
133
+ readonly extensionPacks: readonly ControlExtensionDescriptor<'sql', TTargetId>[];
134
+ }
135
+ /**
136
+ * Creates a SQL family instance for control-plane operations.
137
+ */
138
+ export declare function createSqlFamilyInstance<TTargetId extends string>(options: CreateSqlFamilyInstanceOptions<TTargetId>): SqlFamilyInstance;
139
+ export {};
140
+ //# sourceMappingURL=instance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instance.d.ts","sourceRoot":"","sources":["../../src/core/instance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,4CAA4C,CAAC;AACjG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2CAA2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BAAkB,CAAC,CAAC;IAEhC;;;;;;;;;;;;;;;OAeG;IACH,UAAU,CAAC,OAAO,EAAE;QAClB,QAAQ,CAAC,MAAM,EAAE,qBAAqB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QACtD,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;KAC/B,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAEzB;;;OAGG;IACH,YAAY,CAAC,MAAM,EAAE,WAAW,GAAG,cAAc,CAAC;IAElD;;;;OAIG;IACH,YAAY,CAAC,OAAO,EAAE;QAAE,QAAQ,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;CACnG;AAED;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,wBAAwB,CAAC;AAEzD,UAAU,8BAA8B,CAAC,SAAS,SAAS,MAAM;IAC/D,QAAQ,CAAC,MAAM,EAAE,uBAAuB,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IAC3D,QAAQ,CAAC,OAAO,EAAE,wBAAwB,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IAC7D,QAAQ,CAAC,cAAc,EAAE,SAAS,0BAA0B,CAAC,KAAK,EAAE,SAAS,CAAC,EAAE,CAAC;CAClF;AA6DD;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,SAAS,MAAM,EAC9D,OAAO,EAAE,8BAA8B,CAAC,SAAS,CAAC,GACjD,iBAAiB,CAufnB"}
@@ -0,0 +1,20 @@
1
+ import type { NotOk, Ok } from '@prisma-next/utils/result';
2
+ import type { AnyRecord, CreateSqlMigrationPlanOptions, SqlMigrationPlan, SqlMigrationRunnerErrorCode, SqlMigrationRunnerFailure, SqlMigrationRunnerSuccessValue, SqlPlannerConflict, SqlPlannerFailureResult, SqlPlannerSuccessResult } from './types';
3
+ export declare function createMigrationPlan<TTargetDetails>(options: CreateSqlMigrationPlanOptions<TTargetDetails>): SqlMigrationPlan<TTargetDetails>;
4
+ export declare function plannerSuccess<TTargetDetails>(plan: SqlMigrationPlan<TTargetDetails>): SqlPlannerSuccessResult<TTargetDetails>;
5
+ export declare function plannerFailure(conflicts: readonly SqlPlannerConflict[]): SqlPlannerFailureResult;
6
+ /**
7
+ * Creates a successful migration runner result.
8
+ */
9
+ export declare function runnerSuccess(value: {
10
+ operationsPlanned: number;
11
+ operationsExecuted: number;
12
+ }): Ok<SqlMigrationRunnerSuccessValue>;
13
+ /**
14
+ * Creates a failed migration runner result.
15
+ */
16
+ export declare function runnerFailure(code: SqlMigrationRunnerErrorCode, summary: string, options?: {
17
+ why?: string;
18
+ meta?: AnyRecord;
19
+ }): NotOk<SqlMigrationRunnerFailure>;
20
+ //# sourceMappingURL=plan-helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plan-helpers.d.ts","sourceRoot":"","sources":["../../../src/core/migrations/plan-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,2BAA2B,CAAC;AAE3D,OAAO,KAAK,EACV,SAAS,EACT,6BAA6B,EAC7B,gBAAgB,EAIhB,2BAA2B,EAC3B,yBAAyB,EACzB,8BAA8B,EAC9B,kBAAkB,EAClB,uBAAuB,EACvB,uBAAuB,EACxB,MAAM,SAAS,CAAC;AA8EjB,wBAAgB,mBAAmB,CAAC,cAAc,EAChD,OAAO,EAAE,6BAA6B,CAAC,cAAc,CAAC,GACrD,gBAAgB,CAAC,cAAc,CAAC,CAUlC;AAED,wBAAgB,cAAc,CAAC,cAAc,EAC3C,IAAI,EAAE,gBAAgB,CAAC,cAAc,CAAC,GACrC,uBAAuB,CAAC,cAAc,CAAC,CAKzC;AAED,wBAAgB,cAAc,CAAC,SAAS,EAAE,SAAS,kBAAkB,EAAE,GAAG,uBAAuB,CAehG;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE;IACnC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,kBAAkB,EAAE,MAAM,CAAC;CAC5B,GAAG,EAAE,CAAC,8BAA8B,CAAC,CAOrC;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,2BAA2B,EACjC,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,SAAS,CAAA;CAAE,GAC3C,KAAK,CAAC,yBAAyB,CAAC,CAQlC"}
@@ -0,0 +1,6 @@
1
+ import type { MigrationOperationPolicy } from '@prisma-next/core-control-plane/types';
2
+ /**
3
+ * Policy used by `db init`: additive-only operations, no widening/destructive steps.
4
+ */
5
+ export declare const INIT_ADDITIVE_POLICY: MigrationOperationPolicy;
6
+ //# sourceMappingURL=policies.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"policies.d.ts","sourceRoot":"","sources":["../../../src/core/migrations/policies.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AAEtF;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,wBAEjC,CAAC"}
@@ -1,18 +1,16 @@
1
- import { TargetBoundComponentDescriptor } from '@prisma-next/contract/framework-components';
2
- import { ControlTargetDescriptor, ControlTargetInstance, MigrationOperationPolicy, MigrationPlannerSuccessResult, MigrationPlan, MigrationPlanOperation, MigrationPlannerFailureResult, MigrationPlannerConflict, ControlDriverInstance, OperationContext, MigrationRunnerExecutionChecks, MigrationRunnerSuccessValue, MigrationRunnerFailure, SchemaIssue, ControlExtensionDescriptor } from '@prisma-next/core-control-plane/types';
3
- import { SqlContract, SqlStorage } from '@prisma-next/sql-contract/types';
4
- import { SqlSchemaIR } from '@prisma-next/sql-schema-ir/types';
5
- import { Result } from '@prisma-next/utils/result';
6
- import { S as SqlControlFamilyInstance } from './instance-DiZi2k_2.js';
7
-
8
1
  /**
9
2
  * SQL-specific migration types.
10
3
  *
11
4
  * These types extend the canonical migration types from the framework control plane
12
5
  * with SQL-specific fields for execution (precheck SQL, execute SQL, etc.).
13
6
  */
14
-
15
- type AnyRecord = Readonly<Record<string, unknown>>;
7
+ import type { TargetBoundComponentDescriptor } from '@prisma-next/contract/framework-components';
8
+ import type { ControlDriverInstance, ControlExtensionDescriptor, ControlTargetDescriptor, ControlTargetInstance, MigrationOperationPolicy, MigrationPlan, MigrationPlannerConflict, MigrationPlannerFailureResult, MigrationPlannerSuccessResult, MigrationPlanOperation, MigrationRunnerExecutionChecks, MigrationRunnerFailure, MigrationRunnerSuccessValue, OperationContext, SchemaIssue } from '@prisma-next/core-control-plane/types';
9
+ import type { SqlContract, SqlStorage } from '@prisma-next/sql-contract/types';
10
+ import type { SqlSchemaIR } from '@prisma-next/sql-schema-ir/types';
11
+ import type { Result } from '@prisma-next/utils/result';
12
+ import type { SqlControlFamilyInstance } from '../instance';
13
+ export type AnyRecord = Readonly<Record<string, unknown>>;
16
14
  /**
17
15
  * A single database dependency declared by a framework component.
18
16
  * Uses SqlMigrationPlanOperation so we inherit the existing precheck/execute/postcheck contract.
@@ -22,7 +20,7 @@ type AnyRecord = Readonly<Record<string, unknown>>;
22
20
  * The planner emits these as migration operations, and the verifier uses the pure verification
23
21
  * hook to check satisfaction against the schema IR.
24
22
  */
25
- interface ComponentDatabaseDependency<TTargetDetails> {
23
+ export interface ComponentDatabaseDependency<TTargetDetails> {
26
24
  /** Stable identifier for the dependency (e.g. 'postgres.extension.vector') */
27
25
  readonly id: string;
28
26
  /** Human label for output (e.g. 'Enable vector extension') */
@@ -43,13 +41,21 @@ interface ComponentDatabaseDependency<TTargetDetails> {
43
41
  /**
44
42
  * Database dependencies declared by a framework component.
45
43
  */
46
- interface ComponentDatabaseDependencies<TTargetDetails> {
44
+ export interface ComponentDatabaseDependencies<TTargetDetails> {
47
45
  /**
48
46
  * Dependencies required for db init.
49
47
  * Future: update dependencies can be added later (e.g. widening/destructive).
50
48
  */
51
49
  readonly init?: readonly ComponentDatabaseDependency<TTargetDetails>[];
52
50
  }
51
+ /**
52
+ * Minimal structural type implemented by any descriptor that can expose
53
+ * component-owned database dependencies. Targets/adapters typically omit
54
+ * the property, while extensions provide dependency metadata.
55
+ */
56
+ export interface DatabaseDependencyProvider {
57
+ readonly databaseDependencies?: ComponentDatabaseDependencies<unknown>;
58
+ }
53
59
  /**
54
60
  * SQL-specific extension descriptor with optional database dependencies.
55
61
  * Extends the core ControlExtensionDescriptor with SQL-specific metadata.
@@ -57,14 +63,14 @@ interface ComponentDatabaseDependencies<TTargetDetails> {
57
63
  * Database dependencies are attached to the descriptor (not the instance) because
58
64
  * they are declarative metadata that planner/verifier need without constructing instances.
59
65
  */
60
- interface SqlControlExtensionDescriptor<TTargetId extends string> extends ControlExtensionDescriptor<'sql', TTargetId> {
66
+ export interface SqlControlExtensionDescriptor<TTargetId extends string> extends ControlExtensionDescriptor<'sql', TTargetId> {
61
67
  /** Optional database dependencies this extension requires. */
62
68
  readonly databaseDependencies?: ComponentDatabaseDependencies<unknown>;
63
69
  }
64
70
  /**
65
71
  * A single step in a SQL migration operation (precheck, execute, or postcheck).
66
72
  */
67
- interface SqlMigrationPlanOperationStep {
73
+ export interface SqlMigrationPlanOperationStep {
68
74
  readonly description: string;
69
75
  readonly sql: string;
70
76
  readonly meta?: AnyRecord;
@@ -72,7 +78,7 @@ interface SqlMigrationPlanOperationStep {
72
78
  /**
73
79
  * Target details for a SQL migration operation (table, column, index, etc.).
74
80
  */
75
- interface SqlMigrationPlanOperationTarget<TTargetDetails> {
81
+ export interface SqlMigrationPlanOperationTarget<TTargetDetails> {
76
82
  readonly id: string;
77
83
  readonly details?: TTargetDetails;
78
84
  }
@@ -80,7 +86,7 @@ interface SqlMigrationPlanOperationTarget<TTargetDetails> {
80
86
  * A single SQL migration operation with SQL-specific fields.
81
87
  * Extends the core MigrationPlanOperation with SQL execution details.
82
88
  */
83
- interface SqlMigrationPlanOperation<TTargetDetails> extends MigrationPlanOperation {
89
+ export interface SqlMigrationPlanOperation<TTargetDetails> extends MigrationPlanOperation {
84
90
  /** Optional detailed explanation of what this operation does and why. */
85
91
  readonly summary?: string;
86
92
  readonly target: SqlMigrationPlanOperationTarget<TTargetDetails>;
@@ -92,7 +98,7 @@ interface SqlMigrationPlanOperation<TTargetDetails> extends MigrationPlanOperati
92
98
  /**
93
99
  * Contract identity information for SQL migrations.
94
100
  */
95
- interface SqlMigrationPlanContractInfo {
101
+ export interface SqlMigrationPlanContractInfo {
96
102
  readonly coreHash: string;
97
103
  readonly profileHash?: string;
98
104
  }
@@ -100,7 +106,7 @@ interface SqlMigrationPlanContractInfo {
100
106
  * A SQL migration plan with SQL-specific fields.
101
107
  * Extends the core MigrationPlan with origin tracking and metadata.
102
108
  */
103
- interface SqlMigrationPlan<TTargetDetails> extends MigrationPlan {
109
+ export interface SqlMigrationPlan<TTargetDetails> extends MigrationPlan {
104
110
  /**
105
111
  * Origin contract identity that the plan expects the database to currently be at.
106
112
  * If omitted, the runner treats the origin as "no marker present" (empty database),
@@ -117,11 +123,11 @@ interface SqlMigrationPlan<TTargetDetails> extends MigrationPlan {
117
123
  /**
118
124
  * Specific conflict kinds for SQL migrations.
119
125
  */
120
- type SqlPlannerConflictKind = 'typeMismatch' | 'nullabilityConflict' | 'indexIncompatible' | 'foreignKeyConflict' | 'missingButNonAdditive' | 'unsupportedExtension' | 'extensionMissing' | 'unsupportedOperation';
126
+ export type SqlPlannerConflictKind = 'typeMismatch' | 'nullabilityConflict' | 'indexIncompatible' | 'foreignKeyConflict' | 'missingButNonAdditive' | 'unsupportedExtension' | 'extensionMissing' | 'unsupportedOperation';
121
127
  /**
122
128
  * Location information for SQL planner conflicts.
123
129
  */
124
- interface SqlPlannerConflictLocation {
130
+ export interface SqlPlannerConflictLocation {
125
131
  readonly table?: string;
126
132
  readonly column?: string;
127
133
  readonly index?: string;
@@ -132,7 +138,7 @@ interface SqlPlannerConflictLocation {
132
138
  * A SQL-specific planner conflict with additional location information.
133
139
  * Extends the core MigrationPlannerConflict.
134
140
  */
135
- interface SqlPlannerConflict extends MigrationPlannerConflict {
141
+ export interface SqlPlannerConflict extends MigrationPlannerConflict {
136
142
  readonly kind: SqlPlannerConflictKind;
137
143
  readonly location?: SqlPlannerConflictLocation;
138
144
  readonly meta?: AnyRecord;
@@ -140,25 +146,25 @@ interface SqlPlannerConflict extends MigrationPlannerConflict {
140
146
  /**
141
147
  * Successful SQL planner result with the migration plan.
142
148
  */
143
- interface SqlPlannerSuccessResult<TTargetDetails> extends Omit<MigrationPlannerSuccessResult, 'plan'> {
149
+ export interface SqlPlannerSuccessResult<TTargetDetails> extends Omit<MigrationPlannerSuccessResult, 'plan'> {
144
150
  readonly kind: 'success';
145
151
  readonly plan: SqlMigrationPlan<TTargetDetails>;
146
152
  }
147
153
  /**
148
154
  * Failed SQL planner result with the list of conflicts.
149
155
  */
150
- interface SqlPlannerFailureResult extends Omit<MigrationPlannerFailureResult, 'conflicts'> {
156
+ export interface SqlPlannerFailureResult extends Omit<MigrationPlannerFailureResult, 'conflicts'> {
151
157
  readonly kind: 'failure';
152
158
  readonly conflicts: readonly SqlPlannerConflict[];
153
159
  }
154
160
  /**
155
161
  * Union type for SQL planner results.
156
162
  */
157
- type SqlPlannerResult<TTargetDetails> = SqlPlannerSuccessResult<TTargetDetails> | SqlPlannerFailureResult;
163
+ export type SqlPlannerResult<TTargetDetails> = SqlPlannerSuccessResult<TTargetDetails> | SqlPlannerFailureResult;
158
164
  /**
159
165
  * Options for SQL migration planner.
160
166
  */
161
- interface SqlMigrationPlannerPlanOptions {
167
+ export interface SqlMigrationPlannerPlanOptions {
162
168
  readonly contract: SqlContract<SqlStorage>;
163
169
  readonly schema: SqlSchemaIR;
164
170
  readonly policy: MigrationOperationPolicy;
@@ -174,20 +180,20 @@ interface SqlMigrationPlannerPlanOptions {
174
180
  * SQL migration planner interface.
175
181
  * Extends the core MigrationPlanner with SQL-specific types.
176
182
  */
177
- interface SqlMigrationPlanner<TTargetDetails> {
183
+ export interface SqlMigrationPlanner<TTargetDetails> {
178
184
  plan(options: SqlMigrationPlannerPlanOptions): SqlPlannerResult<TTargetDetails>;
179
185
  }
180
186
  /**
181
187
  * Callbacks for SQL migration runner execution.
182
188
  */
183
- interface SqlMigrationRunnerExecuteCallbacks<TTargetDetails> {
189
+ export interface SqlMigrationRunnerExecuteCallbacks<TTargetDetails> {
184
190
  onOperationStart?(operation: SqlMigrationPlanOperation<TTargetDetails>): void;
185
191
  onOperationComplete?(operation: SqlMigrationPlanOperation<TTargetDetails>): void;
186
192
  }
187
193
  /**
188
194
  * Options for SQL migration runner execution.
189
195
  */
190
- interface SqlMigrationRunnerExecuteOptions<TTargetDetails> {
196
+ export interface SqlMigrationRunnerExecuteOptions<TTargetDetails> {
191
197
  readonly plan: SqlMigrationPlan<TTargetDetails>;
192
198
  readonly driver: ControlDriverInstance<'sql', string>;
193
199
  /**
@@ -219,12 +225,12 @@ interface SqlMigrationRunnerExecuteOptions<TTargetDetails> {
219
225
  /**
220
226
  * Error codes for SQL migration runner failures.
221
227
  */
222
- type SqlMigrationRunnerErrorCode = 'DESTINATION_CONTRACT_MISMATCH' | 'MARKER_ORIGIN_MISMATCH' | 'POLICY_VIOLATION' | 'PRECHECK_FAILED' | 'POSTCHECK_FAILED' | 'SCHEMA_VERIFY_FAILED' | 'EXECUTION_FAILED';
228
+ export type SqlMigrationRunnerErrorCode = 'DESTINATION_CONTRACT_MISMATCH' | 'MARKER_ORIGIN_MISMATCH' | 'POLICY_VIOLATION' | 'PRECHECK_FAILED' | 'POSTCHECK_FAILED' | 'SCHEMA_VERIFY_FAILED' | 'EXECUTION_FAILED';
223
229
  /**
224
230
  * Detailed information about a SQL migration runner failure.
225
231
  * Extends the core MigrationRunnerFailure with SQL-specific error codes.
226
232
  */
227
- interface SqlMigrationRunnerFailure extends MigrationRunnerFailure {
233
+ export interface SqlMigrationRunnerFailure extends MigrationRunnerFailure {
228
234
  readonly code: SqlMigrationRunnerErrorCode;
229
235
  readonly meta?: AnyRecord;
230
236
  }
@@ -232,24 +238,24 @@ interface SqlMigrationRunnerFailure extends MigrationRunnerFailure {
232
238
  * Success value for SQL migration runner execution.
233
239
  * Extends core type for type branding and potential SQL-specific extensions.
234
240
  */
235
- interface SqlMigrationRunnerSuccessValue extends MigrationRunnerSuccessValue {
241
+ export interface SqlMigrationRunnerSuccessValue extends MigrationRunnerSuccessValue {
236
242
  }
237
243
  /**
238
244
  * Result type for SQL migration runner execution.
239
245
  */
240
- type SqlMigrationRunnerResult = Result<SqlMigrationRunnerSuccessValue, SqlMigrationRunnerFailure>;
246
+ export type SqlMigrationRunnerResult = Result<SqlMigrationRunnerSuccessValue, SqlMigrationRunnerFailure>;
241
247
  /**
242
248
  * SQL migration runner interface.
243
249
  * Extends the core MigrationRunner with SQL-specific types.
244
250
  */
245
- interface SqlMigrationRunner<TTargetDetails> {
251
+ export interface SqlMigrationRunner<TTargetDetails> {
246
252
  execute(options: SqlMigrationRunnerExecuteOptions<TTargetDetails>): Promise<SqlMigrationRunnerResult>;
247
253
  }
248
254
  /**
249
255
  * SQL control target descriptor with migration support.
250
256
  * Extends the core ControlTargetDescriptor with SQL-specific migration methods.
251
257
  */
252
- interface SqlControlTargetDescriptor<TTargetId extends string, TTargetDetails> extends ControlTargetDescriptor<'sql', TTargetId, ControlTargetInstance<'sql', TTargetId>, SqlControlFamilyInstance> {
258
+ export interface SqlControlTargetDescriptor<TTargetId extends string, TTargetDetails> extends ControlTargetDescriptor<'sql', TTargetId, ControlTargetInstance<'sql', TTargetId>, SqlControlFamilyInstance> {
253
259
  /**
254
260
  * Creates a SQL migration planner for this target.
255
261
  * Direct method for SQL-specific usage.
@@ -264,12 +270,11 @@ interface SqlControlTargetDescriptor<TTargetId extends string, TTargetDetails> e
264
270
  /**
265
271
  * Options for creating a SQL migration plan.
266
272
  */
267
- interface CreateSqlMigrationPlanOptions<TTargetDetails> {
273
+ export interface CreateSqlMigrationPlanOptions<TTargetDetails> {
268
274
  readonly targetId: string;
269
275
  readonly origin?: SqlMigrationPlanContractInfo | null;
270
276
  readonly destination: SqlMigrationPlanContractInfo;
271
277
  readonly operations: readonly SqlMigrationPlanOperation<TTargetDetails>[];
272
278
  readonly meta?: AnyRecord;
273
279
  }
274
-
275
- export type { AnyRecord as A, CreateSqlMigrationPlanOptions as C, SqlControlTargetDescriptor as S, SqlMigrationPlan as a, SqlPlannerConflict as b, SqlPlannerFailureResult as c, SqlPlannerSuccessResult as d, SqlMigrationRunnerErrorCode as e, SqlMigrationRunnerFailure as f, SqlMigrationRunnerSuccessValue as g, ComponentDatabaseDependencies as h, ComponentDatabaseDependency as i, SqlControlExtensionDescriptor as j, SqlMigrationPlanContractInfo as k, SqlMigrationPlanner as l, SqlMigrationPlannerPlanOptions as m, SqlMigrationPlanOperation as n, SqlMigrationPlanOperationStep as o, SqlMigrationPlanOperationTarget as p, SqlMigrationRunner as q, SqlMigrationRunnerExecuteCallbacks as r, SqlMigrationRunnerExecuteOptions as s, SqlMigrationRunnerResult as t, SqlPlannerConflictKind as u, SqlPlannerConflictLocation as v, SqlPlannerResult as w };
280
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/core/migrations/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,4CAA4C,CAAC;AACjG,OAAO,KAAK,EACV,qBAAqB,EACrB,0BAA0B,EAC1B,uBAAuB,EACvB,qBAAqB,EACrB,wBAAwB,EACxB,aAAa,EACb,wBAAwB,EACxB,6BAA6B,EAC7B,6BAA6B,EAC7B,sBAAsB,EACtB,8BAA8B,EAC9B,sBAAsB,EACtB,2BAA2B,EAC3B,gBAAgB,EAChB,WAAW,EACZ,MAAM,uCAAuC,CAAC;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC/E,OAAO,KAAK,EAAE,WA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C;IACnD,QAAQ,CAAC,UAAU,EAAE,SAAS,yBAAyB,CAAC,cAAc,CAAC,EAAE,CAAC;IAC1E,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC;CAC3B"}
@@ -0,0 +1,19 @@
1
+ import type { RuntimeAdapterDescriptor, RuntimeDriverDescriptor, RuntimeExtensionDescriptor, RuntimeFamilyDescriptor, RuntimeTargetDescriptor } from '@prisma-next/core-execution-plane/types';
2
+ import { type SqlRuntimeAdapterInstance, type SqlRuntimeDriverInstance, type SqlRuntimeFamilyInstance } from './runtime-instance';
3
+ /**
4
+ * SQL runtime family descriptor implementation.
5
+ * Provides factory method to create SQL runtime family instance.
6
+ */
7
+ export declare class SqlRuntimeFamilyDescriptor implements RuntimeFamilyDescriptor<'sql', SqlRuntimeFamilyInstance> {
8
+ readonly kind: "family";
9
+ readonly id = "sql";
10
+ readonly familyId: "sql";
11
+ readonly version = "0.0.1";
12
+ create<TTargetId extends string>(options: {
13
+ readonly target: RuntimeTargetDescriptor<'sql', TTargetId>;
14
+ readonly adapter: RuntimeAdapterDescriptor<'sql', TTargetId, SqlRuntimeAdapterInstance<TTargetId>>;
15
+ readonly driver: RuntimeDriverDescriptor<'sql', TTargetId, SqlRuntimeDriverInstance<TTargetId>>;
16
+ readonly extensionPacks: readonly RuntimeExtensionDescriptor<'sql', TTargetId>[];
17
+ }): SqlRuntimeFamilyInstance;
18
+ }
19
+ //# sourceMappingURL=runtime-descriptor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-descriptor.d.ts","sourceRoot":"","sources":["../../src/core/runtime-descriptor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,uBAAuB,EACvB,0BAA0B,EAC1B,uBAAuB,EACvB,uBAAuB,EACxB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAEL,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC9B,MAAM,oBAAoB,CAAC;AAE5B;;;GAGG;AACH,qBAAa,0BACX,YAAW,uBAAuB,CAAC,KAAK,EAAE,wBAAwB,CAAC;IAEnE,QAAQ,CAAC,IAAI,EAAG,QAAQ,CAAU;IAClC,QAAQ,CAAC,EAAE,SAAS;IACpB,QAAQ,CAAC,QAAQ,EAAG,KAAK,CAAU;IACnC,QAAQ,CAAC,OAAO,WAAW;IAE3B,MAAM,CAAC,SAAS,SAAS,MAAM,EAAE,OAAO,EAAE;QACxC,QAAQ,CAAC,MAAM,EAAE,uBAAuB,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;QAC3D,QAAQ,CAAC,OAAO,EAAE,wBAAwB,CACxC,KAAK,EACL,SAAS,EACT,yBAAyB,CAAC,SAAS,CAAC,CACrC,CAAC;QACF,QAAQ,CAAC,MAAM,EAAE,uBAAuB,CAAC,KAAK,EAAE,SAAS,EAAE,wBAAwB,CAAC,SAAS,CAAC,CAAC,CAAC;QAChG,QAAQ,CAAC,cAAc,EAAE,SAAS,0BAA0B,CAAC,KAAK,EAAE,SAAS,CAAC,EAAE,CAAC;KAClF,GAAG,wBAAwB;CAS7B"}
@@ -0,0 +1,54 @@
1
+ import type { RuntimeAdapterDescriptor, RuntimeDriverDescriptor, RuntimeDriverInstance, RuntimeFamilyDescriptor, RuntimeFamilyInstance, RuntimeTargetDescriptor } from '@prisma-next/core-execution-plane/types';
2
+ import type { Log, Plugin, RuntimeVerifyOptions } from '@prisma-next/runtime-executor';
3
+ import type { SqlContract, SqlStorage } from '@prisma-next/sql-contract/types';
4
+ import type { Adapter, LoweredStatement, SelectAst, SqlDriver } from '@prisma-next/sql-relational-core/ast';
5
+ import type { Runtime, SqlRuntimeAdapterInstance, SqlRuntimeExtensionDescriptor } from '@prisma-next/sql-runtime';
6
+ /**
7
+ * SQL runtime driver instance type.
8
+ * Combines identity properties with SQL-specific behavior methods.
9
+ */
10
+ export type SqlRuntimeDriverInstance<TTargetId extends string = string> = RuntimeDriverInstance<'sql', TTargetId> & SqlDriver;
11
+ export type { SqlRuntimeAdapterInstance } from '@prisma-next/sql-runtime';
12
+ /**
13
+ * SQL runtime family instance interface.
14
+ * Extends base RuntimeFamilyInstance with SQL-specific runtime creation method.
15
+ */
16
+ export interface SqlRuntimeFamilyInstance extends RuntimeFamilyInstance<'sql'> {
17
+ /**
18
+ * Creates a SQL runtime from contract, driver options, and verification settings.
19
+ *
20
+ * Extension packs are routed through composition (at instance creation time),
21
+ * not through this method. This aligns with control-plane composition patterns.
22
+ *
23
+ * @param options - Runtime creation options
24
+ * @param options.contract - SQL contract
25
+ * @param options.driverOptions - Driver options (e.g., PostgresDriverOptions)
26
+ * @param options.verify - Runtime verification options
27
+ * @param options.plugins - Optional plugins
28
+ * @param options.mode - Optional runtime mode
29
+ * @param options.log - Optional log instance
30
+ * @returns Runtime instance
31
+ */
32
+ createRuntime<TContract extends SqlContract<SqlStorage>>(options: {
33
+ readonly contract: TContract;
34
+ readonly driverOptions: unknown;
35
+ readonly verify: RuntimeVerifyOptions;
36
+ readonly plugins?: readonly Plugin<TContract, Adapter<SelectAst, SqlContract<SqlStorage>, LoweredStatement>, SqlDriver>[];
37
+ readonly mode?: 'strict' | 'permissive';
38
+ readonly log?: Log;
39
+ }): Runtime;
40
+ }
41
+ /**
42
+ * Creates a SQL runtime family instance from runtime descriptors.
43
+ *
44
+ * Routes the same framework composition as control-plane:
45
+ * family, target, adapter, driver, extensionPacks (all as descriptors with IDs).
46
+ */
47
+ export declare function createSqlRuntimeFamilyInstance<TTargetId extends string>(options: {
48
+ readonly family: RuntimeFamilyDescriptor<'sql'>;
49
+ readonly target: RuntimeTargetDescriptor<'sql', TTargetId>;
50
+ readonly adapter: RuntimeAdapterDescriptor<'sql', TTargetId, SqlRuntimeAdapterInstance<TTargetId>>;
51
+ readonly driver: RuntimeDriverDescriptor<'sql', TTargetId, SqlRuntimeDriverInstance<TTargetId>>;
52
+ readonly extensionPacks?: readonly SqlRuntimeExtensionDescriptor<TTargetId>[];
53
+ }): SqlRuntimeFamilyInstance;
54
+ //# sourceMappingURL=runtime-instance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-instance.d.ts","sourceRoot":"","sources":["../../src/core/runtime-instance.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,wBAAwB,EACxB,uBAAuB,EACvB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACrB,uBAAuB,EACxB,MAAM,yCAAyC,CAAC;AACjD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACvF,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC/E,OAAO,KAAK,EACV,OAAO,EACP,gBAAgB,EAChB,SAAS,EACT,SAAS,EACV,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,EACV,OAAO,EAEP,yBAAyB,EACzB,6BAA6B,EAC9B,MAAM,0BAA0B,CAAC;AAGlC;;;GAGG;AACH,MAAM,MAAM,wBAAwB,CAAC,SAAS,SAAS,MAAM,GAAG,MAAM,IAAI,qBAAqB,CAC7F,KAAK,EACL,SAAS,CACV,GACC,SAAS,CAAC;AAGZ,YAAY,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAE1E;;;GAGG;AACH,MAAM,WAAW,wBAAyB,SAAQ,qBAAqB,CAAC,KAAK,CAAC;IAC5E;;;;;;;;;;;;;;OAcG;IACH,aAAa,CAAC,SAAS,SAAS,WAAW,CAAC,UAAU,CAAC,EAAE,OAAO,EAAE;QAChE,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;QAC7B,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;QAChC,QAAQ,CAAC,MAAM,EAAE,oBAAoB,CAAC;QACtC,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,CAChC,SAAS,EACT,OAAO,CAAC,SAAS,EAAE,WAAW,CAAC,UAAU,CAAC,EAAE,gBAA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