@prisma-next/family-sql 0.3.0-dev.9 → 0.3.0-pr.100.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.
- package/dist/{chunk-SQ2VWYDV.js → chunk-EHYNXF4K.js} +41 -3
- package/dist/chunk-EHYNXF4K.js.map +1 -0
- package/dist/{chunk-BHEGVBY7.js → chunk-XH2Y5NTD.js} +59 -116
- package/dist/chunk-XH2Y5NTD.js.map +1 -0
- package/dist/core/assembly.d.ts +18 -0
- package/dist/core/assembly.d.ts.map +1 -1
- package/dist/core/descriptor.d.ts +6 -2
- package/dist/core/descriptor.d.ts.map +1 -1
- package/dist/core/instance.d.ts.map +1 -1
- package/dist/core/schema-verify/verify-helpers.d.ts +48 -2
- package/dist/core/schema-verify/verify-helpers.d.ts.map +1 -1
- package/dist/core/schema-verify/verify-sql-schema.d.ts.map +1 -1
- package/dist/exports/control.js +2 -2
- package/dist/exports/schema-verify.d.ts +1 -1
- package/dist/exports/schema-verify.d.ts.map +1 -1
- package/dist/exports/schema-verify.js +5 -1
- package/dist/exports/test-utils.js +2 -2
- package/package.json +20 -20
- package/src/core/assembly.ts +75 -0
- package/src/core/instance.ts +7 -1
- package/src/core/schema-verify/verify-helpers.ts +140 -122
- package/src/core/schema-verify/verify-sql-schema.ts +4 -0
- package/src/exports/schema-verify.ts +6 -1
- package/dist/chunk-BHEGVBY7.js.map +0 -1
- package/dist/chunk-SQ2VWYDV.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assembly.d.ts","sourceRoot":"","sources":["../../src/core/assembly.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AACnF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,KAAK,EACV,wBAAwB,EACxB,0BAA0B,EAC1B,uBAAuB,EACxB,MAAM,uCAAuC,CAAC;AAC/C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,MAAM,CAAC,CAC5C,GACA,aAAa,CAAC,eAAe,CAAC,CAWhC"}
|
|
@@ -13,9 +13,13 @@ export declare class SqlFamilyDescriptor implements ControlFamilyDescriptor<'sql
|
|
|
13
13
|
readonly id: "sql";
|
|
14
14
|
readonly validateTypes: (ir: import("@prisma-next/contract/ir").ContractIR, _ctx: import("@prisma-next/contract/types").ValidationContext) => void;
|
|
15
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
|
|
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>, options?: import("@prisma-next/contract/types").GenerateContractTypesOptions) => string;
|
|
17
17
|
readonly generateStorageType: (storage: import("@prisma-next/sql-contract/types").SqlStorage) => string;
|
|
18
|
-
readonly
|
|
18
|
+
readonly generateStorageTypesType: (types: import("@prisma-next/sql-contract/types").SqlStorage["types"]) => string;
|
|
19
|
+
readonly serializeTypeParamsLiteral: (params: Record<string, unknown>) => string;
|
|
20
|
+
readonly serializeValue: (value: unknown) => string;
|
|
21
|
+
readonly generateModelsType: (models: Record<string, import("@prisma-next/sql-contract/types").ModelDefinition> | undefined, storage: import("@prisma-next/sql-contract/types").SqlStorage, parameterizedRenderers?: Map<string, import("@prisma-next/contract/types").TypeRenderEntry>) => string;
|
|
22
|
+
readonly generateColumnType: (column: import("@prisma-next/sql-contract/types").StorageColumn, storage: import("@prisma-next/sql-contract/types").SqlStorage, parameterizedRenderers: Map<string, import("@prisma-next/contract/types").TypeRenderEntry> | undefined, renderCtx: import("@prisma-next/contract/types").TypeRenderContext) => string;
|
|
19
23
|
readonly generateRelationsType: (relations: Record<string, unknown> | undefined) => string;
|
|
20
24
|
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
25
|
};
|
|
@@ -1 +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
|
|
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;;;;uRAGX,CAAD;;;;;0NAY6Y,CAAC;;;;MAf3W;IAEpC,MAAM,CAAC,SAAS,SAAS,MAAM,EAC7B,KAAK,EAAE,iBAAiB,CAAC,KAAK,EAAE,SAAS,CAAC,GACzC,wBAAwB;CAU5B"}
|
|
@@ -1 +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,2CAA2C,CAAC;AACnF,OAAO,KAAK,EAAwB,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAEzF,OAAO,KAAK,EAAE,cAAc,EAAkB,MAAM,6CAA6C,CAAC;AAClG,OAAO,KAAK,EACV,wBAAwB,EACxB,qBAAqB,EACrB,0BAA0B,EAC1B,qBAAqB,EACrB,uBAAuB,EACvB,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,0BAA0B,EAC3B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAIjE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAMzE,OAAO,KAAK,EAAE,WAAW,EAAc,MAAM,kCAAkC,CAAC;
|
|
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,2CAA2C,CAAC;AACnF,OAAO,KAAK,EAAwB,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAEzF,OAAO,KAAK,EAAE,cAAc,EAAkB,MAAM,6CAA6C,CAAC;AAClG,OAAO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AAM,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,CA2fnB"}
|
|
@@ -10,26 +10,72 @@ import type { ComponentDatabaseDependency } from '../migrations/types';
|
|
|
10
10
|
* Compares two arrays of strings for equality (order-sensitive).
|
|
11
11
|
*/
|
|
12
12
|
export declare function arraysEqual(a: readonly string[], b: readonly string[]): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Checks if a unique constraint requirement is satisfied by the given columns.
|
|
15
|
+
*
|
|
16
|
+
* Semantic satisfaction: a unique constraint requirement can be satisfied by:
|
|
17
|
+
* - A unique constraint with the same columns, OR
|
|
18
|
+
* - A unique index with the same columns
|
|
19
|
+
*
|
|
20
|
+
* @param uniques - The unique constraints in the schema table
|
|
21
|
+
* @param indexes - The indexes in the schema table
|
|
22
|
+
* @param columns - The columns required by the unique constraint
|
|
23
|
+
* @returns true if the requirement is satisfied
|
|
24
|
+
*/
|
|
25
|
+
export declare function isUniqueConstraintSatisfied(uniques: readonly SqlUniqueIR[], indexes: readonly SqlIndexIR[], columns: readonly string[]): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Checks if an index requirement is satisfied by the given columns.
|
|
28
|
+
*
|
|
29
|
+
* Semantic satisfaction: a non-unique index requirement can be satisfied by:
|
|
30
|
+
* - Any index (unique or non-unique) with the same columns, OR
|
|
31
|
+
* - A unique constraint with the same columns (stronger satisfies weaker)
|
|
32
|
+
*
|
|
33
|
+
* @param indexes - The indexes in the schema table
|
|
34
|
+
* @param uniques - The unique constraints in the schema table
|
|
35
|
+
* @param columns - The columns required by the index
|
|
36
|
+
* @returns true if the requirement is satisfied
|
|
37
|
+
*/
|
|
38
|
+
export declare function isIndexSatisfied(indexes: readonly SqlIndexIR[], uniques: readonly SqlUniqueIR[], columns: readonly string[]): boolean;
|
|
13
39
|
/**
|
|
14
40
|
* Verifies primary key matches between contract and schema.
|
|
15
41
|
* Returns 'pass' or 'fail'.
|
|
42
|
+
*
|
|
43
|
+
* Uses semantic satisfaction: identity is based on (table + kind + columns).
|
|
44
|
+
* Name differences are ignored by default (names are for DDL/diagnostics, not identity).
|
|
16
45
|
*/
|
|
17
46
|
export declare function verifyPrimaryKey(contractPK: PrimaryKey, schemaPK: PrimaryKey | undefined, tableName: string, issues: SchemaIssue[]): 'pass' | 'fail';
|
|
18
47
|
/**
|
|
19
48
|
* Verifies foreign keys match between contract and schema.
|
|
20
49
|
* Returns verification nodes for the tree.
|
|
50
|
+
*
|
|
51
|
+
* Uses semantic satisfaction: identity is based on (table + columns + referenced table + referenced columns).
|
|
52
|
+
* Name differences are ignored by default (names are for DDL/diagnostics, not identity).
|
|
21
53
|
*/
|
|
22
54
|
export declare function verifyForeignKeys(contractFKs: readonly ForeignKey[], schemaFKs: readonly SqlForeignKeyIR[], tableName: string, tablePath: string, issues: SchemaIssue[], strict: boolean): SchemaVerificationNode[];
|
|
23
55
|
/**
|
|
24
56
|
* Verifies unique constraints match between contract and schema.
|
|
25
57
|
* Returns verification nodes for the tree.
|
|
58
|
+
*
|
|
59
|
+
* Uses semantic satisfaction: identity is based on (table + kind + columns).
|
|
60
|
+
* A unique constraint requirement can be satisfied by either:
|
|
61
|
+
* - A unique constraint with the same columns, or
|
|
62
|
+
* - A unique index with the same columns
|
|
63
|
+
*
|
|
64
|
+
* Name differences are ignored by default (names are for DDL/diagnostics, not identity).
|
|
26
65
|
*/
|
|
27
|
-
export declare function verifyUniqueConstraints(contractUniques: readonly UniqueConstraint[], schemaUniques: readonly SqlUniqueIR[], tableName: string, tablePath: string, issues: SchemaIssue[], strict: boolean): SchemaVerificationNode[];
|
|
66
|
+
export declare function verifyUniqueConstraints(contractUniques: readonly UniqueConstraint[], schemaUniques: readonly SqlUniqueIR[], schemaIndexes: readonly SqlIndexIR[], tableName: string, tablePath: string, issues: SchemaIssue[], strict: boolean): SchemaVerificationNode[];
|
|
28
67
|
/**
|
|
29
68
|
* Verifies indexes match between contract and schema.
|
|
30
69
|
* Returns verification nodes for the tree.
|
|
70
|
+
*
|
|
71
|
+
* Uses semantic satisfaction: identity is based on (table + kind + columns).
|
|
72
|
+
* A non-unique index requirement can be satisfied by either:
|
|
73
|
+
* - A non-unique index with the same columns, or
|
|
74
|
+
* - A unique index with the same columns (stronger satisfies weaker)
|
|
75
|
+
*
|
|
76
|
+
* Name differences are ignored by default (names are for DDL/diagnostics, not identity).
|
|
31
77
|
*/
|
|
32
|
-
export declare function verifyIndexes(contractIndexes: readonly Index[], schemaIndexes: readonly SqlIndexIR[], tableName: string, tablePath: string, issues: SchemaIssue[], strict: boolean): SchemaVerificationNode[];
|
|
78
|
+
export declare function verifyIndexes(contractIndexes: readonly Index[], schemaIndexes: readonly SqlIndexIR[], schemaUniques: readonly SqlUniqueIR[], tableName: string, tablePath: string, issues: SchemaIssue[], strict: boolean): SchemaVerificationNode[];
|
|
33
79
|
/**
|
|
34
80
|
* Verifies database dependencies are installed using component-owned verification hooks.
|
|
35
81
|
* Each dependency provides a pure verifyDatabaseDependencyInstalled function that checks
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify-helpers.d.ts","sourceRoot":"","sources":["../../../src/core/schema-verify/verify-helpers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AACjG,OAAO,KAAK,EACV,UAAU,EACV,KAAK,EACL,UAAU,EACV,gBAAgB,EACjB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EACV,eAAe,EACf,UAAU,EACV,WAAW,EACX,WAAW,EACZ,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AAEvE;;GAEG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,SAAS,MAAM,EAAE,EAAE,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAU/E;AAED
|
|
1
|
+
{"version":3,"file":"verify-helpers.d.ts","sourceRoot":"","sources":["../../../src/core/schema-verify/verify-helpers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AACjG,OAAO,KAAK,EACV,UAAU,EACV,KAAK,EACL,UAAU,EACV,gBAAgB,EACjB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EACV,eAAe,EACf,UAAU,EACV,WAAW,EACX,WAAW,EACZ,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AAEvE;;GAEG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,SAAS,MAAM,EAAE,EAAE,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,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;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,sBAAsB,GAAG,0BAA0B,CAye3F"}
|
package/dist/exports/control.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createSqlFamilyInstance
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-EHYNXF4K.js";
|
|
4
4
|
import "../chunk-SU7LN2UH.js";
|
|
5
|
-
import "../chunk-
|
|
5
|
+
import "../chunk-XH2Y5NTD.js";
|
|
6
6
|
|
|
7
7
|
// src/core/descriptor.ts
|
|
8
8
|
import { sqlTargetFamilyHook } from "@prisma-next/sql-contract-emitter";
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* without a database connection. It's suitable for migration planning and
|
|
6
6
|
* other tools that need to compare schema states.
|
|
7
7
|
*/
|
|
8
|
-
export { arraysEqual, verifyDatabaseDependencies } from '../core/schema-verify/verify-helpers';
|
|
8
|
+
export { arraysEqual, isIndexSatisfied, isUniqueConstraintSatisfied, verifyDatabaseDependencies, } from '../core/schema-verify/verify-helpers';
|
|
9
9
|
export type { VerifySqlSchemaOptions } from '../core/schema-verify/verify-sql-schema';
|
|
10
10
|
export { verifySqlSchema } from '../core/schema-verify/verify-sql-schema';
|
|
11
11
|
//# sourceMappingURL=schema-verify.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-verify.d.ts","sourceRoot":"","sources":["../../src/exports/schema-verify.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"schema-verify.d.ts","sourceRoot":"","sources":["../../src/exports/schema-verify.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,2BAA2B,EAC3B,0BAA0B,GAC3B,MAAM,sCAAsC,CAAC;AAC9C,YAAY,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AACtF,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC"}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
arraysEqual,
|
|
3
|
+
isIndexSatisfied,
|
|
4
|
+
isUniqueConstraintSatisfied,
|
|
3
5
|
verifyDatabaseDependencies,
|
|
4
6
|
verifySqlSchema
|
|
5
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-XH2Y5NTD.js";
|
|
6
8
|
export {
|
|
7
9
|
arraysEqual,
|
|
10
|
+
isIndexSatisfied,
|
|
11
|
+
isUniqueConstraintSatisfied,
|
|
8
12
|
verifyDatabaseDependencies,
|
|
9
13
|
verifySqlSchema
|
|
10
14
|
};
|
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
extractCodecTypeImports,
|
|
5
5
|
extractExtensionIds,
|
|
6
6
|
extractOperationTypeImports
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-EHYNXF4K.js";
|
|
8
8
|
import "../chunk-SU7LN2UH.js";
|
|
9
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-XH2Y5NTD.js";
|
|
10
10
|
export {
|
|
11
11
|
assembleOperationRegistry,
|
|
12
12
|
convertOperationManifest,
|
package/package.json
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma-next/family-sql",
|
|
3
|
-
"version": "0.3.0-
|
|
3
|
+
"version": "0.3.0-pr.100.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"description": "SQL family descriptor for Prisma Next",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"arktype": "^2.0.0",
|
|
9
|
-
"@prisma-next/cli": "0.3.0-
|
|
10
|
-
"@prisma-next/contract": "0.3.0-
|
|
11
|
-
"@prisma-next/core-control-plane": "0.3.0-
|
|
12
|
-
"@prisma-next/
|
|
13
|
-
"@prisma-next/
|
|
14
|
-
"@prisma-next/
|
|
15
|
-
"@prisma-next/sql-contract
|
|
16
|
-
"@prisma-next/sql-contract-
|
|
17
|
-
"@prisma-next/sql-
|
|
18
|
-
"@prisma-next/sql-
|
|
19
|
-
"@prisma-next/sql-
|
|
20
|
-
"@prisma-next/sql-
|
|
21
|
-
"@prisma-next/sql-
|
|
22
|
-
"@prisma-next/utils": "0.3.0-
|
|
9
|
+
"@prisma-next/cli": "0.3.0-pr.100.2",
|
|
10
|
+
"@prisma-next/contract": "0.3.0-pr.100.2",
|
|
11
|
+
"@prisma-next/core-control-plane": "0.3.0-pr.100.2",
|
|
12
|
+
"@prisma-next/core-execution-plane": "0.3.0-pr.100.2",
|
|
13
|
+
"@prisma-next/operations": "0.3.0-pr.100.2",
|
|
14
|
+
"@prisma-next/runtime-executor": "0.3.0-pr.100.2",
|
|
15
|
+
"@prisma-next/sql-contract": "0.3.0-pr.100.2",
|
|
16
|
+
"@prisma-next/sql-contract-emitter": "0.3.0-pr.100.2",
|
|
17
|
+
"@prisma-next/sql-contract-ts": "0.3.0-pr.100.2",
|
|
18
|
+
"@prisma-next/sql-operations": "0.3.0-pr.100.2",
|
|
19
|
+
"@prisma-next/sql-relational-core": "0.3.0-pr.100.2",
|
|
20
|
+
"@prisma-next/sql-runtime": "0.3.0-pr.100.2",
|
|
21
|
+
"@prisma-next/sql-schema-ir": "0.3.0-pr.100.2",
|
|
22
|
+
"@prisma-next/utils": "0.3.0-pr.100.2"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@vitest/coverage-v8": "4.0.16",
|
|
26
25
|
"tsup": "8.5.1",
|
|
27
26
|
"typescript": "5.9.3",
|
|
28
27
|
"vitest": "4.0.16",
|
|
29
|
-
"@prisma-next/driver-postgres": "0.3.0-
|
|
30
|
-
"@prisma-next/test-utils": "0.0.1"
|
|
28
|
+
"@prisma-next/driver-postgres": "0.3.0-pr.100.2",
|
|
29
|
+
"@prisma-next/test-utils": "0.0.1",
|
|
30
|
+
"@prisma-next/tsconfig": "0.0.0"
|
|
31
31
|
},
|
|
32
32
|
"files": [
|
|
33
33
|
"dist",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"test": "vitest run",
|
|
65
65
|
"test:coverage": "vitest run --coverage",
|
|
66
66
|
"typecheck": "tsc --project tsconfig.json --noEmit",
|
|
67
|
-
"lint": "biome check . --
|
|
68
|
-
"clean": "
|
|
67
|
+
"lint": "biome check . --error-on-warnings",
|
|
68
|
+
"clean": "rm -rf dist dist-tsc dist-tsc-prod coverage .tmp-output"
|
|
69
69
|
}
|
|
70
70
|
}
|
package/src/core/assembly.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
NormalizedTypeRenderer,
|
|
3
|
+
TypeRenderer,
|
|
4
|
+
} from '@prisma-next/contract/framework-components';
|
|
5
|
+
import { normalizeRenderer } from '@prisma-next/contract/framework-components';
|
|
1
6
|
import type { OperationManifest } from '@prisma-next/contract/pack-manifest-types';
|
|
2
7
|
import type { TypesImportSpec } from '@prisma-next/contract/types';
|
|
3
8
|
import type {
|
|
@@ -52,6 +57,9 @@ export function extractCodecTypeImports(
|
|
|
52
57
|
if (codecTypes?.import) {
|
|
53
58
|
imports.push(codecTypes.import);
|
|
54
59
|
}
|
|
60
|
+
if (codecTypes?.typeImports) {
|
|
61
|
+
imports.push(...codecTypes.typeImports);
|
|
62
|
+
}
|
|
55
63
|
}
|
|
56
64
|
|
|
57
65
|
return imports;
|
|
@@ -115,3 +123,70 @@ export function extractExtensionIds(
|
|
|
115
123
|
|
|
116
124
|
return ids;
|
|
117
125
|
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Extracts and normalizes parameterized codec renderers from descriptors.
|
|
129
|
+
* Templates are compiled to functions at this layer.
|
|
130
|
+
*
|
|
131
|
+
* Throws an error if multiple descriptors provide a renderer for the same codecId.
|
|
132
|
+
* This is intentional - duplicate codecId is a hard error, not a silent override.
|
|
133
|
+
*
|
|
134
|
+
* @returns Map from codecId to normalized renderer
|
|
135
|
+
*/
|
|
136
|
+
export function extractParameterizedRenderers(
|
|
137
|
+
descriptors: ReadonlyArray<
|
|
138
|
+
| ControlTargetDescriptor<'sql', string>
|
|
139
|
+
| ControlAdapterDescriptor<'sql', string>
|
|
140
|
+
| ControlExtensionDescriptor<'sql', string>
|
|
141
|
+
>,
|
|
142
|
+
): Map<string, NormalizedTypeRenderer> {
|
|
143
|
+
const renderers = new Map<string, NormalizedTypeRenderer>();
|
|
144
|
+
const owners = new Map<string, string>(); // codecId -> descriptor.id for error messages
|
|
145
|
+
|
|
146
|
+
for (const descriptor of descriptors) {
|
|
147
|
+
const codecTypes = descriptor.types?.codecTypes;
|
|
148
|
+
if (!codecTypes?.parameterized) continue;
|
|
149
|
+
|
|
150
|
+
const parameterized: Record<string, TypeRenderer> = codecTypes.parameterized;
|
|
151
|
+
for (const [codecId, renderer] of Object.entries(parameterized)) {
|
|
152
|
+
const existingOwner = owners.get(codecId);
|
|
153
|
+
if (existingOwner !== undefined) {
|
|
154
|
+
throw new Error(
|
|
155
|
+
`Duplicate parameterized renderer for codecId "${codecId}". ` +
|
|
156
|
+
`Descriptor "${descriptor.id}" conflicts with "${existingOwner}". ` +
|
|
157
|
+
'Each codecId can only have one renderer.',
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
renderers.set(codecId, normalizeRenderer(codecId, renderer));
|
|
162
|
+
owners.set(codecId, descriptor.id);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
return renderers;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Extracts parameterized type imports from descriptors for contract.d.ts generation.
|
|
171
|
+
* These are type imports needed by parameterized codec renderers.
|
|
172
|
+
*
|
|
173
|
+
* @returns Array of type import specs (may contain duplicates; caller should deduplicate)
|
|
174
|
+
*/
|
|
175
|
+
export function extractParameterizedTypeImports(
|
|
176
|
+
descriptors: ReadonlyArray<
|
|
177
|
+
| ControlTargetDescriptor<'sql', string>
|
|
178
|
+
| ControlAdapterDescriptor<'sql', string>
|
|
179
|
+
| ControlExtensionDescriptor<'sql', string>
|
|
180
|
+
>,
|
|
181
|
+
): ReadonlyArray<TypesImportSpec> {
|
|
182
|
+
const imports: TypesImportSpec[] = [];
|
|
183
|
+
|
|
184
|
+
for (const descriptor of descriptors) {
|
|
185
|
+
const typeImports = descriptor.types?.codecTypes?.typeImports;
|
|
186
|
+
if (typeImports) {
|
|
187
|
+
imports.push(...typeImports);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
return imports;
|
|
192
|
+
}
|
package/src/core/instance.ts
CHANGED
|
@@ -33,6 +33,8 @@ import {
|
|
|
33
33
|
extractCodecTypeImports,
|
|
34
34
|
extractExtensionIds,
|
|
35
35
|
extractOperationTypeImports,
|
|
36
|
+
extractParameterizedRenderers,
|
|
37
|
+
extractParameterizedTypeImports,
|
|
36
38
|
} from './assembly';
|
|
37
39
|
import type { SqlControlAdapter } from './control-adapter';
|
|
38
40
|
import { verifySqlSchema } from './schema-verify/verify-sql-schema';
|
|
@@ -404,11 +406,13 @@ export function createSqlFamilyInstance<TTargetId extends string>(
|
|
|
404
406
|
// Assembly functions only use manifest and id, so we can pass Control*Descriptor types directly
|
|
405
407
|
const descriptors = [target, adapter, ...extensions];
|
|
406
408
|
|
|
407
|
-
// Assemble operation registry, type imports, and
|
|
409
|
+
// Assemble operation registry, type imports, extension IDs, and parameterized renderers
|
|
408
410
|
const operationRegistry = assembleOperationRegistry(descriptors, convertOperationManifest);
|
|
409
411
|
const codecTypeImports = extractCodecTypeImports(descriptors);
|
|
410
412
|
const operationTypeImports = extractOperationTypeImports(descriptors);
|
|
411
413
|
const extensionIds = extractExtensionIds(adapter, target, extensions);
|
|
414
|
+
const parameterizedRenderers = extractParameterizedRenderers(descriptors);
|
|
415
|
+
const parameterizedTypeImports = extractParameterizedTypeImports(descriptors);
|
|
412
416
|
|
|
413
417
|
// Build type metadata registry from manifests
|
|
414
418
|
const typeMetadataRegistry = buildSqlTypeMetadataRegistry({
|
|
@@ -888,6 +892,8 @@ export function createSqlFamilyInstance<TTargetId extends string>(
|
|
|
888
892
|
codecTypeImports,
|
|
889
893
|
operationTypeImports,
|
|
890
894
|
extensionIds,
|
|
895
|
+
parameterizedRenderers,
|
|
896
|
+
parameterizedTypeImports,
|
|
891
897
|
},
|
|
892
898
|
sqlTargetFamilyHook,
|
|
893
899
|
);
|