@prisma-next/family-sql 0.4.0-dev.8 → 0.4.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.
@@ -1,380 +0,0 @@
1
- import * as arktype_internal_variants_object_ts0 from "arktype/internal/variants/object.ts";
2
- import * as arktype_internal_variants_array_ts0 from "arktype/internal/variants/array.ts";
3
- import { SqlQueryPlan } from "@prisma-next/sql-relational-core/plan";
4
-
5
- //#region src/core/migrations/descriptor-schemas.d.ts
6
-
7
- /**
8
- * Arktype schemas for SQL migration operation descriptors.
9
- *
10
- * These schemas are the source of truth for descriptor shapes.
11
- * TypeScript types are derived via `typeof schema.infer`.
12
- */
13
- declare const CreateTableSchema: arktype_internal_variants_object_ts0.ObjectType<{
14
- kind: "createTable";
15
- table: string;
16
- }, {}>;
17
- declare const DropTableSchema: arktype_internal_variants_object_ts0.ObjectType<{
18
- kind: "dropTable";
19
- table: string;
20
- }, {}>;
21
- declare const AddColumnSchema: arktype_internal_variants_object_ts0.ObjectType<{
22
- kind: "addColumn";
23
- table: string;
24
- column: string;
25
- overrides?: {
26
- nullable?: boolean;
27
- };
28
- }, {}>;
29
- declare const DropColumnSchema: arktype_internal_variants_object_ts0.ObjectType<{
30
- kind: "dropColumn";
31
- table: string;
32
- column: string;
33
- }, {}>;
34
- declare const AlterColumnTypeSchema: arktype_internal_variants_object_ts0.ObjectType<{
35
- kind: "alterColumnType";
36
- table: string;
37
- column: string;
38
- using?: string;
39
- toType?: string;
40
- }, {}>;
41
- declare const SetNotNullSchema: arktype_internal_variants_object_ts0.ObjectType<{
42
- kind: "setNotNull";
43
- table: string;
44
- column: string;
45
- }, {}>;
46
- declare const DropNotNullSchema: arktype_internal_variants_object_ts0.ObjectType<{
47
- kind: "dropNotNull";
48
- table: string;
49
- column: string;
50
- }, {}>;
51
- declare const SetDefaultSchema: arktype_internal_variants_object_ts0.ObjectType<{
52
- kind: "setDefault";
53
- table: string;
54
- column: string;
55
- }, {}>;
56
- declare const DropDefaultSchema: arktype_internal_variants_object_ts0.ObjectType<{
57
- kind: "dropDefault";
58
- table: string;
59
- column: string;
60
- }, {}>;
61
- declare const AddPrimaryKeySchema: arktype_internal_variants_object_ts0.ObjectType<{
62
- kind: "addPrimaryKey";
63
- table: string;
64
- }, {}>;
65
- declare const AddUniqueSchema: arktype_internal_variants_object_ts0.ObjectType<{
66
- kind: "addUnique";
67
- table: string;
68
- columns: string[];
69
- }, {}>;
70
- declare const AddForeignKeySchema: arktype_internal_variants_object_ts0.ObjectType<{
71
- kind: "addForeignKey";
72
- table: string;
73
- columns: string[];
74
- }, {}>;
75
- declare const DropConstraintSchema: arktype_internal_variants_object_ts0.ObjectType<{
76
- kind: "dropConstraint";
77
- table: string;
78
- constraintName: string;
79
- }, {}>;
80
- declare const CreateIndexSchema: arktype_internal_variants_object_ts0.ObjectType<{
81
- kind: "createIndex";
82
- table: string;
83
- columns: string[];
84
- }, {}>;
85
- declare const DropIndexSchema: arktype_internal_variants_object_ts0.ObjectType<{
86
- kind: "dropIndex";
87
- table: string;
88
- indexName: string;
89
- }, {}>;
90
- declare const CreateEnumTypeSchema: arktype_internal_variants_object_ts0.ObjectType<{
91
- kind: "createEnumType";
92
- typeName: string;
93
- values?: string[];
94
- }, {}>;
95
- declare const AddEnumValuesSchema: arktype_internal_variants_object_ts0.ObjectType<{
96
- kind: "addEnumValues";
97
- typeName: string;
98
- values: string[];
99
- }, {}>;
100
- declare const DropEnumTypeSchema: arktype_internal_variants_object_ts0.ObjectType<{
101
- kind: "dropEnumType";
102
- typeName: string;
103
- }, {}>;
104
- declare const RenameTypeSchema: arktype_internal_variants_object_ts0.ObjectType<{
105
- kind: "renameType";
106
- fromName: string;
107
- toName: string;
108
- }, {}>;
109
- declare const CreateDependencySchema: arktype_internal_variants_object_ts0.ObjectType<{
110
- kind: "createDependency";
111
- dependencyId: string;
112
- }, {}>;
113
- declare const DataTransformSchema: arktype_internal_variants_object_ts0.ObjectType<{
114
- kind: "dataTransform";
115
- name: string;
116
- source: string;
117
- check: boolean | symbol | object | Function;
118
- run: (symbol | object | Function)[];
119
- }, {}>;
120
- declare const SqlMigrationOpDescriptorSchema: arktype_internal_variants_object_ts0.ObjectType<{
121
- kind: "createTable";
122
- table: string;
123
- } | {
124
- kind: "dropTable";
125
- table: string;
126
- } | {
127
- kind: "addColumn";
128
- table: string;
129
- column: string;
130
- overrides?: {
131
- nullable?: boolean;
132
- };
133
- } | {
134
- kind: "dropColumn";
135
- table: string;
136
- column: string;
137
- } | {
138
- kind: "alterColumnType";
139
- table: string;
140
- column: string;
141
- using?: string;
142
- toType?: string;
143
- } | {
144
- kind: "setNotNull";
145
- table: string;
146
- column: string;
147
- } | {
148
- kind: "dropNotNull";
149
- table: string;
150
- column: string;
151
- } | {
152
- kind: "setDefault";
153
- table: string;
154
- column: string;
155
- } | {
156
- kind: "dropDefault";
157
- table: string;
158
- column: string;
159
- } | {
160
- kind: "addPrimaryKey";
161
- table: string;
162
- } | {
163
- kind: "addUnique";
164
- table: string;
165
- columns: string[];
166
- } | {
167
- kind: "addForeignKey";
168
- table: string;
169
- columns: string[];
170
- } | {
171
- kind: "dropConstraint";
172
- table: string;
173
- constraintName: string;
174
- } | {
175
- kind: "createIndex";
176
- table: string;
177
- columns: string[];
178
- } | {
179
- kind: "dropIndex";
180
- table: string;
181
- indexName: string;
182
- } | {
183
- kind: "createEnumType";
184
- typeName: string;
185
- values?: string[];
186
- } | {
187
- kind: "addEnumValues";
188
- typeName: string;
189
- values: string[];
190
- } | {
191
- kind: "dropEnumType";
192
- typeName: string;
193
- } | {
194
- kind: "renameType";
195
- fromName: string;
196
- toName: string;
197
- } | {
198
- kind: "createDependency";
199
- dependencyId: string;
200
- } | {
201
- kind: "dataTransform";
202
- name: string;
203
- source: string;
204
- check: boolean | symbol | object | Function;
205
- run: (symbol | object | Function)[];
206
- }, {}>;
207
- declare const MigrationDescriptorArraySchema: arktype_internal_variants_array_ts0.ArrayType<({
208
- kind: "createTable";
209
- table: string;
210
- } | {
211
- kind: "dropTable";
212
- table: string;
213
- } | {
214
- kind: "addColumn";
215
- table: string;
216
- column: string;
217
- overrides?: {
218
- nullable?: boolean;
219
- };
220
- } | {
221
- kind: "dropColumn";
222
- table: string;
223
- column: string;
224
- } | {
225
- kind: "alterColumnType";
226
- table: string;
227
- column: string;
228
- using?: string;
229
- toType?: string;
230
- } | {
231
- kind: "setNotNull";
232
- table: string;
233
- column: string;
234
- } | {
235
- kind: "dropNotNull";
236
- table: string;
237
- column: string;
238
- } | {
239
- kind: "setDefault";
240
- table: string;
241
- column: string;
242
- } | {
243
- kind: "dropDefault";
244
- table: string;
245
- column: string;
246
- } | {
247
- kind: "addPrimaryKey";
248
- table: string;
249
- } | {
250
- kind: "addUnique";
251
- table: string;
252
- columns: string[];
253
- } | {
254
- kind: "addForeignKey";
255
- table: string;
256
- columns: string[];
257
- } | {
258
- kind: "dropConstraint";
259
- table: string;
260
- constraintName: string;
261
- } | {
262
- kind: "createIndex";
263
- table: string;
264
- columns: string[];
265
- } | {
266
- kind: "dropIndex";
267
- table: string;
268
- indexName: string;
269
- } | {
270
- kind: "createEnumType";
271
- typeName: string;
272
- values?: string[];
273
- } | {
274
- kind: "addEnumValues";
275
- typeName: string;
276
- values: string[];
277
- } | {
278
- kind: "dropEnumType";
279
- typeName: string;
280
- } | {
281
- kind: "renameType";
282
- fromName: string;
283
- toName: string;
284
- } | {
285
- kind: "createDependency";
286
- dependencyId: string;
287
- } | {
288
- kind: "dataTransform";
289
- name: string;
290
- source: string;
291
- check: boolean | symbol | object | Function;
292
- run: (symbol | object | Function)[];
293
- })[], {}>;
294
- type CreateTableDescriptor = typeof CreateTableSchema.infer;
295
- type DropTableDescriptor = typeof DropTableSchema.infer;
296
- type AddColumnDescriptor = typeof AddColumnSchema.infer;
297
- type DropColumnDescriptor = typeof DropColumnSchema.infer;
298
- type AlterColumnTypeDescriptor = typeof AlterColumnTypeSchema.infer;
299
- type SetNotNullDescriptor = typeof SetNotNullSchema.infer;
300
- type DropNotNullDescriptor = typeof DropNotNullSchema.infer;
301
- type SetDefaultDescriptor = typeof SetDefaultSchema.infer;
302
- type DropDefaultDescriptor = typeof DropDefaultSchema.infer;
303
- type AddPrimaryKeyDescriptor = typeof AddPrimaryKeySchema.infer;
304
- type AddUniqueDescriptor = typeof AddUniqueSchema.infer;
305
- type AddForeignKeyDescriptor = typeof AddForeignKeySchema.infer;
306
- type DropConstraintDescriptor = typeof DropConstraintSchema.infer;
307
- type CreateIndexDescriptor = typeof CreateIndexSchema.infer;
308
- type DropIndexDescriptor = typeof DropIndexSchema.infer;
309
- type CreateEnumTypeDescriptor = typeof CreateEnumTypeSchema.infer;
310
- type AddEnumValuesDescriptor = typeof AddEnumValuesSchema.infer;
311
- type DropEnumTypeDescriptor = typeof DropEnumTypeSchema.infer;
312
- type RenameTypeDescriptor = typeof RenameTypeSchema.infer;
313
- type CreateDependencyDescriptor = typeof CreateDependencySchema.infer;
314
- type DataTransformDescriptor = typeof DataTransformSchema.infer;
315
- type SqlMigrationOpDescriptor = typeof SqlMigrationOpDescriptorSchema.infer;
316
- //#endregion
317
- //#region src/core/migrations/operation-descriptors.d.ts
318
- /** Something that can produce a SqlQueryPlan via .build(). */
319
- interface Buildable {
320
- build(): SqlQueryPlan;
321
- }
322
- /**
323
- * Sentinel value for unimplemented data transform queries.
324
- * The scaffold renders this as a TODO comment. The resolver throws if it encounters one.
325
- */
326
- declare const TODO: unique symbol;
327
- type TodoMarker = typeof TODO;
328
- declare function createTable(table: string): CreateTableDescriptor;
329
- declare function dropTable(table: string): DropTableDescriptor;
330
- declare function addColumn(table: string, column: string, overrides?: {
331
- nullable?: boolean;
332
- }): AddColumnDescriptor;
333
- declare function dropColumn(table: string, column: string): DropColumnDescriptor;
334
- declare function alterColumnType(table: string, column: string, opts?: string | {
335
- using?: string;
336
- toType?: string;
337
- }): AlterColumnTypeDescriptor;
338
- declare function setNotNull(table: string, column: string): SetNotNullDescriptor;
339
- declare function dropNotNull(table: string, column: string): DropNotNullDescriptor;
340
- declare function setDefault(table: string, column: string): SetDefaultDescriptor;
341
- declare function dropDefault(table: string, column: string): DropDefaultDescriptor;
342
- declare function addPrimaryKey(table: string): AddPrimaryKeyDescriptor;
343
- declare function addUnique(table: string, columns: readonly string[]): AddUniqueDescriptor;
344
- declare function addForeignKey(table: string, columns: readonly string[]): AddForeignKeyDescriptor;
345
- declare function dropConstraint(table: string, constraintName: string): DropConstraintDescriptor;
346
- declare function createIndex(table: string, columns: readonly string[]): CreateIndexDescriptor;
347
- declare function dropIndex(table: string, indexName: string): DropIndexDescriptor;
348
- declare function createEnumType(typeName: string, values?: readonly string[]): CreateEnumTypeDescriptor;
349
- declare function addEnumValues(typeName: string, values: readonly string[]): AddEnumValuesDescriptor;
350
- declare function dropEnumType(typeName: string): DropEnumTypeDescriptor;
351
- declare function renameType(fromName: string, toName: string): RenameTypeDescriptor;
352
- declare function createDependency(dependencyId: string): CreateDependencyDescriptor;
353
- /**
354
- * All structural builder functions keyed by descriptor kind.
355
- */
356
- declare const builders: {
357
- readonly createTable: typeof createTable;
358
- readonly dropTable: typeof dropTable;
359
- readonly addColumn: typeof addColumn;
360
- readonly dropColumn: typeof dropColumn;
361
- readonly alterColumnType: typeof alterColumnType;
362
- readonly setNotNull: typeof setNotNull;
363
- readonly dropNotNull: typeof dropNotNull;
364
- readonly setDefault: typeof setDefault;
365
- readonly dropDefault: typeof dropDefault;
366
- readonly addPrimaryKey: typeof addPrimaryKey;
367
- readonly addUnique: typeof addUnique;
368
- readonly addForeignKey: typeof addForeignKey;
369
- readonly dropConstraint: typeof dropConstraint;
370
- readonly createIndex: typeof createIndex;
371
- readonly dropIndex: typeof dropIndex;
372
- readonly createEnumType: typeof createEnumType;
373
- readonly addEnumValues: typeof addEnumValues;
374
- readonly dropEnumType: typeof dropEnumType;
375
- readonly renameType: typeof renameType;
376
- readonly createDependency: typeof createDependency;
377
- };
378
- //#endregion
379
- export { type AddColumnDescriptor, type AddEnumValuesDescriptor, type AddForeignKeyDescriptor, type AddPrimaryKeyDescriptor, type AddUniqueDescriptor, type AlterColumnTypeDescriptor, type Buildable, type CreateDependencyDescriptor, type CreateEnumTypeDescriptor, type CreateIndexDescriptor, type CreateTableDescriptor, type DataTransformDescriptor, type DropColumnDescriptor, type DropConstraintDescriptor, type DropDefaultDescriptor, type DropEnumTypeDescriptor, type DropIndexDescriptor, type DropNotNullDescriptor, type DropTableDescriptor, MigrationDescriptorArraySchema, type RenameTypeDescriptor, type SetDefaultDescriptor, type SetNotNullDescriptor, type SqlMigrationOpDescriptor, TODO, type TodoMarker, addColumn, addEnumValues, addForeignKey, addPrimaryKey, addUnique, alterColumnType, builders, createDependency, createEnumType, createIndex, createTable, dropColumn, dropConstraint, dropDefault, dropEnumType, dropIndex, dropNotNull, dropTable, renameType, setDefault, setNotNull };
380
- //# sourceMappingURL=operation-descriptors.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"operation-descriptors.d.mts","names":[],"sources":["../src/core/migrations/descriptor-schemas.ts","../src/core/migrations/operation-descriptors.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;AAaA;AACa,cADA,iBACgE,EADI,oCAAA,CAAnD,UACF,CAAA;EAMf,IAAA,EAAA,aAKX;EAEW,KAAA,EAAA,MAAA;AAEb,CAAA,EAAA,CAAa,CAAA,CAAA;AAQA,cAvBA,eAuBoF,EAvBpB,oCAAA,CAAjD,UAuBC,CAAA;EAChB,IAAA,EAAA,WAAA;EACA,KAAA,EAAA,MAAA;AACb,CAAA,EAAA,CAAa,CAAA,CAAA;AAMA,cA1BA,eA0BwE,EArBnF,oCAAA,CAL0B,UA0BI,CAAA;EACnB,IAAA,EAAA,WAAA;EACA,KAAA,EAAA,MAAA;EAKA,MAAA,EAAA,MAAA;EAUA,SAAA,CAAA,EAAA;IAKA,QAAA,CAAA,EAAA,OAIX;EAMW,CAAA;AAKb,CAAA,EAAA,CAAa,CAAA,CAAA;AAKA,cA7DA,gBA6DyE,EA7DW,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AAA,EAAA,iBAAwB;EACxB,SAAA,WAAA,EAAA,kBAAiC;EACjC,SAAA,UAAA,EAAA,iBAAgC;EAChC,SAAA,WAAA,EAAA,kBAA8B;EAC9B,SAAA,aAAA,EAAA,oBAAoC;EACpC,SAAA,SAAA,EAAA,gBAAuB;EACvB,SAAA,aAAA,EAAA,oBAAkC;;;;ECxG7B,SAAA,cAAS,EACf,qBAAY;EAOV,SAA+C,aAAA,EAAA,oBAAA;EAChD,SAAA,YAAU,EAAA,mBAAc;EAMpB,SAAA,UAAW,EAAA,iBAAiB;EAI5B,SAAA,gBAA0B,EAAA,uBAAmB;AAI7D,CAAA"}
@@ -1,294 +0,0 @@
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