@prisma-next/family-sql 0.3.0-dev.2 → 0.3.0-dev.4
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/exports/control.d.ts +10 -100
- package/package.json +20 -21
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as _prisma_next_sql_contract_types from '@prisma-next/sql-contract/types';
|
|
2
|
+
import * as _prisma_next_contract_types from '@prisma-next/contract/types';
|
|
3
|
+
import * as _prisma_next_contract_ir from '@prisma-next/contract/ir';
|
|
2
4
|
import { ControlFamilyDescriptor, ControlAdapterDescriptor, ControlDriverDescriptor, ControlExtensionDescriptor, MigrationOperationPolicy } from '@prisma-next/core-control-plane/types';
|
|
3
5
|
export { MigrationOperationClass, MigrationOperationPolicy, MigrationPlan, MigrationPlanOperation, MigrationPlanner, MigrationPlannerConflict, MigrationPlannerResult, TargetMigrationsCapability } from '@prisma-next/core-control-plane/types';
|
|
4
6
|
import { SqlControlAdapter } from './control-adapter.js';
|
|
@@ -9,102 +11,10 @@ export { h as ComponentDatabaseDependencies, i as ComponentDatabaseDependency, j
|
|
|
9
11
|
import { NotOk, Ok } from '@prisma-next/utils/result';
|
|
10
12
|
import '@prisma-next/sql-schema-ir/types';
|
|
11
13
|
import '@prisma-next/contract/framework-components';
|
|
12
|
-
import '@prisma-next/contract/ir';
|
|
13
14
|
import '@prisma-next/contract/pack-manifest-types';
|
|
14
|
-
import '@prisma-next/contract/types';
|
|
15
15
|
import '@prisma-next/core-control-plane/schema-view';
|
|
16
|
+
import '@prisma-next/operations';
|
|
16
17
|
import '@prisma-next/sql-operations';
|
|
17
|
-
import '@prisma-next/sql-contract/types';
|
|
18
|
-
|
|
19
|
-
type StorageColumn = {
|
|
20
|
-
readonly nativeType: string;
|
|
21
|
-
readonly codecId: string;
|
|
22
|
-
readonly nullable: boolean;
|
|
23
|
-
};
|
|
24
|
-
type PrimaryKey = {
|
|
25
|
-
readonly columns: readonly string[];
|
|
26
|
-
readonly name?: string;
|
|
27
|
-
};
|
|
28
|
-
type UniqueConstraint = {
|
|
29
|
-
readonly columns: readonly string[];
|
|
30
|
-
readonly name?: string;
|
|
31
|
-
};
|
|
32
|
-
type Index = {
|
|
33
|
-
readonly columns: readonly string[];
|
|
34
|
-
readonly name?: string;
|
|
35
|
-
};
|
|
36
|
-
type ForeignKeyReferences = {
|
|
37
|
-
readonly table: string;
|
|
38
|
-
readonly columns: readonly string[];
|
|
39
|
-
};
|
|
40
|
-
type ForeignKey = {
|
|
41
|
-
readonly columns: readonly string[];
|
|
42
|
-
readonly references: ForeignKeyReferences;
|
|
43
|
-
readonly name?: string;
|
|
44
|
-
};
|
|
45
|
-
type StorageTable = {
|
|
46
|
-
readonly columns: Record<string, StorageColumn>;
|
|
47
|
-
readonly primaryKey?: PrimaryKey;
|
|
48
|
-
readonly uniques: ReadonlyArray<UniqueConstraint>;
|
|
49
|
-
readonly indexes: ReadonlyArray<Index>;
|
|
50
|
-
readonly foreignKeys: ReadonlyArray<ForeignKey>;
|
|
51
|
-
};
|
|
52
|
-
type SqlStorage = {
|
|
53
|
-
readonly tables: Record<string, StorageTable>;
|
|
54
|
-
};
|
|
55
|
-
type ModelField = {
|
|
56
|
-
readonly column: string;
|
|
57
|
-
};
|
|
58
|
-
type ModelStorage = {
|
|
59
|
-
readonly table: string;
|
|
60
|
-
};
|
|
61
|
-
type ModelDefinition = {
|
|
62
|
-
readonly storage: ModelStorage;
|
|
63
|
-
readonly fields: Record<string, ModelField>;
|
|
64
|
-
readonly relations: Record<string, unknown>;
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* ContractIR types and factories for building contract intermediate representation.
|
|
69
|
-
* ContractIR is family-agnostic and used by authoring, emitter, and no-emit runtime.
|
|
70
|
-
*/
|
|
71
|
-
/**
|
|
72
|
-
* ContractIR represents the intermediate representation of a contract.
|
|
73
|
-
* It is family-agnostic and contains generic storage, models, and relations.
|
|
74
|
-
* Note: coreHash and profileHash are computed by the emitter, not part of the IR.
|
|
75
|
-
*/
|
|
76
|
-
interface ContractIR<TStorage extends Record<string, unknown> = Record<string, unknown>, TModels extends Record<string, unknown> = Record<string, unknown>, TRelations extends Record<string, unknown> = Record<string, unknown>> {
|
|
77
|
-
readonly schemaVersion: string;
|
|
78
|
-
readonly targetFamily: string;
|
|
79
|
-
readonly target: string;
|
|
80
|
-
readonly models: TModels;
|
|
81
|
-
readonly relations: TRelations;
|
|
82
|
-
readonly storage: TStorage;
|
|
83
|
-
readonly extensionPacks: Record<string, unknown>;
|
|
84
|
-
readonly capabilities: Record<string, Record<string, boolean>>;
|
|
85
|
-
readonly meta: Record<string, unknown>;
|
|
86
|
-
readonly sources: Record<string, unknown>;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Specifies how to import TypeScript types from a package.
|
|
91
|
-
* Used in extension pack manifests to declare codec and operation type imports.
|
|
92
|
-
*/
|
|
93
|
-
interface TypesImportSpec {
|
|
94
|
-
readonly package: string;
|
|
95
|
-
readonly named: string;
|
|
96
|
-
readonly alias: string;
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Validation context passed to TargetFamilyHook.validateTypes().
|
|
100
|
-
* Contains pre-assembled operation registry, type imports, and extension IDs.
|
|
101
|
-
*/
|
|
102
|
-
interface ValidationContext {
|
|
103
|
-
readonly operationRegistry?: OperationRegistry;
|
|
104
|
-
readonly codecTypeImports?: ReadonlyArray<TypesImportSpec>;
|
|
105
|
-
readonly operationTypeImports?: ReadonlyArray<TypesImportSpec>;
|
|
106
|
-
readonly extensionIds?: ReadonlyArray<string>;
|
|
107
|
-
}
|
|
108
18
|
|
|
109
19
|
/**
|
|
110
20
|
* SQL family descriptor implementation.
|
|
@@ -117,13 +27,13 @@ declare class SqlFamilyDescriptor implements ControlFamilyDescriptor<'sql', SqlC
|
|
|
117
27
|
readonly version = "0.0.1";
|
|
118
28
|
readonly hook: {
|
|
119
29
|
readonly id: "sql";
|
|
120
|
-
readonly validateTypes: (ir: ContractIR, _ctx: ValidationContext) => void;
|
|
121
|
-
readonly validateStructure: (ir: ContractIR) => void;
|
|
122
|
-
readonly generateContractTypes: (ir: ContractIR, codecTypeImports: ReadonlyArray<TypesImportSpec>, operationTypeImports: ReadonlyArray<TypesImportSpec>) => string;
|
|
123
|
-
readonly generateStorageType: (storage: SqlStorage) => string;
|
|
124
|
-
readonly generateModelsType: (models: Record<string, ModelDefinition> | undefined, storage: SqlStorage) => string;
|
|
30
|
+
readonly validateTypes: (ir: _prisma_next_contract_ir.ContractIR, _ctx: _prisma_next_contract_types.ValidationContext) => void;
|
|
31
|
+
readonly validateStructure: (ir: _prisma_next_contract_ir.ContractIR) => void;
|
|
32
|
+
readonly generateContractTypes: (ir: _prisma_next_contract_ir.ContractIR, codecTypeImports: ReadonlyArray<_prisma_next_contract_types.TypesImportSpec>, operationTypeImports: ReadonlyArray<_prisma_next_contract_types.TypesImportSpec>) => string;
|
|
33
|
+
readonly generateStorageType: (storage: _prisma_next_sql_contract_types.SqlStorage) => string;
|
|
34
|
+
readonly generateModelsType: (models: Record<string, _prisma_next_sql_contract_types.ModelDefinition> | undefined, storage: _prisma_next_sql_contract_types.SqlStorage) => string;
|
|
125
35
|
readonly generateRelationsType: (relations: Record<string, unknown> | undefined) => string;
|
|
126
|
-
readonly generateMappingsType: (models: Record<string, ModelDefinition> | undefined, storage: SqlStorage, codecTypes: string, operationTypes: string) => string;
|
|
36
|
+
readonly generateMappingsType: (models: Record<string, _prisma_next_sql_contract_types.ModelDefinition> | undefined, storage: _prisma_next_sql_contract_types.SqlStorage, codecTypes: string, operationTypes: string) => string;
|
|
127
37
|
};
|
|
128
38
|
create<TTargetId extends string, TTargetDetails>(options: {
|
|
129
39
|
readonly target: SqlControlTargetDescriptor<TTargetId, TTargetDetails>;
|
package/package.json
CHANGED
|
@@ -1,33 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma-next/family-sql",
|
|
3
|
-
"version": "0.3.0-dev.
|
|
3
|
+
"version": "0.3.0-dev.4",
|
|
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/
|
|
10
|
-
"@prisma-next/
|
|
11
|
-
"@prisma-next/
|
|
12
|
-
"@prisma-next/
|
|
13
|
-
"@prisma-next/
|
|
14
|
-
"@prisma-next/
|
|
15
|
-
"@prisma-next/sql-contract": "0.3.0-dev.
|
|
16
|
-
"@prisma-next/sql-
|
|
17
|
-
"@prisma-next/sql-
|
|
18
|
-
"@prisma-next/sql-
|
|
19
|
-
"@prisma-next/sql-
|
|
20
|
-
"@prisma-next/
|
|
21
|
-
"@prisma-next/
|
|
22
|
-
"@prisma-next/
|
|
9
|
+
"@prisma-next/cli": "0.3.0-dev.4",
|
|
10
|
+
"@prisma-next/contract": "0.3.0-dev.4",
|
|
11
|
+
"@prisma-next/core-control-plane": "0.3.0-dev.4",
|
|
12
|
+
"@prisma-next/core-execution-plane": "0.3.0-dev.4",
|
|
13
|
+
"@prisma-next/operations": "0.3.0-dev.4",
|
|
14
|
+
"@prisma-next/runtime-executor": "0.3.0-dev.4",
|
|
15
|
+
"@prisma-next/sql-contract": "0.3.0-dev.4",
|
|
16
|
+
"@prisma-next/sql-contract-emitter": "0.3.0-dev.4",
|
|
17
|
+
"@prisma-next/sql-contract-ts": "0.3.0-dev.4",
|
|
18
|
+
"@prisma-next/sql-operations": "0.3.0-dev.4",
|
|
19
|
+
"@prisma-next/sql-relational-core": "0.3.0-dev.4",
|
|
20
|
+
"@prisma-next/sql-runtime": "0.3.0-dev.4",
|
|
21
|
+
"@prisma-next/sql-schema-ir": "0.3.0-dev.4",
|
|
22
|
+
"@prisma-next/utils": "0.3.0-dev.4"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@vitest/coverage-v8": "
|
|
26
|
-
"tsup": "
|
|
27
|
-
"typescript": "
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"@prisma-next/driver-postgres": "0.3.0-dev.2",
|
|
25
|
+
"@vitest/coverage-v8": "4.0.16",
|
|
26
|
+
"tsup": "8.5.1",
|
|
27
|
+
"typescript": "5.9.3",
|
|
28
|
+
"vitest": "4.0.16",
|
|
29
|
+
"@prisma-next/driver-postgres": "0.3.0-dev.4",
|
|
31
30
|
"@prisma-next/test-utils": "0.0.1"
|
|
32
31
|
},
|
|
33
32
|
"files": [
|