@prisma-next/sql-contract-ts 0.3.0-dev.5 → 0.3.0-dev.50

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/README.md CHANGED
@@ -10,21 +10,21 @@ This package contains the SQL-specific TypeScript contract authoring surface for
10
10
  - **Layer**: authoring
11
11
  - **Plane**: migration
12
12
 
13
- **Note**: SQL authoring may depend on SQL targets layer (e.g., `@prisma-next/sql-contract-types`) within the same domain.
13
+ **Note**: SQL authoring may depend on SQL core layer (e.g., `@prisma-next/sql-contract/types`) within the same domain.
14
14
 
15
15
  ## Overview
16
16
 
17
17
  This package is part of the SQL family namespace (`packages/2-sql/2-authoring/contract-ts`) and provides:
18
18
  - SQL contract builder (`defineContract`) - TypeScript builder for creating SQL contracts programmatically
19
- - SQL contract validation (`validateContract`) - Structural and logical validation for SQL contracts
20
19
  - SQL contract JSON schema - JSON schema for validating contract structure
21
20
 
22
21
  ## Responsibilities
23
22
 
24
23
  - **SQL Contract Builder**: Provides the `defineContract()` builder API for creating SQL contracts programmatically with type safety, including pack-ref based `.target()` and `.extensionPacks()` helpers
25
- - **SQL Contract Validation**: Implements SQL-specific contract validation (`validateContractStructure`, `validateContractLogic`, `validateContract`) and normalization
24
+ - **Storage Type Authoring**: Supports `storage.types` declarations and `typeRef` columns via the SQL builder
26
25
  - **SQL Contract JSON Schema**: Provides JSON schema for validating contract structure in IDEs and tooling
27
26
  - **Composition Layer**: Composes the target-agnostic builder core from `@prisma-next/contract-authoring` with SQL-specific types and validation logic
27
+ - **Generated Defaults**: Supports client-generated defaults via `ColumnDefault.kind = 'generated'` in contract authoring
28
28
 
29
29
  ## Package Status
30
30
 
@@ -34,9 +34,16 @@ This package was created in Phase 1 and refactored in Phase 2. It now composes t
34
34
 
35
35
  - **Composes generic core**: Uses `@prisma-next/contract-authoring` for generic builder state management (`TableBuilder`, `ModelBuilder`, `ContractBuilder` base class)
36
36
  - **SQL-specific types**: Provides SQL-specific contract types (`SqlContract`, `SqlStorage`, `SqlMappings`) from `@prisma-next/sql-contract/types`
37
- - **SQL-specific validation**: Implements SQL-specific contract validation (`validateContractStructure`, `validateContractLogic`, `validateContract`) and normalization (`normalizeContract`)
38
37
  - **SQL-specific build()**: Implements SQL-specific `build()` method in `SqlContractBuilder` that constructs `SqlContract` instances with SQL-specific structure (uniques, indexes, foreignKeys arrays)
39
38
 
39
+ ```mermaid
40
+ flowchart LR
41
+ builderInput[TS builder calls] --> sqlContractTs[@prisma-next/sql-contract-ts]
42
+ sqlContractTs --> authoringCore[@prisma-next/contract-authoring]
43
+ sqlContractTs --> sqlTypes[@prisma-next/sql-contract/types]
44
+ sqlContractTs --> contractIR[SQL ContractIR]
45
+ ```
46
+
40
47
  This package is part of the package layering architecture:
41
48
  - **Location**: `packages/2-sql/2-authoring/contract-ts` (SQL family namespace)
42
49
  - **Ring**: SQL family namespace (can import from core, authoring, targets, and other SQL family packages)
@@ -44,7 +51,7 @@ This package is part of the package layering architecture:
44
51
  ## Exports
45
52
 
46
53
  - `./contract-builder` - Contract builder API (`defineContract`, `ColumnBuilder`)
47
- - `./contract` - Contract validation (`validateContract`, `computeMappings`)
54
+ - `./config-types` - TypeScript contract config helper (`typescriptContract`)
48
55
  - `./schema-sql` - SQL contract JSON schema (`data-contract-sql-v1.json`)
49
56
 
50
57
  ## Usage
@@ -56,39 +63,96 @@ import { defineContract } from '@prisma-next/sql-contract-ts/contract-builder';
56
63
  import type { CodecTypes } from '@prisma-next/adapter-postgres/codec-types';
57
64
  import postgresPack from '@prisma-next/target-postgres/pack';
58
65
  import pgvector from '@prisma-next/extension-pgvector/pack';
59
- import { int4Column, textColumn } from '@prisma-next/adapter-postgres/column-types';
66
+ import { enumColumn, enumType, int4Column, textColumn } from '@prisma-next/adapter-postgres/column-types';
60
67
 
61
68
  const contract = defineContract<CodecTypes>()
62
69
  .target(postgresPack)
63
70
  .extensionPacks({ pgvector })
71
+ .storageType('Role', enumType('role', ['USER', 'ADMIN']))
64
72
  .table('user', (t) =>
65
73
  t
66
74
  .column('id', { type: int4Column, nullable: false })
67
75
  .column('email', { type: textColumn, nullable: false })
68
- .primaryKey(['id']),
76
+ .column('role', { type: enumColumn('Role', 'role') })
77
+ .primaryKey(['id'], 'user_pkey') // Named primary key
78
+ .unique(['email'], 'user_email_unique') // Named unique constraint
79
+ .index(['email'], 'user_email_idx'), // Named index
80
+ )
81
+ .table('post', (t) =>
82
+ t
83
+ .column('id', { type: int4Column, nullable: false })
84
+ .column('userId', { type: int4Column, nullable: false })
85
+ .column('title', { type: textColumn, nullable: false })
86
+ .primaryKey(['id'])
87
+ .foreignKey(['userId'], { table: 'user', columns: ['id'] }, 'post_userId_fkey'), // Named FK
69
88
  )
70
89
  .model('User', 'user', (m) => m.field('id', 'id').field('email', 'email'))
90
+ .model('Post', 'post', (m) => m.field('id', 'id').field('userId', 'userId').field('title', 'title'))
91
+ .foreignKeys({ constraints: true, indexes: false }) // Optional FK config
71
92
  .build();
72
93
  ```
73
94
 
95
+ #### Table Builder Methods
96
+
97
+ The table builder supports the following constraint methods:
98
+
99
+ | Method | Description |
100
+ |--------|-------------|
101
+ | `.primaryKey(columns, name?)` | Define primary key with optional name |
102
+ | `.unique(columns, name?)` | Add unique constraint with optional name |
103
+ | `.index(columns, name?)` | Add index with optional name |
104
+ | `.foreignKey(columns, references, name?)` | Add foreign key with optional name |
105
+
106
+ #### Contract-Level Foreign Key Configuration
107
+
108
+ The builder supports a `.foreignKeys()` method to control FK constraint and index emission:
109
+
110
+ ```typescript
111
+ const contract = defineContract<CodecTypes>()
112
+ .target(postgresPack)
113
+ // ...tables and models...
114
+ .foreignKeys({ constraints: true, indexes: false }) // Emit FK constraints but skip backing indexes
115
+ .build();
116
+ ```
117
+
118
+ | Config | Default | Description |
119
+ |--------|---------|-------------|
120
+ | `constraints` | `true` | Emit `FOREIGN KEY` constraints in DDL |
121
+ | `indexes` | `true` | Emit FK-backing indexes (e.g., `CREATE INDEX ... ON post (user_id)`) |
122
+
123
+ When `.foreignKeys()` is not called, defaults to `{ constraints: true, indexes: true }`. See [ADR 161](../../../docs/architecture%20docs/adrs/ADR%20161%20-%20Explicit%20foreign%20key%20constraint%20and%20index%20configuration.md).
124
+
74
125
  ### Validating Contracts
75
126
 
127
+ Contract JSON validation now lives in `@prisma-next/sql-contract/validate` (shared plane), while this package focuses on authoring/building contracts.
128
+
76
129
  ```typescript
77
- import { validateContract } from '@prisma-next/sql-contract-ts/contract';
78
- import type { SqlContract, SqlStorage } from '@prisma-next/sql-contract/types';
130
+ import { validateContract } from '@prisma-next/sql-contract/validate';
79
131
  import type { Contract } from './contract.d';
80
132
 
81
- // From JSON import
82
133
  const contract = validateContract<Contract>(contractJson);
134
+ ```
135
+
136
+ ### Config Helper
83
137
 
84
- // Or with generic type (less type-safe)
85
- const contract = validateContract<SqlContract<SqlStorage>>(contractJson);
138
+ Use `typescriptContract` from this package when wiring TS-authored contracts in `prisma-next.config.ts`.
139
+
140
+ ```typescript
141
+ import { defineConfig } from '@prisma-next/cli/config-types';
142
+ import { typescriptContract } from '@prisma-next/sql-contract-ts/config-types';
143
+ import { contract } from './src/prisma/contract';
144
+
145
+ export default defineConfig({
146
+ // ...
147
+ contract: typescriptContract(contract, 'src/prisma/contract.json'),
148
+ });
86
149
  ```
87
150
 
88
151
  ## Dependencies
89
152
 
90
153
  - **`@prisma-next/contract-authoring`** - Target-agnostic builder core (builder state types, builder classes, type helpers)
91
154
  - **`@prisma-next/contract`** - Core contract types (`ContractBase`)
155
+ - **`@prisma-next/core-control-plane`** - Contract config types used by `typescriptContract`
92
156
  - **`@prisma-next/sql-contract`** - SQL contract types (`SqlContract`, `SqlStorage`, `SqlMappings`)
93
157
  - **`arktype`** - Runtime validation
94
158
  - **`ts-toolbelt`** - Type utilities
@@ -106,4 +170,6 @@ Integration tests that depend on both `sql-contract-ts` and `sql-query` are loca
106
170
  ## See Also
107
171
 
108
172
  - `@prisma-next/contract-authoring` - Target-agnostic builder core that this package composes
173
+ - `@prisma-next/sql-contract-psl` - PSL parser-output to SQL `ContractIR` interpreter for provider-based flows
174
+ - `@prisma-next/sql-contract-psl/provider` - SQL PSL-first `prismaContract()` helper (read -> parse -> interpret)
109
175
 
@@ -0,0 +1,8 @@
1
+ import { ContractConfig, ContractConfig as ContractConfig$1 } from "@prisma-next/core-control-plane/config-types";
2
+ import { ContractIR } from "@prisma-next/contract/ir";
3
+
4
+ //#region src/config-types.d.ts
5
+ declare function typescriptContract(contractIR: ContractIR, output?: string): ContractConfig$1;
6
+ //#endregion
7
+ export { type ContractConfig, typescriptContract };
8
+ //# sourceMappingURL=config-types.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-types.d.mts","names":[],"sources":["../src/config-types.ts"],"sourcesContent":[],"mappings":";;;;iBAKgB,kBAAA,aAA+B,8BAA8B"}
@@ -0,0 +1,14 @@
1
+ import { ifDefined } from "@prisma-next/utils/defined";
2
+ import { ok } from "@prisma-next/utils/result";
3
+
4
+ //#region src/config-types.ts
5
+ function typescriptContract(contractIR, output) {
6
+ return {
7
+ source: async () => ok(contractIR),
8
+ ...ifDefined("output", output)
9
+ };
10
+ }
11
+
12
+ //#endregion
13
+ export { typescriptContract };
14
+ //# sourceMappingURL=config-types.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-types.mjs","names":[],"sources":["../src/config-types.ts"],"sourcesContent":["import type { ContractIR } from '@prisma-next/contract/ir';\nimport type { ContractConfig } from '@prisma-next/core-control-plane/config-types';\nimport { ifDefined } from '@prisma-next/utils/defined';\nimport { ok } from '@prisma-next/utils/result';\n\nexport function typescriptContract(contractIR: ContractIR, output?: string): ContractConfig {\n return {\n source: async () => ok(contractIR),\n ...ifDefined('output', output),\n };\n}\n"],"mappings":";;;;AAKA,SAAgB,mBAAmB,YAAwB,QAAiC;AAC1F,QAAO;EACL,QAAQ,YAAY,GAAG,WAAW;EAClC,GAAG,UAAU,UAAU,OAAO;EAC/B"}
@@ -0,0 +1,110 @@
1
+ import { BuildModels, BuildRelations, BuildStorageColumn, ColumnBuilderState, ContractBuilder, ContractBuilderState, ExtractColumns, ExtractPrimaryKey, ForeignKeyDefaultsState, ModelBuilder, ModelBuilderState, RelationDefinition, TableBuilder, TableBuilderState } from "@prisma-next/contract-authoring";
2
+ import { ReferentialAction, SqlContract, SqlMappings, StorageTypeInstance } from "@prisma-next/sql-contract/types";
3
+ import { ExtensionPackRef, TargetPackRef } from "@prisma-next/contract/framework-components";
4
+
5
+ //#region src/contract-builder.d.ts
6
+
7
+ /**
8
+ * Type-level mappings structure for contracts built via `defineContract()`.
9
+ *
10
+ * Compile-time type helper (not a runtime object) that ensures mappings match what the builder
11
+ * produces. `codecTypes` uses the generic `CodecTypes` parameter; `operationTypes` is always
12
+ * empty since operations are added via extensions at runtime.
13
+ *
14
+ * **Difference from ExecutionContext**: This is a compile-time type for contract construction.
15
+ * `ExecutionContext` is a runtime object with populated registries for query execution.
16
+ *
17
+ * @template C - The `CodecTypes` generic parameter passed to `defineContract<CodecTypes>()`
18
+ */
19
+ type ContractBuilderMappings<C extends Record<string, {
20
+ output: unknown;
21
+ }>> = Omit<SqlMappings, 'codecTypes' | 'operationTypes'> & {
22
+ readonly codecTypes: C;
23
+ readonly operationTypes: Record<string, never>;
24
+ };
25
+ type BuildStorageTable<_TableName extends string, Columns extends Record<string, ColumnBuilderState<string, boolean, string>>, PK extends readonly string[] | undefined> = {
26
+ readonly columns: { readonly [K in keyof Columns]: Columns[K] extends ColumnBuilderState<string, infer Null, infer TType> ? BuildStorageColumn<Null & boolean, TType> : never };
27
+ readonly uniques: ReadonlyArray<{
28
+ readonly columns: readonly string[];
29
+ readonly name?: string;
30
+ }>;
31
+ readonly indexes: ReadonlyArray<{
32
+ readonly columns: readonly string[];
33
+ readonly name?: string;
34
+ }>;
35
+ readonly foreignKeys: ReadonlyArray<{
36
+ readonly columns: readonly string[];
37
+ readonly references: {
38
+ readonly table: string;
39
+ readonly columns: readonly string[];
40
+ };
41
+ readonly name?: string;
42
+ readonly onDelete?: ReferentialAction;
43
+ readonly onUpdate?: ReferentialAction;
44
+ readonly constraint: boolean;
45
+ readonly index: boolean;
46
+ }>;
47
+ } & (PK extends readonly string[] ? {
48
+ readonly primaryKey: {
49
+ readonly columns: PK;
50
+ readonly name?: string;
51
+ };
52
+ } : Record<string, never>);
53
+ type BuildStorage<Tables extends Record<string, TableBuilderState<string, Record<string, ColumnBuilderState<string, boolean, string>>, readonly string[] | undefined>>, Types extends Record<string, StorageTypeInstance>> = {
54
+ readonly tables: { readonly [K in keyof Tables]: BuildStorageTable<K & string, ExtractColumns<Tables[K]>, ExtractPrimaryKey<Tables[K]>> };
55
+ readonly types: Types;
56
+ };
57
+ interface ColumnBuilder<Name extends string, Nullable extends boolean, Type extends string> {
58
+ nullable<Value extends boolean>(value?: Value): ColumnBuilder<Name, Value, Type>;
59
+ type<Id extends string>(id: Id): ColumnBuilder<Name, Nullable, Id>;
60
+ build(): ColumnBuilderState<Name, Nullable, Type>;
61
+ }
62
+ declare class SqlContractBuilder<CodecTypes extends Record<string, {
63
+ output: unknown;
64
+ }> = Record<string, never>, Target extends string | undefined = undefined, Tables extends Record<string, TableBuilderState<string, Record<string, ColumnBuilderState<string, boolean, string>>, readonly string[] | undefined>> = Record<never, never>, Models extends Record<string, ModelBuilderState<string, string, Record<string, string>, Record<string, RelationDefinition>>> = Record<never, never>, Types extends Record<string, StorageTypeInstance> = Record<never, never>, StorageHash extends string | undefined = undefined, ExtensionPacks extends Record<string, unknown> | undefined = undefined, Capabilities extends Record<string, Record<string, boolean>> | undefined = undefined> extends ContractBuilder<Target, Tables, Models, StorageHash, ExtensionPacks, Capabilities> {
65
+ protected readonly state: ContractBuilderState<Target, Tables, Models, StorageHash, ExtensionPacks, Capabilities> & {
66
+ readonly storageTypes?: Types;
67
+ };
68
+ /**
69
+ * This method is responsible for normalizing the contract IR by setting default values
70
+ * for all required fields:
71
+ * - `nullable`: defaults to `false` if not provided
72
+ * - `uniques`: defaults to `[]` (empty array)
73
+ * - `indexes`: defaults to `[]` (empty array)
74
+ * - `foreignKeys`: defaults to `[]` (empty array)
75
+ * - `relations`: defaults to `{}` (empty object) for both model-level and contract-level
76
+ * - `nativeType`: required field set from column type descriptor when columns are defined
77
+ *
78
+ * The contract builder is the **only** place where normalization should occur.
79
+ * Validators, parsers, and emitters should assume the contract is already normalized.
80
+ *
81
+ * **Required**: Use column type descriptors (e.g., `int4Column`, `textColumn`) when defining columns.
82
+ * This ensures `nativeType` is set correctly at build time.
83
+ *
84
+ * @returns A normalized SqlContract with all required fields present
85
+ */
86
+ build(): Target extends string ? SqlContract<BuildStorage<Tables, Types>, BuildModels<Models>, BuildRelations<Models>, ContractBuilderMappings<CodecTypes>> & {
87
+ readonly schemaVersion: '1';
88
+ readonly target: Target;
89
+ readonly targetFamily: 'sql';
90
+ readonly storageHash: StorageHash extends string ? StorageHash : string;
91
+ } & (ExtensionPacks extends Record<string, unknown> ? {
92
+ readonly extensionPacks: ExtensionPacks;
93
+ } : Record<string, never>) & (Capabilities extends Record<string, Record<string, boolean>> ? {
94
+ readonly capabilities: Capabilities;
95
+ } : Record<string, never>) : never;
96
+ target<T extends string>(packRef: TargetPackRef<'sql', T>): SqlContractBuilder<CodecTypes, T, Tables, Models, Types, StorageHash, ExtensionPacks, Capabilities>;
97
+ extensionPacks(packs: Record<string, ExtensionPackRef<'sql', string>>): SqlContractBuilder<CodecTypes, Target, Tables, Models, Types, StorageHash, ExtensionPacks, Capabilities>;
98
+ capabilities<C extends Record<string, Record<string, boolean>>>(capabilities: C): SqlContractBuilder<CodecTypes, Target, Tables, Models, Types, StorageHash, ExtensionPacks, C>;
99
+ storageHash<H extends string>(hash: H): SqlContractBuilder<CodecTypes, Target, Tables, Models, Types, H, ExtensionPacks, Capabilities>;
100
+ table<TableName extends string, T extends TableBuilder<TableName, Record<string, ColumnBuilderState<string, boolean, string>>, readonly string[] | undefined>>(name: TableName, callback: (t: TableBuilder<TableName>) => T | undefined): SqlContractBuilder<CodecTypes, Target, Tables & Record<TableName, ReturnType<T['build']>>, Models, Types, StorageHash, ExtensionPacks, Capabilities>;
101
+ model<ModelName extends string, TableName extends string, M extends ModelBuilder<ModelName, TableName, Record<string, string>, Record<string, RelationDefinition>>>(name: ModelName, table: TableName, callback: (m: ModelBuilder<ModelName, TableName, Record<string, string>, Record<never, never>>) => M | undefined): SqlContractBuilder<CodecTypes, Target, Tables, Models & Record<ModelName, ReturnType<M['build']>>, Types, StorageHash, ExtensionPacks, Capabilities>;
102
+ foreignKeyDefaults(config: ForeignKeyDefaultsState): SqlContractBuilder<CodecTypes, Target, Tables, Models, Types, StorageHash, ExtensionPacks, Capabilities>;
103
+ storageType<Name extends string, Type extends StorageTypeInstance>(name: Name, typeInstance: Type): SqlContractBuilder<CodecTypes, Target, Tables, Models, Types & Record<Name, Type>, StorageHash, ExtensionPacks, Capabilities>;
104
+ }
105
+ declare function defineContract<CodecTypes extends Record<string, {
106
+ output: unknown;
107
+ }> = Record<string, never>>(): SqlContractBuilder<CodecTypes>;
108
+ //#endregion
109
+ export { type ColumnBuilder, defineContract };
110
+ //# sourceMappingURL=contract-builder.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contract-builder.d.mts","names":[],"sources":["../src/contract-builder.ts"],"sourcesContent":[],"mappings":";;;;;;;;AA0NA;;;;;;;;;;KA3EK,uBA6E8B,CAAA,UA7EI,MA6EJ,CAAA,MAAA,EAAA;EACL,MAAA,EAAA,OAAA;CAAM,CAAA,CAAA,GA9E0C,IA8E1C,CA7ElC,WA6EkC,EAAA,YAAA,GAAA,gBAAA,CAAA,GAAA;EAAU,SAAA,UAAA,EA1EvB,CA0EuB;EAAnC,SAAA,cAAA,EAzEgB,MAyEhB,CAAA,MAAA,EAAA,KAAA,CAAA;CAAkB;AAC5B,KAvEI,iBAuHC,CAAA,mBAAkB,MAAA,EAAA,gBArHN,MAqHM,CAAA,MAAA,EArHS,kBAqHT,CAAA,MAAA,EAAA,OAAA,EAAA,MAAA,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