@prisma-next/family-sql 0.3.0-pr.99.6 → 0.4.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/LICENSE +201 -0
- package/README.md +58 -22
- package/dist/authoring-type-constructors-DgU-RFaP.mjs +203 -0
- package/dist/authoring-type-constructors-DgU-RFaP.mjs.map +1 -0
- package/dist/control-adapter.d.mts +54 -0
- package/dist/control-adapter.d.mts.map +1 -0
- package/dist/control-adapter.mjs +1 -0
- package/dist/control.d.mts +386 -0
- package/dist/control.d.mts.map +1 -0
- package/dist/control.mjs +643 -0
- package/dist/control.mjs.map +1 -0
- package/dist/operation-descriptors.d.mts +380 -0
- package/dist/operation-descriptors.d.mts.map +1 -0
- package/dist/operation-descriptors.mjs +294 -0
- package/dist/operation-descriptors.mjs.map +1 -0
- package/dist/pack.d.mts +248 -0
- package/dist/pack.d.mts.map +1 -0
- package/dist/pack.mjs +18 -0
- package/dist/pack.mjs.map +1 -0
- package/dist/runtime.d.mts +27 -0
- package/dist/runtime.d.mts.map +1 -0
- package/dist/runtime.mjs +38 -0
- package/dist/runtime.mjs.map +1 -0
- package/dist/schema-verify.d.mts +48 -0
- package/dist/schema-verify.d.mts.map +1 -0
- package/dist/schema-verify.mjs +3 -0
- package/dist/test-utils.d.mts +2 -0
- package/dist/test-utils.mjs +3 -0
- package/dist/types-BaUzKt6Q.d.mts +353 -0
- package/dist/types-BaUzKt6Q.d.mts.map +1 -0
- package/dist/verify-DZHtfcmj.mjs +108 -0
- package/dist/verify-DZHtfcmj.mjs.map +1 -0
- package/dist/verify-sql-schema-BBhkqEDo.d.mts +67 -0
- package/dist/verify-sql-schema-BBhkqEDo.d.mts.map +1 -0
- package/dist/verify-sql-schema-lR-tlboL.mjs +1174 -0
- package/dist/verify-sql-schema-lR-tlboL.mjs.map +1 -0
- package/dist/verify.d.mts +31 -0
- package/dist/verify.d.mts.map +1 -0
- package/dist/verify.mjs +3 -0
- package/package.json +35 -43
- package/src/core/assembly.ts +123 -155
- package/src/core/authoring-field-presets.ts +207 -0
- package/src/core/authoring-type-constructors.ts +17 -0
- package/src/core/control-adapter.ts +18 -10
- package/src/core/control-descriptor.ts +28 -0
- package/src/core/control-instance.ts +700 -0
- package/src/core/migrations/contract-to-schema-ir.ts +269 -0
- package/src/core/migrations/descriptor-schemas.ts +172 -0
- package/src/core/migrations/operation-descriptors.ts +213 -0
- package/src/core/migrations/policies.ts +1 -1
- package/src/core/migrations/types.ts +199 -175
- package/src/core/runtime-descriptor.ts +19 -41
- package/src/core/runtime-instance.ts +11 -133
- package/src/core/schema-verify/verify-helpers.ts +104 -22
- package/src/core/schema-verify/verify-sql-schema.ts +964 -418
- package/src/core/verify.ts +4 -13
- package/src/exports/control.ts +31 -8
- package/src/exports/operation-descriptors.ts +52 -0
- package/src/exports/pack.ts +16 -0
- package/src/exports/runtime.ts +2 -6
- package/src/exports/schema-verify.ts +4 -1
- package/src/exports/test-utils.ts +3 -4
- package/dist/chunk-GYEG3I7U.js +0 -624
- package/dist/chunk-GYEG3I7U.js.map +0 -1
- package/dist/chunk-SU7LN2UH.js +0 -96
- package/dist/chunk-SU7LN2UH.js.map +0 -1
- package/dist/chunk-XH2Y5NTD.js +0 -715
- package/dist/chunk-XH2Y5NTD.js.map +0 -1
- package/dist/core/assembly.d.ts +0 -43
- package/dist/core/assembly.d.ts.map +0 -1
- package/dist/core/control-adapter.d.ts +0 -42
- package/dist/core/control-adapter.d.ts.map +0 -1
- package/dist/core/descriptor.d.ts +0 -28
- package/dist/core/descriptor.d.ts.map +0 -1
- package/dist/core/instance.d.ts +0 -140
- package/dist/core/instance.d.ts.map +0 -1
- package/dist/core/migrations/plan-helpers.d.ts +0 -20
- package/dist/core/migrations/plan-helpers.d.ts.map +0 -1
- package/dist/core/migrations/policies.d.ts +0 -6
- package/dist/core/migrations/policies.d.ts.map +0 -1
- package/dist/core/migrations/types.d.ts +0 -280
- package/dist/core/migrations/types.d.ts.map +0 -1
- package/dist/core/runtime-descriptor.d.ts +0 -19
- package/dist/core/runtime-descriptor.d.ts.map +0 -1
- package/dist/core/runtime-instance.d.ts +0 -54
- package/dist/core/runtime-instance.d.ts.map +0 -1
- package/dist/core/schema-verify/verify-helpers.d.ts +0 -96
- package/dist/core/schema-verify/verify-helpers.d.ts.map +0 -1
- package/dist/core/schema-verify/verify-sql-schema.d.ts +0 -45
- package/dist/core/schema-verify/verify-sql-schema.d.ts.map +0 -1
- package/dist/core/verify.d.ts +0 -39
- package/dist/core/verify.d.ts.map +0 -1
- package/dist/exports/control-adapter.d.ts +0 -2
- package/dist/exports/control-adapter.d.ts.map +0 -1
- package/dist/exports/control-adapter.js +0 -1
- package/dist/exports/control-adapter.js.map +0 -1
- package/dist/exports/control.d.ts +0 -13
- package/dist/exports/control.d.ts.map +0 -1
- package/dist/exports/control.js +0 -149
- package/dist/exports/control.js.map +0 -1
- package/dist/exports/runtime.d.ts +0 -8
- package/dist/exports/runtime.d.ts.map +0 -1
- package/dist/exports/runtime.js +0 -64
- package/dist/exports/runtime.js.map +0 -1
- package/dist/exports/schema-verify.d.ts +0 -11
- package/dist/exports/schema-verify.d.ts.map +0 -1
- package/dist/exports/schema-verify.js +0 -15
- package/dist/exports/schema-verify.js.map +0 -1
- package/dist/exports/test-utils.d.ts +0 -7
- package/dist/exports/test-utils.d.ts.map +0 -1
- package/dist/exports/test-utils.js +0 -17
- package/dist/exports/test-utils.js.map +0 -1
- package/dist/exports/verify.d.ts +0 -2
- package/dist/exports/verify.d.ts.map +0 -1
- package/dist/exports/verify.js +0 -11
- package/dist/exports/verify.js.map +0 -1
- package/src/core/descriptor.ts +0 -33
- package/src/core/instance.ts +0 -909
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
import { ifDefined } from "@prisma-next/utils/defined";
|
|
2
|
+
import { type } from "arktype";
|
|
3
|
+
|
|
4
|
+
//#region src/core/migrations/descriptor-schemas.ts
|
|
5
|
+
/**
|
|
6
|
+
* Arktype schemas for SQL migration operation descriptors.
|
|
7
|
+
*
|
|
8
|
+
* These schemas are the source of truth for descriptor shapes.
|
|
9
|
+
* TypeScript types are derived via `typeof schema.infer`.
|
|
10
|
+
*/
|
|
11
|
+
const CreateTableSchema = type({
|
|
12
|
+
kind: "'createTable'",
|
|
13
|
+
table: "string"
|
|
14
|
+
});
|
|
15
|
+
const DropTableSchema = type({
|
|
16
|
+
kind: "'dropTable'",
|
|
17
|
+
table: "string"
|
|
18
|
+
});
|
|
19
|
+
const AddColumnSchema = type({
|
|
20
|
+
kind: "'addColumn'",
|
|
21
|
+
table: "string",
|
|
22
|
+
column: "string",
|
|
23
|
+
"overrides?": { "nullable?": "boolean" }
|
|
24
|
+
});
|
|
25
|
+
const DropColumnSchema = type({
|
|
26
|
+
kind: "'dropColumn'",
|
|
27
|
+
table: "string",
|
|
28
|
+
column: "string"
|
|
29
|
+
});
|
|
30
|
+
const AlterColumnTypeSchema = type({
|
|
31
|
+
kind: "'alterColumnType'",
|
|
32
|
+
table: "string",
|
|
33
|
+
column: "string",
|
|
34
|
+
"using?": "string",
|
|
35
|
+
"toType?": "string"
|
|
36
|
+
});
|
|
37
|
+
const SetNotNullSchema = type({
|
|
38
|
+
kind: "'setNotNull'",
|
|
39
|
+
table: "string",
|
|
40
|
+
column: "string"
|
|
41
|
+
});
|
|
42
|
+
const DropNotNullSchema = type({
|
|
43
|
+
kind: "'dropNotNull'",
|
|
44
|
+
table: "string",
|
|
45
|
+
column: "string"
|
|
46
|
+
});
|
|
47
|
+
const SetDefaultSchema = type({
|
|
48
|
+
kind: "'setDefault'",
|
|
49
|
+
table: "string",
|
|
50
|
+
column: "string"
|
|
51
|
+
});
|
|
52
|
+
const DropDefaultSchema = type({
|
|
53
|
+
kind: "'dropDefault'",
|
|
54
|
+
table: "string",
|
|
55
|
+
column: "string"
|
|
56
|
+
});
|
|
57
|
+
const AddPrimaryKeySchema = type({
|
|
58
|
+
kind: "'addPrimaryKey'",
|
|
59
|
+
table: "string"
|
|
60
|
+
});
|
|
61
|
+
const AddUniqueSchema = type({
|
|
62
|
+
kind: "'addUnique'",
|
|
63
|
+
table: "string",
|
|
64
|
+
columns: "string[]"
|
|
65
|
+
});
|
|
66
|
+
const AddForeignKeySchema = type({
|
|
67
|
+
kind: "'addForeignKey'",
|
|
68
|
+
table: "string",
|
|
69
|
+
columns: "string[]"
|
|
70
|
+
});
|
|
71
|
+
const DropConstraintSchema = type({
|
|
72
|
+
kind: "'dropConstraint'",
|
|
73
|
+
table: "string",
|
|
74
|
+
constraintName: "string"
|
|
75
|
+
});
|
|
76
|
+
const CreateIndexSchema = type({
|
|
77
|
+
kind: "'createIndex'",
|
|
78
|
+
table: "string",
|
|
79
|
+
columns: "string[]"
|
|
80
|
+
});
|
|
81
|
+
const DropIndexSchema = type({
|
|
82
|
+
kind: "'dropIndex'",
|
|
83
|
+
table: "string",
|
|
84
|
+
indexName: "string"
|
|
85
|
+
});
|
|
86
|
+
const CreateEnumTypeSchema = type({
|
|
87
|
+
kind: "'createEnumType'",
|
|
88
|
+
typeName: "string",
|
|
89
|
+
"values?": "string[]"
|
|
90
|
+
});
|
|
91
|
+
const AddEnumValuesSchema = type({
|
|
92
|
+
kind: "'addEnumValues'",
|
|
93
|
+
typeName: "string",
|
|
94
|
+
values: "string[]"
|
|
95
|
+
});
|
|
96
|
+
const DropEnumTypeSchema = type({
|
|
97
|
+
kind: "'dropEnumType'",
|
|
98
|
+
typeName: "string"
|
|
99
|
+
});
|
|
100
|
+
const RenameTypeSchema = type({
|
|
101
|
+
kind: "'renameType'",
|
|
102
|
+
fromName: "string",
|
|
103
|
+
toName: "string"
|
|
104
|
+
});
|
|
105
|
+
const CreateDependencySchema = type({
|
|
106
|
+
kind: "'createDependency'",
|
|
107
|
+
dependencyId: "string"
|
|
108
|
+
});
|
|
109
|
+
const DataTransformSchema = type({
|
|
110
|
+
kind: "'dataTransform'",
|
|
111
|
+
name: "string",
|
|
112
|
+
source: "string",
|
|
113
|
+
check: "boolean | Function | symbol | object",
|
|
114
|
+
run: "(Function | symbol | object)[]"
|
|
115
|
+
});
|
|
116
|
+
const SqlMigrationOpDescriptorSchema = type.or(CreateTableSchema, DropTableSchema, AddColumnSchema, DropColumnSchema, AlterColumnTypeSchema, SetNotNullSchema, DropNotNullSchema, SetDefaultSchema, DropDefaultSchema, AddPrimaryKeySchema, AddUniqueSchema, AddForeignKeySchema, DropConstraintSchema, CreateIndexSchema, DropIndexSchema, CreateEnumTypeSchema, AddEnumValuesSchema, DropEnumTypeSchema, RenameTypeSchema, CreateDependencySchema, DataTransformSchema);
|
|
117
|
+
const MigrationDescriptorArraySchema = SqlMigrationOpDescriptorSchema.array();
|
|
118
|
+
|
|
119
|
+
//#endregion
|
|
120
|
+
//#region src/core/migrations/operation-descriptors.ts
|
|
121
|
+
/**
|
|
122
|
+
* Sentinel value for unimplemented data transform queries.
|
|
123
|
+
* The scaffold renders this as a TODO comment. The resolver throws if it encounters one.
|
|
124
|
+
*/
|
|
125
|
+
const TODO = Symbol.for("prisma-next.migration.todo");
|
|
126
|
+
function createTable(table) {
|
|
127
|
+
return {
|
|
128
|
+
kind: "createTable",
|
|
129
|
+
table
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
function dropTable(table) {
|
|
133
|
+
return {
|
|
134
|
+
kind: "dropTable",
|
|
135
|
+
table
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
function addColumn(table, column, overrides) {
|
|
139
|
+
return {
|
|
140
|
+
kind: "addColumn",
|
|
141
|
+
table,
|
|
142
|
+
column,
|
|
143
|
+
...ifDefined("overrides", overrides)
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
function dropColumn(table, column) {
|
|
147
|
+
return {
|
|
148
|
+
kind: "dropColumn",
|
|
149
|
+
table,
|
|
150
|
+
column
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
function alterColumnType(table, column, opts) {
|
|
154
|
+
const using = typeof opts === "string" ? opts : opts?.using;
|
|
155
|
+
const toType = typeof opts === "string" ? void 0 : opts?.toType;
|
|
156
|
+
return {
|
|
157
|
+
kind: "alterColumnType",
|
|
158
|
+
table,
|
|
159
|
+
column,
|
|
160
|
+
...ifDefined("using", using),
|
|
161
|
+
...ifDefined("toType", toType)
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
function setNotNull(table, column) {
|
|
165
|
+
return {
|
|
166
|
+
kind: "setNotNull",
|
|
167
|
+
table,
|
|
168
|
+
column
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
function dropNotNull(table, column) {
|
|
172
|
+
return {
|
|
173
|
+
kind: "dropNotNull",
|
|
174
|
+
table,
|
|
175
|
+
column
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
function setDefault(table, column) {
|
|
179
|
+
return {
|
|
180
|
+
kind: "setDefault",
|
|
181
|
+
table,
|
|
182
|
+
column
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
function dropDefault(table, column) {
|
|
186
|
+
return {
|
|
187
|
+
kind: "dropDefault",
|
|
188
|
+
table,
|
|
189
|
+
column
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
function addPrimaryKey(table) {
|
|
193
|
+
return {
|
|
194
|
+
kind: "addPrimaryKey",
|
|
195
|
+
table
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
function addUnique(table, columns) {
|
|
199
|
+
return {
|
|
200
|
+
kind: "addUnique",
|
|
201
|
+
table,
|
|
202
|
+
columns: [...columns]
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
function addForeignKey(table, columns) {
|
|
206
|
+
return {
|
|
207
|
+
kind: "addForeignKey",
|
|
208
|
+
table,
|
|
209
|
+
columns: [...columns]
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
function dropConstraint(table, constraintName) {
|
|
213
|
+
return {
|
|
214
|
+
kind: "dropConstraint",
|
|
215
|
+
table,
|
|
216
|
+
constraintName
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
function createIndex(table, columns) {
|
|
220
|
+
return {
|
|
221
|
+
kind: "createIndex",
|
|
222
|
+
table,
|
|
223
|
+
columns: [...columns]
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
function dropIndex(table, indexName) {
|
|
227
|
+
return {
|
|
228
|
+
kind: "dropIndex",
|
|
229
|
+
table,
|
|
230
|
+
indexName
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
function createEnumType(typeName, values) {
|
|
234
|
+
return {
|
|
235
|
+
kind: "createEnumType",
|
|
236
|
+
typeName,
|
|
237
|
+
...ifDefined("values", values ? [...values] : void 0)
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
function addEnumValues(typeName, values) {
|
|
241
|
+
return {
|
|
242
|
+
kind: "addEnumValues",
|
|
243
|
+
typeName,
|
|
244
|
+
values: [...values]
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
function dropEnumType(typeName) {
|
|
248
|
+
return {
|
|
249
|
+
kind: "dropEnumType",
|
|
250
|
+
typeName
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
function renameType(fromName, toName) {
|
|
254
|
+
return {
|
|
255
|
+
kind: "renameType",
|
|
256
|
+
fromName,
|
|
257
|
+
toName
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
function createDependency(dependencyId) {
|
|
261
|
+
return {
|
|
262
|
+
kind: "createDependency",
|
|
263
|
+
dependencyId
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* All structural builder functions keyed by descriptor kind.
|
|
268
|
+
*/
|
|
269
|
+
const builders = {
|
|
270
|
+
createTable,
|
|
271
|
+
dropTable,
|
|
272
|
+
addColumn,
|
|
273
|
+
dropColumn,
|
|
274
|
+
alterColumnType,
|
|
275
|
+
setNotNull,
|
|
276
|
+
dropNotNull,
|
|
277
|
+
setDefault,
|
|
278
|
+
dropDefault,
|
|
279
|
+
addPrimaryKey,
|
|
280
|
+
addUnique,
|
|
281
|
+
addForeignKey,
|
|
282
|
+
dropConstraint,
|
|
283
|
+
createIndex,
|
|
284
|
+
dropIndex,
|
|
285
|
+
createEnumType,
|
|
286
|
+
addEnumValues,
|
|
287
|
+
dropEnumType,
|
|
288
|
+
renameType,
|
|
289
|
+
createDependency
|
|
290
|
+
};
|
|
291
|
+
|
|
292
|
+
//#endregion
|
|
293
|
+
export { MigrationDescriptorArraySchema, TODO, addColumn, addEnumValues, addForeignKey, addPrimaryKey, addUnique, alterColumnType, builders, createDependency, createEnumType, createIndex, createTable, dropColumn, dropConstraint, dropDefault, dropEnumType, dropIndex, dropNotNull, dropTable, renameType, setDefault, setNotNull };
|
|
294
|
+
//# sourceMappingURL=operation-descriptors.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operation-descriptors.mjs","names":[],"sources":["../src/core/migrations/descriptor-schemas.ts","../src/core/migrations/operation-descriptors.ts"],"sourcesContent":["/**\n * Arktype schemas for SQL migration operation descriptors.\n *\n * These schemas are the source of truth for descriptor shapes.\n * TypeScript types are derived via `typeof schema.infer`.\n */\n\nimport { type } from 'arktype';\n\n// ============================================================================\n// Table descriptors\n// ============================================================================\n\nexport const CreateTableSchema = type({ kind: \"'createTable'\", table: 'string' });\nexport const DropTableSchema = type({ kind: \"'dropTable'\", table: 'string' });\n\n// ============================================================================\n// Column descriptors\n// ============================================================================\n\nexport const AddColumnSchema = type({\n kind: \"'addColumn'\",\n table: 'string',\n column: 'string',\n 'overrides?': { 'nullable?': 'boolean' },\n});\n\nexport const DropColumnSchema = type({ kind: \"'dropColumn'\", table: 'string', column: 'string' });\n\nexport const AlterColumnTypeSchema = type({\n kind: \"'alterColumnType'\",\n table: 'string',\n column: 'string',\n 'using?': 'string',\n 'toType?': 'string',\n});\n\nexport const SetNotNullSchema = type({ kind: \"'setNotNull'\", table: 'string', column: 'string' });\nexport const DropNotNullSchema = type({ kind: \"'dropNotNull'\", table: 'string', column: 'string' });\nexport const SetDefaultSchema = type({ kind: \"'setDefault'\", table: 'string', column: 'string' });\nexport const DropDefaultSchema = type({ kind: \"'dropDefault'\", table: 'string', column: 'string' });\n\n// ============================================================================\n// Constraint descriptors\n// ============================================================================\n\nexport const AddPrimaryKeySchema = type({ kind: \"'addPrimaryKey'\", table: 'string' });\nexport const AddUniqueSchema = type({ kind: \"'addUnique'\", table: 'string', columns: 'string[]' });\nexport const AddForeignKeySchema = type({\n kind: \"'addForeignKey'\",\n table: 'string',\n columns: 'string[]',\n});\nexport const DropConstraintSchema = type({\n kind: \"'dropConstraint'\",\n table: 'string',\n constraintName: 'string',\n});\n\n// ============================================================================\n// Index descriptors\n// ============================================================================\n\nexport const CreateIndexSchema = type({\n kind: \"'createIndex'\",\n table: 'string',\n columns: 'string[]',\n});\nexport const DropIndexSchema = type({\n kind: \"'dropIndex'\",\n table: 'string',\n indexName: 'string',\n});\n\n// ============================================================================\n// Type descriptors\n// ============================================================================\n\nexport const CreateEnumTypeSchema = type({\n kind: \"'createEnumType'\",\n typeName: 'string',\n 'values?': 'string[]',\n});\nexport const AddEnumValuesSchema = type({\n kind: \"'addEnumValues'\",\n typeName: 'string',\n values: 'string[]',\n});\nexport const DropEnumTypeSchema = type({ kind: \"'dropEnumType'\", typeName: 'string' });\nexport const RenameTypeSchema = type({\n kind: \"'renameType'\",\n fromName: 'string',\n toName: 'string',\n});\n\n// ============================================================================\n// Dependency descriptors\n// ============================================================================\n\nexport const CreateDependencySchema = type({\n kind: \"'createDependency'\",\n dependencyId: 'string',\n});\n\n// ============================================================================\n// Data transform descriptor\n// ============================================================================\n\nexport const DataTransformSchema = type({\n kind: \"'dataTransform'\",\n name: 'string',\n source: 'string',\n check: 'boolean | Function | symbol | object',\n run: '(Function | symbol | object)[]',\n});\n\n// ============================================================================\n// Union schema\n// ============================================================================\n\nexport const SqlMigrationOpDescriptorSchema = type.or(\n CreateTableSchema,\n DropTableSchema,\n AddColumnSchema,\n DropColumnSchema,\n AlterColumnTypeSchema,\n SetNotNullSchema,\n DropNotNullSchema,\n SetDefaultSchema,\n DropDefaultSchema,\n AddPrimaryKeySchema,\n AddUniqueSchema,\n AddForeignKeySchema,\n DropConstraintSchema,\n CreateIndexSchema,\n DropIndexSchema,\n CreateEnumTypeSchema,\n AddEnumValuesSchema,\n DropEnumTypeSchema,\n RenameTypeSchema,\n CreateDependencySchema,\n DataTransformSchema,\n);\n\nexport const MigrationDescriptorArraySchema = SqlMigrationOpDescriptorSchema.array();\n\n// ============================================================================\n// Derived types\n// ============================================================================\n\nexport type CreateTableDescriptor = typeof CreateTableSchema.infer;\nexport type DropTableDescriptor = typeof DropTableSchema.infer;\nexport type AddColumnDescriptor = typeof AddColumnSchema.infer;\nexport type DropColumnDescriptor = typeof DropColumnSchema.infer;\nexport type AlterColumnTypeDescriptor = typeof AlterColumnTypeSchema.infer;\nexport type SetNotNullDescriptor = typeof SetNotNullSchema.infer;\nexport type DropNotNullDescriptor = typeof DropNotNullSchema.infer;\nexport type SetDefaultDescriptor = typeof SetDefaultSchema.infer;\nexport type DropDefaultDescriptor = typeof DropDefaultSchema.infer;\nexport type AddPrimaryKeyDescriptor = typeof AddPrimaryKeySchema.infer;\nexport type AddUniqueDescriptor = typeof AddUniqueSchema.infer;\nexport type AddForeignKeyDescriptor = typeof AddForeignKeySchema.infer;\nexport type DropConstraintDescriptor = typeof DropConstraintSchema.infer;\nexport type CreateIndexDescriptor = typeof CreateIndexSchema.infer;\nexport type DropIndexDescriptor = typeof DropIndexSchema.infer;\nexport type CreateEnumTypeDescriptor = typeof CreateEnumTypeSchema.infer;\nexport type AddEnumValuesDescriptor = typeof AddEnumValuesSchema.infer;\nexport type DropEnumTypeDescriptor = typeof DropEnumTypeSchema.infer;\nexport type RenameTypeDescriptor = typeof RenameTypeSchema.infer;\nexport type CreateDependencyDescriptor = typeof CreateDependencySchema.infer;\nexport type DataTransformDescriptor = typeof DataTransformSchema.infer;\nexport type SqlMigrationOpDescriptor = typeof SqlMigrationOpDescriptorSchema.infer;\n","/**\n * SQL migration operation descriptors — builder functions and re-exports.\n *\n * Types are defined by arktype schemas in descriptor-schemas.ts and derived\n * via `typeof schema.infer`. This file provides the builder functions that\n * construct descriptors, plus re-exports the types and schemas.\n */\n\nimport type { SqlQueryPlan } from '@prisma-next/sql-relational-core/plan';\nimport { ifDefined } from '@prisma-next/utils/defined';\n\n// Re-export types and schemas from the schema source of truth\nexport type {\n AddColumnDescriptor,\n AddEnumValuesDescriptor,\n AddForeignKeyDescriptor,\n AddPrimaryKeyDescriptor,\n AddUniqueDescriptor,\n AlterColumnTypeDescriptor,\n CreateDependencyDescriptor,\n CreateEnumTypeDescriptor,\n CreateIndexDescriptor,\n CreateTableDescriptor,\n DataTransformDescriptor,\n DropColumnDescriptor,\n DropConstraintDescriptor,\n DropDefaultDescriptor,\n DropEnumTypeDescriptor,\n DropIndexDescriptor,\n DropNotNullDescriptor,\n DropTableDescriptor,\n RenameTypeDescriptor,\n SetDefaultDescriptor,\n SetNotNullDescriptor,\n SqlMigrationOpDescriptor,\n} from './descriptor-schemas';\n\nexport { MigrationDescriptorArraySchema } from './descriptor-schemas';\n\nimport type {\n AddColumnDescriptor,\n AddEnumValuesDescriptor,\n AddForeignKeyDescriptor,\n AddPrimaryKeyDescriptor,\n AddUniqueDescriptor,\n AlterColumnTypeDescriptor,\n CreateDependencyDescriptor,\n CreateEnumTypeDescriptor,\n CreateIndexDescriptor,\n CreateTableDescriptor,\n DropColumnDescriptor,\n DropConstraintDescriptor,\n DropDefaultDescriptor,\n DropEnumTypeDescriptor,\n DropIndexDescriptor,\n DropNotNullDescriptor,\n DropTableDescriptor,\n RenameTypeDescriptor,\n SetDefaultDescriptor,\n SetNotNullDescriptor,\n} from './descriptor-schemas';\n\n// ============================================================================\n// Data transform support types (not validated by arktype — runtime values)\n// ============================================================================\n\n/** Something that can produce a SqlQueryPlan via .build(). */\nexport interface Buildable {\n build(): SqlQueryPlan;\n}\n\n/**\n * Sentinel value for unimplemented data transform queries.\n * The scaffold renders this as a TODO comment. The resolver throws if it encounters one.\n */\nexport const TODO = Symbol.for('prisma-next.migration.todo');\nexport type TodoMarker = typeof TODO;\n\n// ============================================================================\n// Builder functions\n// ============================================================================\n\nexport function createTable(table: string): CreateTableDescriptor {\n return { kind: 'createTable', table };\n}\n\nexport function dropTable(table: string): DropTableDescriptor {\n return { kind: 'dropTable', table };\n}\n\nexport function addColumn(\n table: string,\n column: string,\n overrides?: { nullable?: boolean },\n): AddColumnDescriptor {\n return { kind: 'addColumn', table, column, ...ifDefined('overrides', overrides) };\n}\n\nexport function dropColumn(table: string, column: string): DropColumnDescriptor {\n return { kind: 'dropColumn', table, column };\n}\n\nexport function alterColumnType(\n table: string,\n column: string,\n opts?: string | { using?: string; toType?: string },\n): AlterColumnTypeDescriptor {\n const using = typeof opts === 'string' ? opts : opts?.using;\n const toType = typeof opts === 'string' ? undefined : opts?.toType;\n return {\n kind: 'alterColumnType',\n table,\n column,\n ...ifDefined('using', using),\n ...ifDefined('toType', toType),\n };\n}\n\nexport function setNotNull(table: string, column: string): SetNotNullDescriptor {\n return { kind: 'setNotNull', table, column };\n}\n\nexport function dropNotNull(table: string, column: string): DropNotNullDescriptor {\n return { kind: 'dropNotNull', table, column };\n}\n\nexport function setDefault(table: string, column: string): SetDefaultDescriptor {\n return { kind: 'setDefault', table, column };\n}\n\nexport function dropDefault(table: string, column: string): DropDefaultDescriptor {\n return { kind: 'dropDefault', table, column };\n}\n\nexport function addPrimaryKey(table: string): AddPrimaryKeyDescriptor {\n return { kind: 'addPrimaryKey', table };\n}\n\nexport function addUnique(table: string, columns: readonly string[]): AddUniqueDescriptor {\n return { kind: 'addUnique', table, columns: [...columns] };\n}\n\nexport function addForeignKey(table: string, columns: readonly string[]): AddForeignKeyDescriptor {\n return { kind: 'addForeignKey', table, columns: [...columns] };\n}\n\nexport function dropConstraint(table: string, constraintName: string): DropConstraintDescriptor {\n return { kind: 'dropConstraint', table, constraintName };\n}\n\nexport function createIndex(table: string, columns: readonly string[]): CreateIndexDescriptor {\n return { kind: 'createIndex', table, columns: [...columns] };\n}\n\nexport function dropIndex(table: string, indexName: string): DropIndexDescriptor {\n return { kind: 'dropIndex', table, indexName };\n}\n\nexport function createEnumType(\n typeName: string,\n values?: readonly string[],\n): CreateEnumTypeDescriptor {\n return {\n kind: 'createEnumType',\n typeName,\n ...ifDefined('values', values ? [...values] : undefined),\n };\n}\n\nexport function addEnumValues(\n typeName: string,\n values: readonly string[],\n): AddEnumValuesDescriptor {\n return { kind: 'addEnumValues', typeName, values: [...values] };\n}\n\nexport function dropEnumType(typeName: string): DropEnumTypeDescriptor {\n return { kind: 'dropEnumType', typeName };\n}\n\nexport function renameType(fromName: string, toName: string): RenameTypeDescriptor {\n return { kind: 'renameType', fromName, toName };\n}\n\nexport function createDependency(dependencyId: string): CreateDependencyDescriptor {\n return { kind: 'createDependency', dependencyId };\n}\n\n/**\n * All structural builder functions keyed by descriptor kind.\n */\nexport const builders = {\n createTable,\n dropTable,\n addColumn,\n dropColumn,\n alterColumnType,\n setNotNull,\n dropNotNull,\n setDefault,\n dropDefault,\n addPrimaryKey,\n addUnique,\n addForeignKey,\n dropConstraint,\n createIndex,\n dropIndex,\n createEnumType,\n addEnumValues,\n dropEnumType,\n renameType,\n createDependency,\n} as const;\n"],"mappings":"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"}
|
package/dist/pack.d.mts
ADDED
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
//#region src/exports/pack.d.ts
|
|
2
|
+
declare const sqlFamilyPack: {
|
|
3
|
+
readonly kind: "family";
|
|
4
|
+
readonly id: "sql";
|
|
5
|
+
readonly familyId: "sql";
|
|
6
|
+
readonly version: "0.0.1";
|
|
7
|
+
readonly authoring: {
|
|
8
|
+
readonly field: {
|
|
9
|
+
readonly text: {
|
|
10
|
+
readonly kind: "fieldPreset";
|
|
11
|
+
readonly output: {
|
|
12
|
+
readonly codecId: "sql/text@1";
|
|
13
|
+
readonly nativeType: "text";
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
readonly timestamp: {
|
|
17
|
+
readonly kind: "fieldPreset";
|
|
18
|
+
readonly output: {
|
|
19
|
+
readonly codecId: "sql/timestamp@1";
|
|
20
|
+
readonly nativeType: "timestamp";
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
readonly createdAt: {
|
|
24
|
+
readonly kind: "fieldPreset";
|
|
25
|
+
readonly output: {
|
|
26
|
+
readonly codecId: "sql/timestamp@1";
|
|
27
|
+
readonly nativeType: "timestamp";
|
|
28
|
+
readonly default: {
|
|
29
|
+
readonly kind: "function";
|
|
30
|
+
readonly expression: "CURRENT_TIMESTAMP";
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
readonly uuid: {
|
|
35
|
+
readonly kind: "fieldPreset";
|
|
36
|
+
readonly output: {
|
|
37
|
+
readonly codecId: "sql/char@1";
|
|
38
|
+
readonly nativeType: "character";
|
|
39
|
+
readonly typeParams: {
|
|
40
|
+
readonly length: 36;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
readonly ulid: {
|
|
45
|
+
readonly kind: "fieldPreset";
|
|
46
|
+
readonly output: {
|
|
47
|
+
readonly codecId: "sql/char@1";
|
|
48
|
+
readonly nativeType: "character";
|
|
49
|
+
readonly typeParams: {
|
|
50
|
+
readonly length: 26;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
readonly nanoid: {
|
|
55
|
+
readonly kind: "fieldPreset";
|
|
56
|
+
readonly args: readonly [{
|
|
57
|
+
readonly kind: "object";
|
|
58
|
+
readonly optional: true;
|
|
59
|
+
readonly properties: {
|
|
60
|
+
readonly size: {
|
|
61
|
+
readonly kind: "number";
|
|
62
|
+
readonly optional: true;
|
|
63
|
+
readonly integer: true;
|
|
64
|
+
readonly minimum: 2;
|
|
65
|
+
readonly maximum: 255;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
}];
|
|
69
|
+
readonly output: {
|
|
70
|
+
readonly codecId: "sql/char@1";
|
|
71
|
+
readonly nativeType: "character";
|
|
72
|
+
readonly typeParams: {
|
|
73
|
+
readonly length: {
|
|
74
|
+
readonly kind: "arg";
|
|
75
|
+
readonly index: 0;
|
|
76
|
+
readonly path: readonly ["size"];
|
|
77
|
+
readonly default: 21;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
readonly cuid2: {
|
|
83
|
+
readonly kind: "fieldPreset";
|
|
84
|
+
readonly output: {
|
|
85
|
+
readonly codecId: "sql/char@1";
|
|
86
|
+
readonly nativeType: "character";
|
|
87
|
+
readonly typeParams: {
|
|
88
|
+
readonly length: 24;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
readonly ksuid: {
|
|
93
|
+
readonly kind: "fieldPreset";
|
|
94
|
+
readonly output: {
|
|
95
|
+
readonly codecId: "sql/char@1";
|
|
96
|
+
readonly nativeType: "character";
|
|
97
|
+
readonly typeParams: {
|
|
98
|
+
readonly length: 27;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
readonly id: {
|
|
103
|
+
readonly uuidv4: {
|
|
104
|
+
readonly kind: "fieldPreset";
|
|
105
|
+
readonly output: {
|
|
106
|
+
readonly codecId: "sql/char@1";
|
|
107
|
+
readonly nativeType: "character";
|
|
108
|
+
readonly typeParams: {
|
|
109
|
+
readonly length: 36;
|
|
110
|
+
};
|
|
111
|
+
readonly executionDefault: {
|
|
112
|
+
readonly kind: "generator";
|
|
113
|
+
readonly id: "uuidv4";
|
|
114
|
+
};
|
|
115
|
+
readonly id: true;
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
readonly uuidv7: {
|
|
119
|
+
readonly kind: "fieldPreset";
|
|
120
|
+
readonly output: {
|
|
121
|
+
readonly codecId: "sql/char@1";
|
|
122
|
+
readonly nativeType: "character";
|
|
123
|
+
readonly typeParams: {
|
|
124
|
+
readonly length: 36;
|
|
125
|
+
};
|
|
126
|
+
readonly executionDefault: {
|
|
127
|
+
readonly kind: "generator";
|
|
128
|
+
readonly id: "uuidv7";
|
|
129
|
+
};
|
|
130
|
+
readonly id: true;
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
readonly ulid: {
|
|
134
|
+
readonly kind: "fieldPreset";
|
|
135
|
+
readonly output: {
|
|
136
|
+
readonly codecId: "sql/char@1";
|
|
137
|
+
readonly nativeType: "character";
|
|
138
|
+
readonly typeParams: {
|
|
139
|
+
readonly length: 26;
|
|
140
|
+
};
|
|
141
|
+
readonly executionDefault: {
|
|
142
|
+
readonly kind: "generator";
|
|
143
|
+
readonly id: "ulid";
|
|
144
|
+
};
|
|
145
|
+
readonly id: true;
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
readonly nanoid: {
|
|
149
|
+
readonly kind: "fieldPreset";
|
|
150
|
+
readonly args: readonly [{
|
|
151
|
+
readonly kind: "object";
|
|
152
|
+
readonly optional: true;
|
|
153
|
+
readonly properties: {
|
|
154
|
+
readonly size: {
|
|
155
|
+
readonly kind: "number";
|
|
156
|
+
readonly optional: true;
|
|
157
|
+
readonly integer: true;
|
|
158
|
+
readonly minimum: 2;
|
|
159
|
+
readonly maximum: 255;
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
}];
|
|
163
|
+
readonly output: {
|
|
164
|
+
readonly codecId: "sql/char@1";
|
|
165
|
+
readonly nativeType: "character";
|
|
166
|
+
readonly typeParams: {
|
|
167
|
+
readonly length: {
|
|
168
|
+
readonly kind: "arg";
|
|
169
|
+
readonly index: 0;
|
|
170
|
+
readonly path: readonly ["size"];
|
|
171
|
+
readonly default: 21;
|
|
172
|
+
};
|
|
173
|
+
};
|
|
174
|
+
readonly executionDefault: {
|
|
175
|
+
readonly kind: "generator";
|
|
176
|
+
readonly id: "nanoid";
|
|
177
|
+
readonly params: {
|
|
178
|
+
readonly size: {
|
|
179
|
+
readonly kind: "arg";
|
|
180
|
+
readonly index: 0;
|
|
181
|
+
readonly path: readonly ["size"];
|
|
182
|
+
};
|
|
183
|
+
};
|
|
184
|
+
};
|
|
185
|
+
readonly id: true;
|
|
186
|
+
};
|
|
187
|
+
};
|
|
188
|
+
readonly cuid2: {
|
|
189
|
+
readonly kind: "fieldPreset";
|
|
190
|
+
readonly output: {
|
|
191
|
+
readonly codecId: "sql/char@1";
|
|
192
|
+
readonly nativeType: "character";
|
|
193
|
+
readonly typeParams: {
|
|
194
|
+
readonly length: 24;
|
|
195
|
+
};
|
|
196
|
+
readonly executionDefault: {
|
|
197
|
+
readonly kind: "generator";
|
|
198
|
+
readonly id: "cuid2";
|
|
199
|
+
};
|
|
200
|
+
readonly id: true;
|
|
201
|
+
};
|
|
202
|
+
};
|
|
203
|
+
readonly ksuid: {
|
|
204
|
+
readonly kind: "fieldPreset";
|
|
205
|
+
readonly output: {
|
|
206
|
+
readonly codecId: "sql/char@1";
|
|
207
|
+
readonly nativeType: "character";
|
|
208
|
+
readonly typeParams: {
|
|
209
|
+
readonly length: 27;
|
|
210
|
+
};
|
|
211
|
+
readonly executionDefault: {
|
|
212
|
+
readonly kind: "generator";
|
|
213
|
+
readonly id: "ksuid";
|
|
214
|
+
};
|
|
215
|
+
readonly id: true;
|
|
216
|
+
};
|
|
217
|
+
};
|
|
218
|
+
};
|
|
219
|
+
};
|
|
220
|
+
readonly type: {
|
|
221
|
+
readonly sql: {
|
|
222
|
+
readonly String: {
|
|
223
|
+
readonly kind: "typeConstructor";
|
|
224
|
+
readonly args: readonly [{
|
|
225
|
+
readonly kind: "number";
|
|
226
|
+
readonly name: "length";
|
|
227
|
+
readonly integer: true;
|
|
228
|
+
readonly minimum: 1;
|
|
229
|
+
readonly maximum: 10485760;
|
|
230
|
+
}];
|
|
231
|
+
readonly output: {
|
|
232
|
+
readonly codecId: "sql/varchar@1";
|
|
233
|
+
readonly nativeType: "character varying";
|
|
234
|
+
readonly typeParams: {
|
|
235
|
+
readonly length: {
|
|
236
|
+
readonly kind: "arg";
|
|
237
|
+
readonly index: 0;
|
|
238
|
+
};
|
|
239
|
+
};
|
|
240
|
+
};
|
|
241
|
+
};
|
|
242
|
+
};
|
|
243
|
+
};
|
|
244
|
+
};
|
|
245
|
+
};
|
|
246
|
+
//#endregion
|
|
247
|
+
export { sqlFamilyPack as default };
|
|
248
|
+
//# sourceMappingURL=pack.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pack.d.mts","names":[],"sources":["../src/exports/pack.ts"],"sourcesContent":[],"mappings":";cAIM;EAAA,SAAA,IAAA,EAAA,QASmC"}
|
package/dist/pack.mjs
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { n as sqlFamilyAuthoringFieldPresets, t as sqlFamilyAuthoringTypes } from "./authoring-type-constructors-DgU-RFaP.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/exports/pack.ts
|
|
4
|
+
const sqlFamilyPack = {
|
|
5
|
+
kind: "family",
|
|
6
|
+
id: "sql",
|
|
7
|
+
familyId: "sql",
|
|
8
|
+
version: "0.0.1",
|
|
9
|
+
authoring: {
|
|
10
|
+
field: sqlFamilyAuthoringFieldPresets,
|
|
11
|
+
type: sqlFamilyAuthoringTypes
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
var pack_default = sqlFamilyPack;
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
export { pack_default as default };
|
|
18
|
+
//# sourceMappingURL=pack.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pack.mjs","names":[],"sources":["../src/exports/pack.ts"],"sourcesContent":["import type { FamilyPackRef } from '@prisma-next/framework-components/components';\nimport { sqlFamilyAuthoringFieldPresets } from '../core/authoring-field-presets';\nimport { sqlFamilyAuthoringTypes } from '../core/authoring-type-constructors';\n\nconst sqlFamilyPack = {\n kind: 'family',\n id: 'sql',\n familyId: 'sql',\n version: '0.0.1',\n authoring: {\n field: sqlFamilyAuthoringFieldPresets,\n type: sqlFamilyAuthoringTypes,\n },\n} as const satisfies FamilyPackRef<'sql'>;\n\nexport default sqlFamilyPack;\n"],"mappings":";;;AAIA,MAAM,gBAAgB;CACpB,MAAM;CACN,IAAI;CACJ,UAAU;CACV,SAAS;CACT,WAAW;EACT,OAAO;EACP,MAAM;EACP;CACF;AAED,mBAAe"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { RuntimeFamilyDescriptor, RuntimeFamilyInstance } from "@prisma-next/framework-components/execution";
|
|
2
|
+
|
|
3
|
+
//#region src/core/runtime-instance.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* SQL execution-plane family instance interface.
|
|
7
|
+
*
|
|
8
|
+
* Note: this is currently named `SqlRuntimeFamilyInstance` because the execution plane
|
|
9
|
+
* framework types are still using the `Runtime*` naming (`RuntimeFamilyInstance`, etc.).
|
|
10
|
+
*
|
|
11
|
+
* This will be renamed to `SqlExecutionFamilyInstance` as part of `TML-1842`.
|
|
12
|
+
*/
|
|
13
|
+
interface SqlRuntimeFamilyInstance extends RuntimeFamilyInstance<'sql'> {}
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/core/runtime-descriptor.d.ts
|
|
16
|
+
/**
|
|
17
|
+
* SQL execution-plane family descriptor.
|
|
18
|
+
*
|
|
19
|
+
* Note: this is currently named `sqlRuntimeFamilyDescriptor` because the execution plane
|
|
20
|
+
* framework types are still using the `Runtime*` naming (`RuntimeFamilyDescriptor`, etc.).
|
|
21
|
+
*
|
|
22
|
+
* This will be renamed to `sqlExecutionFamilyDescriptor` as part of `TML-1842`.
|
|
23
|
+
*/
|
|
24
|
+
declare const sqlRuntimeFamilyDescriptor: RuntimeFamilyDescriptor<'sql', SqlRuntimeFamilyInstance>;
|
|
25
|
+
//#endregion
|
|
26
|
+
export { sqlRuntimeFamilyDescriptor as default };
|
|
27
|
+
//# sourceMappingURL=runtime.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.d.mts","names":[],"sources":["../src/core/runtime-instance.ts","../src/core/runtime-descriptor.ts"],"sourcesContent":[],"mappings":";;;;;;AAUA;;;;ACCA;;UDDiB,wBAAA,SAAiC;;;;AAAlD;;;;ACCA;;;cAAa,4BAA4B,+BAA+B"}
|
package/dist/runtime.mjs
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
//#region src/core/runtime-instance.ts
|
|
2
|
+
/**
|
|
3
|
+
* Creates a SQL execution-plane family instance.
|
|
4
|
+
*
|
|
5
|
+
* This will be renamed to `createSqlExecutionFamilyInstance()` as part of `TML-1842`.
|
|
6
|
+
*/
|
|
7
|
+
function createSqlRuntimeFamilyInstance() {
|
|
8
|
+
return { familyId: "sql" };
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region src/core/runtime-descriptor.ts
|
|
13
|
+
/**
|
|
14
|
+
* SQL execution-plane family descriptor.
|
|
15
|
+
*
|
|
16
|
+
* Note: this is currently named `sqlRuntimeFamilyDescriptor` because the execution plane
|
|
17
|
+
* framework types are still using the `Runtime*` naming (`RuntimeFamilyDescriptor`, etc.).
|
|
18
|
+
*
|
|
19
|
+
* This will be renamed to `sqlExecutionFamilyDescriptor` as part of `TML-1842`.
|
|
20
|
+
*/
|
|
21
|
+
const sqlRuntimeFamilyDescriptor = {
|
|
22
|
+
kind: "family",
|
|
23
|
+
id: "sql",
|
|
24
|
+
familyId: "sql",
|
|
25
|
+
version: "0.0.1",
|
|
26
|
+
create() {
|
|
27
|
+
return createSqlRuntimeFamilyInstance();
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
Object.freeze(sqlRuntimeFamilyDescriptor);
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/exports/runtime.ts
|
|
34
|
+
var runtime_default = sqlRuntimeFamilyDescriptor;
|
|
35
|
+
|
|
36
|
+
//#endregion
|
|
37
|
+
export { runtime_default as default };
|
|
38
|
+
//# sourceMappingURL=runtime.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.mjs","names":["sqlRuntimeFamilyDescriptor: RuntimeFamilyDescriptor<'sql', SqlRuntimeFamilyInstance>"],"sources":["../src/core/runtime-instance.ts","../src/core/runtime-descriptor.ts","../src/exports/runtime.ts"],"sourcesContent":["import type { RuntimeFamilyInstance } from '@prisma-next/framework-components/execution';\n\n/**\n * SQL execution-plane family instance interface.\n *\n * Note: this is currently named `SqlRuntimeFamilyInstance` because the execution plane\n * framework types are still using the `Runtime*` naming (`RuntimeFamilyInstance`, etc.).\n *\n * This will be renamed to `SqlExecutionFamilyInstance` as part of `TML-1842`.\n */\nexport interface SqlRuntimeFamilyInstance extends RuntimeFamilyInstance<'sql'> {}\n\n/**\n * Creates a SQL execution-plane family instance.\n *\n * This will be renamed to `createSqlExecutionFamilyInstance()` as part of `TML-1842`.\n */\nexport function createSqlRuntimeFamilyInstance(): SqlRuntimeFamilyInstance {\n return {\n familyId: 'sql' as const,\n };\n}\n","import type { RuntimeFamilyDescriptor } from '@prisma-next/framework-components/execution';\nimport { createSqlRuntimeFamilyInstance, type SqlRuntimeFamilyInstance } from './runtime-instance';\n\n/**\n * SQL execution-plane family descriptor.\n *\n * Note: this is currently named `sqlRuntimeFamilyDescriptor` because the execution plane\n * framework types are still using the `Runtime*` naming (`RuntimeFamilyDescriptor`, etc.).\n *\n * This will be renamed to `sqlExecutionFamilyDescriptor` as part of `TML-1842`.\n */\nexport const sqlRuntimeFamilyDescriptor: RuntimeFamilyDescriptor<'sql', SqlRuntimeFamilyInstance> =\n {\n kind: 'family',\n id: 'sql',\n familyId: 'sql',\n version: '0.0.1',\n create() {\n return createSqlRuntimeFamilyInstance();\n },\n };\n\nObject.freeze(sqlRuntimeFamilyDescriptor);\n","import { sqlRuntimeFamilyDescriptor } from '../core/runtime-descriptor';\n\nexport default sqlRuntimeFamilyDescriptor;\n"],"mappings":";;;;;;AAiBA,SAAgB,iCAA2D;AACzE,QAAO,EACL,UAAU,OACX;;;;;;;;;;;;;ACTH,MAAaA,6BACX;CACE,MAAM;CACN,IAAI;CACJ,UAAU;CACV,SAAS;CACT,SAAS;AACP,SAAO,gCAAgC;;CAE1C;AAEH,OAAO,OAAO,2BAA2B;;;;ACpBzC,sBAAe"}
|