@prisma-next/family-sql 0.13.0-dev.16 → 0.13.0-dev.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/authoring-type-constructors-M7Ejo4Lv.mjs +337 -0
- package/dist/authoring-type-constructors-M7Ejo4Lv.mjs.map +1 -0
- package/dist/control.d.mts +14 -1
- package/dist/control.d.mts.map +1 -1
- package/dist/control.mjs +6 -4
- package/dist/control.mjs.map +1 -1
- package/dist/ir.mjs +1 -1
- package/dist/pack.d.mts +13 -0
- package/dist/pack.d.mts.map +1 -1
- package/dist/pack.mjs +4 -2
- package/dist/pack.mjs.map +1 -1
- package/dist/schema-verify.mjs +1 -1
- package/dist/{sql-contract-serializer-CY7qnms7.mjs → sql-contract-serializer-DlmNUCRw.mjs} +2 -2
- package/dist/{sql-contract-serializer-CY7qnms7.mjs.map → sql-contract-serializer-DlmNUCRw.mjs.map} +1 -1
- package/dist/{verify-sql-schema-Dns8QyxY.mjs → verify-sql-schema-Dj8GrEZ-.mjs} +5 -5
- package/dist/verify-sql-schema-Dj8GrEZ-.mjs.map +1 -0
- package/package.json +21 -21
- package/src/core/authoring-entity-types.ts +178 -0
- package/src/core/control-descriptor.ts +3 -0
- package/src/core/migrations/contract-to-schema-ir.ts +4 -4
- package/src/exports/pack.ts +3 -0
- package/dist/authoring-type-constructors-D4lQ-qpj.mjs +0 -192
- package/dist/authoring-type-constructors-D4lQ-qpj.mjs.map +0 -1
- package/dist/verify-sql-schema-Dns8QyxY.mjs.map +0 -1
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
import { enumType } from "@prisma-next/sql-contract-ts/contract-builder";
|
|
2
|
+
import { blindCast } from "@prisma-next/utils/casts";
|
|
3
|
+
//#region src/core/authoring-entity-types.ts
|
|
4
|
+
function parseQuotedString(raw) {
|
|
5
|
+
if (raw.startsWith("\"") && raw.endsWith("\"") && raw.length >= 2) return raw.slice(1, -1);
|
|
6
|
+
}
|
|
7
|
+
const sqlFamilyEntityTypes = { enum2: {
|
|
8
|
+
kind: "entity",
|
|
9
|
+
discriminator: "enum2",
|
|
10
|
+
output: { factory: (block, ctx) => {
|
|
11
|
+
const sourceId = ctx.sourceId ?? "unknown";
|
|
12
|
+
const diagnostics = ctx.diagnostics;
|
|
13
|
+
const typeAttr = block.blockAttributes.find((a) => a.name === "type");
|
|
14
|
+
if (!typeAttr) {
|
|
15
|
+
diagnostics?.push({
|
|
16
|
+
code: "PSL_ENUM2_MISSING_TYPE",
|
|
17
|
+
message: `enum2 "${block.name}" is missing a @@type("codecId") attribute`,
|
|
18
|
+
sourceId,
|
|
19
|
+
span: block.span
|
|
20
|
+
});
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const rawCodecArg = typeAttr.args[0]?.value;
|
|
24
|
+
const codecId = rawCodecArg !== void 0 ? parseQuotedString(rawCodecArg) : void 0;
|
|
25
|
+
if (!codecId) {
|
|
26
|
+
diagnostics?.push({
|
|
27
|
+
code: "PSL_ENUM2_MISSING_TYPE",
|
|
28
|
+
message: `enum2 "${block.name}" @@type attribute must have a quoted codec id argument`,
|
|
29
|
+
sourceId,
|
|
30
|
+
span: typeAttr.span
|
|
31
|
+
});
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const nativeType = ctx.codecLookup?.targetTypesFor(codecId)?.[0];
|
|
35
|
+
if (nativeType === void 0) {
|
|
36
|
+
const typeArgSpan = typeAttr.args[0]?.span ?? typeAttr.span;
|
|
37
|
+
diagnostics?.push({
|
|
38
|
+
code: "PSL_EXTENSION_INVALID_VALUE",
|
|
39
|
+
message: `enum2 "${block.name}" @@type references unknown codec "${codecId}"`,
|
|
40
|
+
sourceId,
|
|
41
|
+
span: typeArgSpan
|
|
42
|
+
});
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
const codec = ctx.codecLookup?.get(codecId);
|
|
46
|
+
if (codec === void 0) {
|
|
47
|
+
const typeArgSpan = typeAttr.args[0]?.span ?? typeAttr.span;
|
|
48
|
+
diagnostics?.push({
|
|
49
|
+
code: "PSL_EXTENSION_INVALID_VALUE",
|
|
50
|
+
message: `enum2 "${block.name}" @@type codec "${codecId}" resolves in targetTypesFor but is absent from codecLookup.get`,
|
|
51
|
+
sourceId,
|
|
52
|
+
span: typeArgSpan
|
|
53
|
+
});
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
const seenValues = /* @__PURE__ */ new Set();
|
|
57
|
+
const members = [];
|
|
58
|
+
let memberError = false;
|
|
59
|
+
for (const [memberName, paramValue] of Object.entries(block.parameters)) {
|
|
60
|
+
let value;
|
|
61
|
+
if (paramValue.kind === "bare") try {
|
|
62
|
+
value = codec.decodeJson(memberName);
|
|
63
|
+
} catch {
|
|
64
|
+
diagnostics?.push({
|
|
65
|
+
code: "PSL_ENUM2_BARE_MEMBER_NON_STRING_CODEC",
|
|
66
|
+
message: `enum2 "${block.name}" member "${memberName}" has no value and codec "${codecId}" does not accept a bare name as input`,
|
|
67
|
+
sourceId,
|
|
68
|
+
span: paramValue.span
|
|
69
|
+
});
|
|
70
|
+
memberError = true;
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
else if (paramValue.kind === "value") {
|
|
74
|
+
let jsonValue;
|
|
75
|
+
try {
|
|
76
|
+
jsonValue = JSON.parse(paramValue.raw);
|
|
77
|
+
} catch {
|
|
78
|
+
diagnostics?.push({
|
|
79
|
+
code: "PSL_EXTENSION_INVALID_VALUE",
|
|
80
|
+
message: `enum2 "${block.name}" member "${memberName}" value "${paramValue.raw}" is not valid JSON`,
|
|
81
|
+
sourceId,
|
|
82
|
+
span: paramValue.span
|
|
83
|
+
});
|
|
84
|
+
memberError = true;
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
try {
|
|
88
|
+
value = codec.decodeJson(blindCast(jsonValue));
|
|
89
|
+
} catch (err) {
|
|
90
|
+
const reason = err instanceof Error ? err.message : String(err);
|
|
91
|
+
diagnostics?.push({
|
|
92
|
+
code: "PSL_EXTENSION_INVALID_VALUE",
|
|
93
|
+
message: `enum2 "${block.name}" member "${memberName}" was rejected by codec "${codecId}": ${reason}`,
|
|
94
|
+
sourceId,
|
|
95
|
+
span: paramValue.span
|
|
96
|
+
});
|
|
97
|
+
memberError = true;
|
|
98
|
+
continue;
|
|
99
|
+
}
|
|
100
|
+
} else continue;
|
|
101
|
+
const valueKey = String(value);
|
|
102
|
+
if (seenValues.has(valueKey)) {
|
|
103
|
+
diagnostics?.push({
|
|
104
|
+
code: "PSL_ENUM2_DUPLICATE_MEMBER_VALUE",
|
|
105
|
+
message: `enum2 "${block.name}": duplicate member value "${valueKey}"`,
|
|
106
|
+
sourceId,
|
|
107
|
+
span: paramValue.span
|
|
108
|
+
});
|
|
109
|
+
memberError = true;
|
|
110
|
+
continue;
|
|
111
|
+
}
|
|
112
|
+
seenValues.add(valueKey);
|
|
113
|
+
members.push({
|
|
114
|
+
name: memberName,
|
|
115
|
+
value
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
if (memberError) return void 0;
|
|
119
|
+
if (members.length === 0) {
|
|
120
|
+
diagnostics?.push({
|
|
121
|
+
code: "PSL_ENUM2_MISSING_TYPE",
|
|
122
|
+
message: `enum2 "${block.name}" must have at least one member`,
|
|
123
|
+
sourceId,
|
|
124
|
+
span: block.span
|
|
125
|
+
});
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
return enumType(block.name, {
|
|
129
|
+
codecId,
|
|
130
|
+
nativeType
|
|
131
|
+
}, ...members.map((m) => ({
|
|
132
|
+
name: m.name,
|
|
133
|
+
value: m.value
|
|
134
|
+
})));
|
|
135
|
+
} }
|
|
136
|
+
} };
|
|
137
|
+
const sqlFamilyPslBlockDescriptors = { enum2: {
|
|
138
|
+
kind: "pslBlock",
|
|
139
|
+
keyword: "enum2",
|
|
140
|
+
discriminator: "enum2",
|
|
141
|
+
name: { required: true },
|
|
142
|
+
parameters: {},
|
|
143
|
+
variadicParameters: true
|
|
144
|
+
} };
|
|
145
|
+
//#endregion
|
|
146
|
+
//#region src/core/authoring-field-presets.ts
|
|
147
|
+
/**
|
|
148
|
+
* Family-level SQL authoring field presets.
|
|
149
|
+
*
|
|
150
|
+
* Only presets whose codec IDs align with the ID generator metadata live here
|
|
151
|
+
* (see `@prisma-next/ids`). These presets are target-agnostic because the
|
|
152
|
+
* generator metadata fixes their codec/native-type to `sql/char@1`
|
|
153
|
+
* (`character`) regardless of target, and the PSL interpreter lets the
|
|
154
|
+
* generator override the scalar descriptor.
|
|
155
|
+
*
|
|
156
|
+
* Scalar presets that map to target-specific codecs (e.g. `text`, `int`,
|
|
157
|
+
* `boolean`, `dateTime`) are contributed by the target pack (see
|
|
158
|
+
* `postgresAuthoringFieldPresets` in `@prisma-next/target-postgres`) so the
|
|
159
|
+
* TS callback surface and the PSL scalar surface lower to byte-identical
|
|
160
|
+
* contracts for the active target.
|
|
161
|
+
*/
|
|
162
|
+
const CHARACTER_CODEC_ID = "sql/char@1";
|
|
163
|
+
const CHARACTER_NATIVE_TYPE = "character";
|
|
164
|
+
const nanoidOptionsArgument = {
|
|
165
|
+
kind: "object",
|
|
166
|
+
optional: true,
|
|
167
|
+
properties: { size: {
|
|
168
|
+
kind: "number",
|
|
169
|
+
optional: true,
|
|
170
|
+
integer: true,
|
|
171
|
+
minimum: 2,
|
|
172
|
+
maximum: 255
|
|
173
|
+
} }
|
|
174
|
+
};
|
|
175
|
+
const sqlFamilyAuthoringFieldPresets = {
|
|
176
|
+
uuid: {
|
|
177
|
+
kind: "fieldPreset",
|
|
178
|
+
output: {
|
|
179
|
+
codecId: CHARACTER_CODEC_ID,
|
|
180
|
+
nativeType: CHARACTER_NATIVE_TYPE,
|
|
181
|
+
typeParams: { length: 36 }
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
ulid: {
|
|
185
|
+
kind: "fieldPreset",
|
|
186
|
+
output: {
|
|
187
|
+
codecId: CHARACTER_CODEC_ID,
|
|
188
|
+
nativeType: CHARACTER_NATIVE_TYPE,
|
|
189
|
+
typeParams: { length: 26 }
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
nanoid: {
|
|
193
|
+
kind: "fieldPreset",
|
|
194
|
+
args: [nanoidOptionsArgument],
|
|
195
|
+
output: {
|
|
196
|
+
codecId: CHARACTER_CODEC_ID,
|
|
197
|
+
nativeType: CHARACTER_NATIVE_TYPE,
|
|
198
|
+
typeParams: { length: {
|
|
199
|
+
kind: "arg",
|
|
200
|
+
index: 0,
|
|
201
|
+
path: ["size"],
|
|
202
|
+
default: 21
|
|
203
|
+
} }
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
cuid2: {
|
|
207
|
+
kind: "fieldPreset",
|
|
208
|
+
output: {
|
|
209
|
+
codecId: CHARACTER_CODEC_ID,
|
|
210
|
+
nativeType: CHARACTER_NATIVE_TYPE,
|
|
211
|
+
typeParams: { length: 24 }
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
ksuid: {
|
|
215
|
+
kind: "fieldPreset",
|
|
216
|
+
output: {
|
|
217
|
+
codecId: CHARACTER_CODEC_ID,
|
|
218
|
+
nativeType: CHARACTER_NATIVE_TYPE,
|
|
219
|
+
typeParams: { length: 27 }
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
id: {
|
|
223
|
+
uuidv4: {
|
|
224
|
+
kind: "fieldPreset",
|
|
225
|
+
output: {
|
|
226
|
+
codecId: CHARACTER_CODEC_ID,
|
|
227
|
+
nativeType: CHARACTER_NATIVE_TYPE,
|
|
228
|
+
typeParams: { length: 36 },
|
|
229
|
+
executionDefaults: { onCreate: {
|
|
230
|
+
kind: "generator",
|
|
231
|
+
id: "uuidv4"
|
|
232
|
+
} },
|
|
233
|
+
id: true
|
|
234
|
+
}
|
|
235
|
+
},
|
|
236
|
+
uuidv7: {
|
|
237
|
+
kind: "fieldPreset",
|
|
238
|
+
output: {
|
|
239
|
+
codecId: CHARACTER_CODEC_ID,
|
|
240
|
+
nativeType: CHARACTER_NATIVE_TYPE,
|
|
241
|
+
typeParams: { length: 36 },
|
|
242
|
+
executionDefaults: { onCreate: {
|
|
243
|
+
kind: "generator",
|
|
244
|
+
id: "uuidv7"
|
|
245
|
+
} },
|
|
246
|
+
id: true
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
ulid: {
|
|
250
|
+
kind: "fieldPreset",
|
|
251
|
+
output: {
|
|
252
|
+
codecId: CHARACTER_CODEC_ID,
|
|
253
|
+
nativeType: CHARACTER_NATIVE_TYPE,
|
|
254
|
+
typeParams: { length: 26 },
|
|
255
|
+
executionDefaults: { onCreate: {
|
|
256
|
+
kind: "generator",
|
|
257
|
+
id: "ulid"
|
|
258
|
+
} },
|
|
259
|
+
id: true
|
|
260
|
+
}
|
|
261
|
+
},
|
|
262
|
+
nanoid: {
|
|
263
|
+
kind: "fieldPreset",
|
|
264
|
+
args: [nanoidOptionsArgument],
|
|
265
|
+
output: {
|
|
266
|
+
codecId: CHARACTER_CODEC_ID,
|
|
267
|
+
nativeType: CHARACTER_NATIVE_TYPE,
|
|
268
|
+
typeParams: { length: {
|
|
269
|
+
kind: "arg",
|
|
270
|
+
index: 0,
|
|
271
|
+
path: ["size"],
|
|
272
|
+
default: 21
|
|
273
|
+
} },
|
|
274
|
+
executionDefaults: { onCreate: {
|
|
275
|
+
kind: "generator",
|
|
276
|
+
id: "nanoid",
|
|
277
|
+
params: { size: {
|
|
278
|
+
kind: "arg",
|
|
279
|
+
index: 0,
|
|
280
|
+
path: ["size"]
|
|
281
|
+
} }
|
|
282
|
+
} },
|
|
283
|
+
id: true
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
cuid2: {
|
|
287
|
+
kind: "fieldPreset",
|
|
288
|
+
output: {
|
|
289
|
+
codecId: CHARACTER_CODEC_ID,
|
|
290
|
+
nativeType: CHARACTER_NATIVE_TYPE,
|
|
291
|
+
typeParams: { length: 24 },
|
|
292
|
+
executionDefaults: { onCreate: {
|
|
293
|
+
kind: "generator",
|
|
294
|
+
id: "cuid2"
|
|
295
|
+
} },
|
|
296
|
+
id: true
|
|
297
|
+
}
|
|
298
|
+
},
|
|
299
|
+
ksuid: {
|
|
300
|
+
kind: "fieldPreset",
|
|
301
|
+
output: {
|
|
302
|
+
codecId: CHARACTER_CODEC_ID,
|
|
303
|
+
nativeType: CHARACTER_NATIVE_TYPE,
|
|
304
|
+
typeParams: { length: 27 },
|
|
305
|
+
executionDefaults: { onCreate: {
|
|
306
|
+
kind: "generator",
|
|
307
|
+
id: "ksuid"
|
|
308
|
+
} },
|
|
309
|
+
id: true
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
};
|
|
314
|
+
//#endregion
|
|
315
|
+
//#region src/core/authoring-type-constructors.ts
|
|
316
|
+
const sqlFamilyAuthoringTypes = { sql: { String: {
|
|
317
|
+
kind: "typeConstructor",
|
|
318
|
+
args: [{
|
|
319
|
+
kind: "number",
|
|
320
|
+
name: "length",
|
|
321
|
+
integer: true,
|
|
322
|
+
minimum: 1,
|
|
323
|
+
maximum: 10485760
|
|
324
|
+
}],
|
|
325
|
+
output: {
|
|
326
|
+
codecId: "sql/varchar@1",
|
|
327
|
+
nativeType: "character varying",
|
|
328
|
+
typeParams: { length: {
|
|
329
|
+
kind: "arg",
|
|
330
|
+
index: 0
|
|
331
|
+
} }
|
|
332
|
+
}
|
|
333
|
+
} } };
|
|
334
|
+
//#endregion
|
|
335
|
+
export { sqlFamilyPslBlockDescriptors as i, sqlFamilyAuthoringFieldPresets as n, sqlFamilyEntityTypes as r, sqlFamilyAuthoringTypes as t };
|
|
336
|
+
|
|
337
|
+
//# sourceMappingURL=authoring-type-constructors-M7Ejo4Lv.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authoring-type-constructors-M7Ejo4Lv.mjs","names":[],"sources":["../src/core/authoring-entity-types.ts","../src/core/authoring-field-presets.ts","../src/core/authoring-type-constructors.ts"],"sourcesContent":["import type { JsonValue } from '@prisma-next/contract/types';\nimport type {\n AuthoringEntityContext,\n AuthoringEntityTypeDescriptor,\n AuthoringEntityTypeNamespace,\n AuthoringPslBlockDescriptorNamespace,\n PslExtensionBlock,\n} from '@prisma-next/framework-components/authoring';\nimport { type EnumTypeHandle, enumType } from '@prisma-next/sql-contract-ts/contract-builder';\nimport { blindCast } from '@prisma-next/utils/casts';\n\nfunction parseQuotedString(raw: string): string | undefined {\n if (raw.startsWith('\"') && raw.endsWith('\"') && raw.length >= 2) {\n return raw.slice(1, -1);\n }\n return undefined;\n}\n\nexport const sqlFamilyEnum2EntityDescriptor = {\n kind: 'entity' as const,\n discriminator: 'enum2',\n output: {\n factory: (\n block: PslExtensionBlock,\n ctx: AuthoringEntityContext,\n ): EnumTypeHandle | undefined => {\n const sourceId = ctx.sourceId ?? 'unknown';\n const diagnostics = ctx.diagnostics;\n\n const typeAttr = block.blockAttributes.find((a) => a.name === 'type');\n if (!typeAttr) {\n diagnostics?.push({\n code: 'PSL_ENUM2_MISSING_TYPE',\n message: `enum2 \"${block.name}\" is missing a @@type(\"codecId\") attribute`,\n sourceId,\n span: block.span,\n });\n return undefined;\n }\n\n const rawCodecArg = typeAttr.args[0]?.value;\n const codecId = rawCodecArg !== undefined ? parseQuotedString(rawCodecArg) : undefined;\n if (!codecId) {\n diagnostics?.push({\n code: 'PSL_ENUM2_MISSING_TYPE',\n message: `enum2 \"${block.name}\" @@type attribute must have a quoted codec id argument`,\n sourceId,\n span: typeAttr.span,\n });\n return undefined;\n }\n\n const nativeType = ctx.codecLookup?.targetTypesFor(codecId)?.[0];\n if (nativeType === undefined) {\n const typeArgSpan = typeAttr.args[0]?.span ?? typeAttr.span;\n diagnostics?.push({\n code: 'PSL_EXTENSION_INVALID_VALUE',\n message: `enum2 \"${block.name}\" @@type references unknown codec \"${codecId}\"`,\n sourceId,\n span: typeArgSpan,\n });\n return undefined;\n }\n\n const codec = ctx.codecLookup?.get(codecId);\n if (codec === undefined) {\n const typeArgSpan = typeAttr.args[0]?.span ?? typeAttr.span;\n diagnostics?.push({\n code: 'PSL_EXTENSION_INVALID_VALUE',\n message: `enum2 \"${block.name}\" @@type codec \"${codecId}\" resolves in targetTypesFor but is absent from codecLookup.get`,\n sourceId,\n span: typeArgSpan,\n });\n return undefined;\n }\n\n const seenValues = new Set<string>();\n const members: { name: string; value: unknown }[] = [];\n let memberError = false;\n\n for (const [memberName, paramValue] of Object.entries(block.parameters)) {\n let value: unknown;\n if (paramValue.kind === 'bare') {\n try {\n value = codec.decodeJson(memberName);\n } catch {\n diagnostics?.push({\n code: 'PSL_ENUM2_BARE_MEMBER_NON_STRING_CODEC',\n message: `enum2 \"${block.name}\" member \"${memberName}\" has no value and codec \"${codecId}\" does not accept a bare name as input`,\n sourceId,\n span: paramValue.span,\n });\n memberError = true;\n continue;\n }\n } else if (paramValue.kind === 'value') {\n let jsonValue: unknown;\n try {\n jsonValue = JSON.parse(paramValue.raw);\n } catch {\n diagnostics?.push({\n code: 'PSL_EXTENSION_INVALID_VALUE',\n message: `enum2 \"${block.name}\" member \"${memberName}\" value \"${paramValue.raw}\" is not valid JSON`,\n sourceId,\n span: paramValue.span,\n });\n memberError = true;\n continue;\n }\n try {\n value = codec.decodeJson(\n blindCast<JsonValue, 'JSON.parse returns a JsonValue-compatible value'>(jsonValue),\n );\n } catch (err) {\n const reason = err instanceof Error ? err.message : String(err);\n diagnostics?.push({\n code: 'PSL_EXTENSION_INVALID_VALUE',\n message: `enum2 \"${block.name}\" member \"${memberName}\" was rejected by codec \"${codecId}\": ${reason}`,\n sourceId,\n span: paramValue.span,\n });\n memberError = true;\n continue;\n }\n } else {\n continue;\n }\n\n const valueKey = String(value);\n if (seenValues.has(valueKey)) {\n diagnostics?.push({\n code: 'PSL_ENUM2_DUPLICATE_MEMBER_VALUE',\n message: `enum2 \"${block.name}\": duplicate member value \"${valueKey}\"`,\n sourceId,\n span: paramValue.span,\n });\n memberError = true;\n continue;\n }\n seenValues.add(valueKey);\n members.push({ name: memberName, value });\n }\n\n if (memberError) return undefined;\n\n if (members.length === 0) {\n diagnostics?.push({\n code: 'PSL_ENUM2_MISSING_TYPE',\n message: `enum2 \"${block.name}\" must have at least one member`,\n sourceId,\n span: block.span,\n });\n return undefined;\n }\n\n return enumType(\n block.name,\n { codecId, nativeType },\n ...members.map((m) => ({ name: m.name, value: m.value })),\n );\n },\n },\n} satisfies AuthoringEntityTypeDescriptor;\n\nexport const sqlFamilyEntityTypes: AuthoringEntityTypeNamespace = {\n enum2: sqlFamilyEnum2EntityDescriptor,\n};\n\nexport const sqlFamilyPslBlockDescriptors = {\n enum2: {\n kind: 'pslBlock',\n keyword: 'enum2',\n discriminator: 'enum2',\n name: { required: true },\n parameters: {},\n variadicParameters: true,\n },\n} as const satisfies AuthoringPslBlockDescriptorNamespace;\n","import type { AuthoringFieldNamespace } from '@prisma-next/framework-components/authoring';\n\n/**\n * Family-level SQL authoring field presets.\n *\n * Only presets whose codec IDs align with the ID generator metadata live here\n * (see `@prisma-next/ids`). These presets are target-agnostic because the\n * generator metadata fixes their codec/native-type to `sql/char@1`\n * (`character`) regardless of target, and the PSL interpreter lets the\n * generator override the scalar descriptor.\n *\n * Scalar presets that map to target-specific codecs (e.g. `text`, `int`,\n * `boolean`, `dateTime`) are contributed by the target pack (see\n * `postgresAuthoringFieldPresets` in `@prisma-next/target-postgres`) so the\n * TS callback surface and the PSL scalar surface lower to byte-identical\n * contracts for the active target.\n */\n\nconst CHARACTER_CODEC_ID = 'sql/char@1';\nconst CHARACTER_NATIVE_TYPE = 'character';\n\nconst nanoidOptionsArgument = {\n kind: 'object',\n optional: true,\n properties: {\n size: {\n kind: 'number',\n optional: true,\n integer: true,\n minimum: 2,\n maximum: 255,\n },\n },\n} as const;\n\nexport const sqlFamilyAuthoringFieldPresets = {\n uuid: {\n kind: 'fieldPreset',\n output: {\n codecId: CHARACTER_CODEC_ID,\n nativeType: CHARACTER_NATIVE_TYPE,\n typeParams: {\n length: 36,\n },\n },\n },\n ulid: {\n kind: 'fieldPreset',\n output: {\n codecId: CHARACTER_CODEC_ID,\n nativeType: CHARACTER_NATIVE_TYPE,\n typeParams: {\n length: 26,\n },\n },\n },\n nanoid: {\n kind: 'fieldPreset',\n args: [nanoidOptionsArgument],\n output: {\n codecId: CHARACTER_CODEC_ID,\n nativeType: CHARACTER_NATIVE_TYPE,\n typeParams: {\n length: {\n kind: 'arg',\n index: 0,\n path: ['size'],\n default: 21,\n },\n },\n },\n },\n cuid2: {\n kind: 'fieldPreset',\n output: {\n codecId: CHARACTER_CODEC_ID,\n nativeType: CHARACTER_NATIVE_TYPE,\n typeParams: {\n length: 24,\n },\n },\n },\n ksuid: {\n kind: 'fieldPreset',\n output: {\n codecId: CHARACTER_CODEC_ID,\n nativeType: CHARACTER_NATIVE_TYPE,\n typeParams: {\n length: 27,\n },\n },\n },\n id: {\n uuidv4: {\n kind: 'fieldPreset',\n output: {\n codecId: CHARACTER_CODEC_ID,\n nativeType: CHARACTER_NATIVE_TYPE,\n typeParams: {\n length: 36,\n },\n executionDefaults: {\n onCreate: {\n kind: 'generator',\n id: 'uuidv4',\n },\n },\n id: true,\n },\n },\n uuidv7: {\n kind: 'fieldPreset',\n output: {\n codecId: CHARACTER_CODEC_ID,\n nativeType: CHARACTER_NATIVE_TYPE,\n typeParams: {\n length: 36,\n },\n executionDefaults: {\n onCreate: {\n kind: 'generator',\n id: 'uuidv7',\n },\n },\n id: true,\n },\n },\n ulid: {\n kind: 'fieldPreset',\n output: {\n codecId: CHARACTER_CODEC_ID,\n nativeType: CHARACTER_NATIVE_TYPE,\n typeParams: {\n length: 26,\n },\n executionDefaults: {\n onCreate: {\n kind: 'generator',\n id: 'ulid',\n },\n },\n id: true,\n },\n },\n nanoid: {\n kind: 'fieldPreset',\n args: [nanoidOptionsArgument],\n output: {\n codecId: CHARACTER_CODEC_ID,\n nativeType: CHARACTER_NATIVE_TYPE,\n typeParams: {\n length: {\n kind: 'arg',\n index: 0,\n path: ['size'],\n default: 21,\n },\n },\n executionDefaults: {\n onCreate: {\n kind: 'generator',\n id: 'nanoid',\n params: {\n size: {\n kind: 'arg',\n index: 0,\n path: ['size'],\n },\n },\n },\n },\n id: true,\n },\n },\n cuid2: {\n kind: 'fieldPreset',\n output: {\n codecId: CHARACTER_CODEC_ID,\n nativeType: CHARACTER_NATIVE_TYPE,\n typeParams: {\n length: 24,\n },\n executionDefaults: {\n onCreate: {\n kind: 'generator',\n id: 'cuid2',\n },\n },\n id: true,\n },\n },\n ksuid: {\n kind: 'fieldPreset',\n output: {\n codecId: CHARACTER_CODEC_ID,\n nativeType: CHARACTER_NATIVE_TYPE,\n typeParams: {\n length: 27,\n },\n executionDefaults: {\n onCreate: {\n kind: 'generator',\n id: 'ksuid',\n },\n },\n id: true,\n },\n },\n },\n} as const satisfies AuthoringFieldNamespace;\n","import type { AuthoringTypeNamespace } from '@prisma-next/framework-components/authoring';\n\nexport const sqlFamilyAuthoringTypes = {\n sql: {\n String: {\n kind: 'typeConstructor',\n args: [{ kind: 'number', name: 'length', integer: true, minimum: 1, maximum: 10485760 }],\n output: {\n codecId: 'sql/varchar@1',\n nativeType: 'character varying',\n typeParams: {\n length: { kind: 'arg', index: 0 },\n },\n },\n },\n },\n} as const satisfies AuthoringTypeNamespace;\n"],"mappings":";;;AAWA,SAAS,kBAAkB,KAAiC;CAC1D,IAAI,IAAI,WAAW,IAAG,KAAK,IAAI,SAAS,IAAG,KAAK,IAAI,UAAU,GAC5D,OAAO,IAAI,MAAM,GAAG,EAAE;AAG1B;AAoJA,MAAa,uBAAqD,EAChE,OAAO;CAlJP,MAAM;CACN,eAAe;CACf,QAAQ,EACN,UACE,OACA,QAC+B;EAC/B,MAAM,WAAW,IAAI,YAAY;EACjC,MAAM,cAAc,IAAI;EAExB,MAAM,WAAW,MAAM,gBAAgB,MAAM,MAAM,EAAE,SAAS,MAAM;EACpE,IAAI,CAAC,UAAU;GACb,aAAa,KAAK;IAChB,MAAM;IACN,SAAS,UAAU,MAAM,KAAK;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EACF;EACA,QAAQ;GACN,MAAM;GACN,MAAM,CAAC,qBAAqB;GAC5B,QAAQ;IACN,SAAS;IACT,YAAY;IACZ,YAAY,EACV,QAAQ;KACN,MAAM;KACN,OAAO;KACP,MAAM,CAAC,MAAM;KACb,SAAS;IACX,EACF;IACA,mBAAmB,EACjB,UAAU;KACR,MAAM;KACN,IAAI;KACJ,QAAQ,EACN,MAAM;MACJ,MAAM;MACN,OAAO;MACP,MAAM,CAAC,MAAM;KACf,EACF;IACF,EACF;IACA,IAAI;GACN;EACF;EACA,OAAO;GACL,MAAM;GACN,QAAQ;IACN,SAAS;IACT,YAAY;IACZ,YAAY,EACV,QAAQ,GACV;IACA,mBAAmB,EACjB,UAAU;KACR,MAAM;KACN,IAAI;IACN,EACF;IACA,IAAI;GACN;EACF;EACA,OAAO;GACL,MAAM;GACN,QAAQ;IACN,SAAS;IACT,YAAY;IACZ,YAAY,EACV,QAAQ,GACV;IACA,mBAAmB,EACjB,UAAU;KACR,MAAM;KACN,IAAI;IACN,EACF;IACA,IAAI;GACN;EACF;CACF;AACF;;;AC/MA,MAAa,0BAA0B,EACrC,KAAK,EACH,QAAQ;CACN,MAAM;CACN,MAAM,CAAC;EAAE,MAAM;EAAU,MAAM;EAAU,SAAS;EAAM,SAAS;EAAG,SAAS;CAAS,CAAC;CACvF,QAAQ;EACN,SAAS;EACT,YAAY;EACZ,YAAY,EACV,QAAQ;GAAE,MAAM;GAAO,OAAO;EAAE,EAClC;CACF;AACF,EACF,EACF"}
|
package/dist/control.d.mts
CHANGED
|
@@ -238,6 +238,19 @@ declare class SqlFamilyDescriptor implements ControlFamilyDescriptor<'sql', SqlC
|
|
|
238
238
|
};
|
|
239
239
|
};
|
|
240
240
|
};
|
|
241
|
+
readonly entityTypes: import("@prisma-next/framework-components/authoring").AuthoringEntityTypeNamespace;
|
|
242
|
+
readonly pslBlockDescriptors: {
|
|
243
|
+
readonly enum2: {
|
|
244
|
+
readonly kind: "pslBlock";
|
|
245
|
+
readonly keyword: "enum2";
|
|
246
|
+
readonly discriminator: "enum2";
|
|
247
|
+
readonly name: {
|
|
248
|
+
readonly required: true;
|
|
249
|
+
};
|
|
250
|
+
readonly parameters: {};
|
|
251
|
+
readonly variadicParameters: true;
|
|
252
|
+
};
|
|
253
|
+
};
|
|
241
254
|
};
|
|
242
255
|
create<TTargetId extends string>(stack: ControlStack<'sql', TTargetId>): SqlControlFamilyInstance;
|
|
243
256
|
}
|
|
@@ -287,7 +300,7 @@ type DefaultRenderer = (def: ColumnDefault, column: StorageColumn) => string;
|
|
|
287
300
|
type EnumNamespaceSchemaResolver = (storage: SqlStorage, namespaceId: string) => string;
|
|
288
301
|
declare function resolveValueSetValues(ref: {
|
|
289
302
|
readonly namespaceId: string;
|
|
290
|
-
readonly
|
|
303
|
+
readonly entityName: string;
|
|
291
304
|
}, storage: SqlStorage, contextLabel: string): readonly string[];
|
|
292
305
|
/**
|
|
293
306
|
* Detects destructive changes between two contract storages.
|
package/dist/control.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control.d.mts","names":[],"sources":["../src/core/control-descriptor.ts","../src/core/assembly.ts","../src/core/migrations/contract-to-schema-ir.ts","../src/core/migrations/control-policy.ts","../src/core/migrations/field-event-planner.ts","../src/core/migrations/plan-helpers.ts","../src/core/migrations/policies.ts","../src/core/timestamp-now-generator.ts","../src/exports/control.ts"],"mappings":";;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"control.d.mts","names":[],"sources":["../src/core/control-descriptor.ts","../src/core/assembly.ts","../src/core/migrations/contract-to-schema-ir.ts","../src/core/migrations/control-policy.ts","../src/core/migrations/field-event-planner.ts","../src/core/migrations/plan-helpers.ts","../src/core/migrations/policies.ts","../src/core/timestamp-now-generator.ts","../src/exports/control.ts"],"mappings":";;;;;;;;;;cAWa,mBAAA,YACA,uBAAA,QAA+B,wBAAA;EAAA,SAEjC,IAAA;EAAA,SACA,EAAA;EAAA,SACA,QAAA;EAAA,SACA,O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A,iBACd,OAAA,EAAS,6BAAA,CAA8B,cAAA,IACtC,gBAAA,CAAiB,cAAA;AAAA,iBAcJ,cAAA,iBACd,IAAA,EAAM,gBAAA,CAAiB,cAAA,GACvB,QAAA,YAAoB,kBAAA,KACnB,uBAAA,CAAwB,cAAA;AAAA,iBAsBX,cAAA,CAAe,SAAA,WAAoB,kBAAA,KAAuB,uBAAuB;;;;iBAoBjF,aAAA,CAAc,KAAA;EAC5B,iBAAA;EACA,kBAAA;AAAA,IACE,EAAE,CAAC,8BAAA;;;;iBAYS,aAAA,CACd,IAAA,EAAM,2BAAA,EACN,OAAA,UACA,OAAA;EAAY,GAAA;EAAc,IAAA,GAAO,SAAA;AAAA,IAChC,KAAA,CAAM,yBAAA;;;;;;cC1KI,oBAAA,EAAsB,0BAEjC;;;;;;;;;;;;;;iBCoBc,6BAAA,IAAiC,kCAAkC;;;;;;;;;;;iBAqBnE,wBAAA,gEAGd,KAAA;EAAA,SAAkB,OAAA,EAAS,OAAA;EAAA,SAAkB,UAAA,EAAY,UAAA;AAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cC6BlB,QAAA"}
|
package/dist/control.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as sqlFamilyAuthoringFieldPresets, t as sqlFamilyAuthoringTypes } from "./authoring-type-constructors-
|
|
2
|
-
import { t as SqlContractSerializer } from "./sql-contract-serializer-
|
|
3
|
-
import { a as contractToSchemaIR, c as extractCodecControlHooks, o as detectDestructiveChanges, s as resolveValueSetValues, t as verifySqlSchema } from "./verify-sql-schema-
|
|
1
|
+
import { i as sqlFamilyPslBlockDescriptors, n as sqlFamilyAuthoringFieldPresets, r as sqlFamilyEntityTypes, t as sqlFamilyAuthoringTypes } from "./authoring-type-constructors-M7Ejo4Lv.mjs";
|
|
2
|
+
import { t as SqlContractSerializer } from "./sql-contract-serializer-DlmNUCRw.mjs";
|
|
3
|
+
import { a as contractToSchemaIR, c as extractCodecControlHooks, o as detectDestructiveChanges, s as resolveValueSetValues, t as verifySqlSchema } from "./verify-sql-schema-Dj8GrEZ-.mjs";
|
|
4
4
|
import { t as collectSupportedCodecTypeIds } from "./verify-C-G0obRm.mjs";
|
|
5
5
|
import { n as temporalAuthoringPresets, r as timestampNowControlDescriptor } from "./timestamp-now-generator-CloimujU.mjs";
|
|
6
6
|
import { sqlEmission } from "@prisma-next/sql-contract-emitter";
|
|
@@ -1495,7 +1495,9 @@ var SqlFamilyDescriptor = class {
|
|
|
1495
1495
|
emission = sqlEmission;
|
|
1496
1496
|
authoring = {
|
|
1497
1497
|
field: sqlFamilyAuthoringFieldPresets,
|
|
1498
|
-
type: sqlFamilyAuthoringTypes
|
|
1498
|
+
type: sqlFamilyAuthoringTypes,
|
|
1499
|
+
entityTypes: sqlFamilyEntityTypes,
|
|
1500
|
+
pslBlockDescriptors: sqlFamilyPslBlockDescriptors
|
|
1499
1501
|
};
|
|
1500
1502
|
create(stack) {
|
|
1501
1503
|
return createSqlFamilyInstance(stack);
|