@prisma-next/family-sql 0.14.0 → 0.15.0-dev.1
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/{authoring-type-constructors-CjFfO6LM.mjs → authoring-type-constructors-CXd-8ydc.mjs} +7 -30
- package/dist/authoring-type-constructors-CXd-8ydc.mjs.map +1 -0
- package/dist/{control-adapter-Cmw9LvEP.d.mts → control-adapter-BQgad8Zc.d.mts} +30 -8
- package/dist/control-adapter-BQgad8Zc.d.mts.map +1 -0
- package/dist/control-adapter.d.mts +1 -1
- package/dist/control.d.mts +279 -34
- package/dist/control.d.mts.map +1 -1
- package/dist/control.mjs +364 -1005
- package/dist/control.mjs.map +1 -1
- package/dist/diff.d.mts +102 -0
- package/dist/diff.d.mts.map +1 -0
- package/dist/diff.mjs +14 -0
- package/dist/diff.mjs.map +1 -0
- package/dist/ir.d.mts +26 -9
- package/dist/ir.d.mts.map +1 -1
- package/dist/ir.mjs +2 -2
- package/dist/ir.mjs.map +1 -1
- package/dist/migration.d.mts +11 -2
- package/dist/migration.d.mts.map +1 -1
- package/dist/migration.mjs +7 -0
- package/dist/migration.mjs.map +1 -1
- package/dist/pack.mjs +1 -1
- package/dist/psl-infer.d.mts +119 -0
- package/dist/psl-infer.d.mts.map +1 -0
- package/dist/psl-infer.mjs +366 -0
- package/dist/psl-infer.mjs.map +1 -0
- package/dist/schema-differ-DnoopSXm.d.mts +45 -0
- package/dist/schema-differ-DnoopSXm.d.mts.map +1 -0
- package/dist/schema-verify-W3r631Jh.mjs +226 -0
- package/dist/schema-verify-W3r631Jh.mjs.map +1 -0
- package/dist/{sql-contract-serializer-BR2vC7Z-.mjs → sql-contract-serializer-C75cfMSS.mjs} +46 -20
- package/dist/sql-contract-serializer-C75cfMSS.mjs.map +1 -0
- package/dist/{types-kgstZ_Zd.d.mts → types-BPv_y7iS.d.mts} +36 -142
- package/dist/types-BPv_y7iS.d.mts.map +1 -0
- package/package.json +26 -26
- package/src/core/authoring-entity-types.ts +12 -37
- package/src/core/control-adapter.ts +11 -5
- package/src/core/control-instance.ts +212 -42
- package/src/core/control-target-descriptor.ts +98 -0
- package/src/core/diff/schema-verify.ts +324 -0
- package/src/core/diff/sql-schema-diff.ts +41 -0
- package/src/core/diff/verifier-disposition.ts +30 -0
- package/src/core/ir/sql-contract-serializer-base.ts +70 -56
- package/src/core/ir/sql-contract-serializer.ts +5 -7
- package/src/core/ir/sql-schema-verifier-base.ts +5 -5
- package/src/core/migrations/contract-to-schema-ir.ts +137 -51
- package/src/core/migrations/control-policy.ts +66 -115
- package/src/core/migrations/field-event-planner.ts +2 -2
- package/src/core/migrations/native-type-expander.ts +28 -0
- package/src/core/migrations/schema-differ.ts +41 -0
- package/src/core/migrations/types.ts +33 -37
- package/src/core/psl-contract-infer/name-transforms.ts +15 -0
- package/src/core/psl-contract-infer/printer-config.ts +14 -6
- package/src/core/psl-contract-infer/relation-inference.ts +30 -1
- package/src/core/sql-migration.ts +12 -1
- package/src/exports/control.ts +12 -2
- package/src/exports/diff.ts +25 -0
- package/src/exports/psl-infer.ts +40 -0
- package/dist/authoring-type-constructors-CjFfO6LM.mjs.map +0 -1
- package/dist/control-adapter-Cmw9LvEP.d.mts.map +0 -1
- package/dist/schema-verify.d.mts +0 -39
- package/dist/schema-verify.d.mts.map +0 -1
- package/dist/schema-verify.mjs +0 -2
- package/dist/sql-contract-serializer-BR2vC7Z-.mjs.map +0 -1
- package/dist/test-utils.d.mts +0 -2
- package/dist/test-utils.mjs +0 -2
- package/dist/types-kgstZ_Zd.d.mts.map +0 -1
- package/dist/verify-sql-schema-thU-jKpf.d.mts +0 -66
- package/dist/verify-sql-schema-thU-jKpf.d.mts.map +0 -1
- package/dist/verify-sql-schema-xT4udQLQ.mjs +0 -1501
- package/dist/verify-sql-schema-xT4udQLQ.mjs.map +0 -1
- package/src/core/psl-contract-infer/postgres-default-mapping.ts +0 -16
- package/src/core/psl-contract-infer/postgres-type-map.ts +0 -157
- package/src/core/psl-contract-infer/sql-schema-ir-to-psl-ast.ts +0 -795
- package/src/core/schema-verify/control-verify-emit.ts +0 -46
- package/src/core/schema-verify/verifier-disposition.ts +0 -58
- package/src/core/schema-verify/verify-helpers.ts +0 -820
- package/src/core/schema-verify/verify-sql-schema.ts +0 -1311
- package/src/exports/schema-verify.ts +0 -18
- package/src/exports/test-utils.ts +0 -9
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { OperationContext, VerifyDatabaseSchemaResult } from "@prisma-next/framework-components/control";
|
|
2
|
-
import { SqlStorage } from "@prisma-next/sql-contract/types";
|
|
3
|
-
import { ColumnDefault, Contract } from "@prisma-next/contract/types";
|
|
4
|
-
import { SqlSchemaIR } from "@prisma-next/sql-schema-ir/types";
|
|
5
|
-
import { TargetBoundComponentDescriptor } from "@prisma-next/framework-components/components";
|
|
6
|
-
|
|
7
|
-
//#region src/core/schema-verify/verify-sql-schema.d.ts
|
|
8
|
-
/**
|
|
9
|
-
* Function type for normalizing raw database default expressions into ColumnDefault.
|
|
10
|
-
* Target-specific implementations handle database dialect differences.
|
|
11
|
-
*/
|
|
12
|
-
type DefaultNormalizer = (rawDefault: string, nativeType: string) => ColumnDefault | undefined;
|
|
13
|
-
/**
|
|
14
|
-
* Function type for normalizing schema native types to canonical form for comparison.
|
|
15
|
-
* Target-specific implementations handle dialect-specific type name variations
|
|
16
|
-
* (e.g., Postgres 'varchar' → 'character varying', 'timestamptz' normalization).
|
|
17
|
-
*/
|
|
18
|
-
type NativeTypeNormalizer = (nativeType: string) => string;
|
|
19
|
-
/**
|
|
20
|
-
* Options for the pure schema verification function.
|
|
21
|
-
*/
|
|
22
|
-
interface VerifySqlSchemaOptions {
|
|
23
|
-
/** The validated SQL contract to verify against */
|
|
24
|
-
readonly contract: Contract<SqlStorage>;
|
|
25
|
-
/** The schema IR from introspection (or another source) */
|
|
26
|
-
readonly schema: SqlSchemaIR;
|
|
27
|
-
/** Whether to run in strict mode (detects extra tables/columns) */
|
|
28
|
-
readonly strict: boolean;
|
|
29
|
-
/** Optional operation context for metadata */
|
|
30
|
-
readonly context?: OperationContext;
|
|
31
|
-
/** Type metadata registry for codec consistency warnings */
|
|
32
|
-
readonly typeMetadataRegistry: ReadonlyMap<string, {
|
|
33
|
-
nativeType?: string;
|
|
34
|
-
}>;
|
|
35
|
-
/**
|
|
36
|
-
* Active framework components participating in this composition.
|
|
37
|
-
* All components must have matching familyId ('sql') and targetId.
|
|
38
|
-
*/
|
|
39
|
-
readonly frameworkComponents: ReadonlyArray<TargetBoundComponentDescriptor<'sql', string>>;
|
|
40
|
-
/**
|
|
41
|
-
* Optional target-specific normalizer for raw database default expressions.
|
|
42
|
-
* When provided, schema defaults (raw strings) are normalized before comparison
|
|
43
|
-
* with contract defaults (ColumnDefault objects).
|
|
44
|
-
*/
|
|
45
|
-
readonly normalizeDefault?: DefaultNormalizer;
|
|
46
|
-
/**
|
|
47
|
-
* Optional target-specific normalizer for schema native type names.
|
|
48
|
-
* When provided, schema native types are normalized before comparison
|
|
49
|
-
* with contract native types (e.g., Postgres 'varchar' → 'character varying').
|
|
50
|
-
*/
|
|
51
|
-
readonly normalizeNativeType?: NativeTypeNormalizer;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Verifies that a SqlSchemaIR matches a Contract.
|
|
55
|
-
*
|
|
56
|
-
* This is a pure function that does NOT perform any database I/O.
|
|
57
|
-
* It takes an already-introspected schema IR and compares it against
|
|
58
|
-
* the contract requirements.
|
|
59
|
-
*
|
|
60
|
-
* @param options - Verification options
|
|
61
|
-
* @returns VerifyDatabaseSchemaResult with verification tree and issues
|
|
62
|
-
*/
|
|
63
|
-
declare function verifySqlSchema(options: VerifySqlSchemaOptions): VerifyDatabaseSchemaResult;
|
|
64
|
-
//#endregion
|
|
65
|
-
export { verifySqlSchema as i, NativeTypeNormalizer as n, VerifySqlSchemaOptions as r, DefaultNormalizer as t };
|
|
66
|
-
//# sourceMappingURL=verify-sql-schema-thU-jKpf.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"verify-sql-schema-thU-jKpf.d.mts","names":[],"sources":["../src/core/schema-verify/verify-sql-schema.ts"],"mappings":";;;;;;;;;;AAmDkB;KAHN,iBAAA,IACV,UAAA,UACA,UAAA,aACG,aAAa;;;;AAOoC;AAKtD;KALY,oBAAA,IAAwB,UAAkB;;;;UAKrC,sBAAA;EAQI;EAAA,SANV,QAAA,EAAU,QAAA,CAAS,UAAA;EAagB;EAAA,SAXnC,MAAA,EAAQ,WAAA;EAiBW;EAAA,SAfnB,MAAA;EAqB0C;EAAA,SAnB1C,OAAA,GAAU,gBAAA;EANV;EAAA,SAQA,oBAAA,EAAsB,WAAA;IAAsB,UAAA;EAAA;EANpC;;;;EAAA,SAWR,mBAAA,EAAqB,aAAA,CAAc,8BAAA;EALb;;;;;EAAA,SAWtB,gBAAA,GAAmB,iBAAA;EAAA;;;;AAMuB;EANvB,SAMnB,mBAAA,GAAsB,oBAAA;AAAA;;;;;;;AAa2D;;;;iBAA5E,eAAA,CAAgB,OAAA,EAAS,sBAAA,GAAyB,0BAA0B"}
|