@prisma/orm-family-sql 8.0.0-rc.17-dev.5 → 8.0.0-rc.17-dev.7
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/attribute-specs-15pm1Qvk.d.mts +106 -0
- package/dist/attribute-specs-15pm1Qvk.d.mts.map +1 -0
- package/dist/{authoring-type-constructors-0Iv2zdwS-CcpLSwei.mjs → authoring-type-constructors-0Iv2zdwS-hVVlzpLW.mjs} +2 -2
- package/dist/{authoring-type-constructors-0Iv2zdwS-CcpLSwei.mjs.map → authoring-type-constructors-0Iv2zdwS-hVVlzpLW.mjs.map} +1 -1
- package/dist/{contract-builder-DEtvdts6.mjs → contract-builder-BSipKPrc.mjs} +3 -3
- package/dist/{contract-builder-DEtvdts6.mjs.map → contract-builder-BSipKPrc.mjs.map} +1 -1
- package/dist/contract-prisma7__provider.mjs +2 -2
- package/dist/contract-psl.d.mts +2 -2
- package/dist/contract-psl.d.mts.map +1 -1
- package/dist/contract-psl.mjs +1 -1
- package/dist/contract-psl__attribute-specs.d.mts +2 -86
- package/dist/contract-psl__attribute-specs.mjs +1 -1
- package/dist/contract-psl__provider.mjs +1 -1
- package/dist/contract-psl__provider.mjs.map +1 -1
- package/dist/contract-ts.mjs +1 -1
- package/dist/contract-ts__contract-builder.mjs +1 -1
- package/dist/contract.d.mts +2 -2
- package/dist/contract.mjs +2 -2
- package/dist/contract__sql-expression.d.mts +2 -2
- package/dist/contract__sql-expression.mjs +2 -2
- package/dist/{control-BK2oKZmT.d.mts → control-3kVclzEh.d.mts} +20 -19
- package/dist/control-3kVclzEh.d.mts.map +1 -0
- package/dist/{control-4kwMnHYO.mjs → control-CXHnIBSV.mjs} +5 -5
- package/dist/{control-4kwMnHYO.mjs.map → control-CXHnIBSV.mjs.map} +1 -1
- package/dist/family.d.mts +5 -5
- package/dist/family.mjs +3 -3
- package/dist/family__control.d.mts +1 -1
- package/dist/family__control.mjs +2 -2
- package/dist/family__diff.mjs +1 -1
- package/dist/family__pack.d.mts +1 -1
- package/dist/family__pack.mjs +2 -2
- package/dist/family__psl-build.d.mts +2 -2
- package/dist/family__psl-build.mjs +1 -1
- package/dist/family__psl-infer.d.mts +1 -1
- package/dist/{interpreter-DlG-2o64-CDb20sM1.mjs → interpreter-BTM9k0wn-DPrWFd6h.mjs} +54 -26
- package/dist/interpreter-BTM9k0wn-DPrWFd6h.mjs.map +1 -0
- package/dist/orm-client.d.mts +20 -20
- package/dist/orm-client.d.mts.map +1 -1
- package/dist/orm-client.mjs +6 -6
- package/dist/orm-client.mjs.map +1 -1
- package/dist/{pack-D3L1b4Ag.d.mts → pack-g2rKoDhU.d.mts} +19 -18
- package/dist/pack-g2rKoDhU.d.mts.map +1 -0
- package/dist/{psl-build-C_n5uPZH.d.mts → psl-build-TrbDSGOA.d.mts} +2 -2
- package/dist/psl-build-TrbDSGOA.d.mts.map +1 -0
- package/dist/{psl-build-DTE03hcr.mjs → psl-build-vdqjrTx6.mjs} +7 -4
- package/dist/psl-build-vdqjrTx6.mjs.map +1 -0
- package/dist/{psl-column-resolution-CNtNJ7g7-DOrhyw4S.d.mts → psl-column-resolution-Dm5LhN9b-Bz-Ax2iC.d.mts} +2 -2
- package/dist/psl-column-resolution-Dm5LhN9b-Bz-Ax2iC.d.mts.map +1 -0
- package/dist/{psl-field-resolution-BW0ZuqBd--WxiBxb0.mjs → psl-field-resolution-CAJsUfST-BYuz5Nqh.mjs} +306 -284
- package/dist/psl-field-resolution-CAJsUfST-BYuz5Nqh.mjs.map +1 -0
- package/dist/{psl-infer-DsHE9xAU.d.mts → psl-infer-Dp_NzWE0.d.mts} +2 -2
- package/dist/{psl-infer-DsHE9xAU.d.mts.map → psl-infer-Dp_NzWE0.d.mts.map} +1 -1
- package/dist/{schema-verify-DIfHSB4I-k8l0LZZB.mjs → schema-verify-DIfHSB4I-CcxNNnKO.mjs} +2 -2
- package/dist/{schema-verify-DIfHSB4I-k8l0LZZB.mjs.map → schema-verify-DIfHSB4I-CcxNNnKO.mjs.map} +1 -1
- package/dist/{sql-expression-DE_MTt3T.d.mts → sql-expression-DWyTh9M1.d.mts} +10 -3
- package/dist/sql-expression-DWyTh9M1.d.mts.map +1 -0
- package/dist/{sql-expression-D7GsLgDM.mjs → sql-expression-Dek0jx_g.mjs} +17 -4
- package/dist/sql-expression-Dek0jx_g.mjs.map +1 -0
- package/dist/{type-map-3w0ieDAb-DiMpKEc2.d.mts → type-map-BMCZ_fb9-BTmWHQ-J.d.mts} +6 -3
- package/dist/type-map-BMCZ_fb9-BTmWHQ-J.d.mts.map +1 -0
- package/package.json +18 -18
- package/dist/contract-psl__attribute-specs.d.mts.map +0 -1
- package/dist/control-BK2oKZmT.d.mts.map +0 -1
- package/dist/interpreter-DlG-2o64-CDb20sM1.mjs.map +0 -1
- package/dist/pack-D3L1b4Ag.d.mts.map +0 -1
- package/dist/psl-build-C_n5uPZH.d.mts.map +0 -1
- package/dist/psl-build-DTE03hcr.mjs.map +0 -1
- package/dist/psl-column-resolution-CNtNJ7g7-DOrhyw4S.d.mts.map +0 -1
- package/dist/psl-field-resolution-BW0ZuqBd--WxiBxb0.mjs.map +0 -1
- package/dist/sql-expression-D7GsLgDM.mjs.map +0 -1
- package/dist/sql-expression-DE_MTt3T.d.mts.map +0 -1
- package/dist/type-map-3w0ieDAb-DiMpKEc2.d.mts.map +0 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { a as ParsedNullLiteral, i as EnumMemberListDefault, n as DefaultFunctionCall, r as EnumMemberDefault } from "./attribute-specs-15pm1Qvk.mjs";
|
|
1
2
|
import { t as sqlFamilyEnumSpec } from "./authoring-entity-types-CZ-vdwYS-BQPeBSla.mjs";
|
|
2
3
|
//#region ../../../2-sql/9-family/dist/pack.d.mts
|
|
3
4
|
//#region src/exports/pack.d.ts
|
|
@@ -237,58 +238,58 @@ declare const sqlFamilyPack: {
|
|
|
237
238
|
};
|
|
238
239
|
readonly attributeSpecs: {
|
|
239
240
|
readonly model: {
|
|
240
|
-
readonly map: () => import("@prisma/orm-framework/psl-parser").AttributeSpec<{
|
|
241
|
+
readonly map: (_ctx: import("@prisma/orm-framework/psl-parser").AttributeSpecContext) => import("@prisma/orm-framework/psl-parser").AttributeSpec<{
|
|
241
242
|
name: string;
|
|
242
243
|
}, import("@prisma/orm-framework/psl-parser").ModelAttributeCtx>;
|
|
243
|
-
readonly id: () => import("@prisma/orm-framework/psl-parser").AttributeSpec<{
|
|
244
|
+
readonly id: (_ctx: import("@prisma/orm-framework/psl-parser").AttributeSpecContext) => import("@prisma/orm-framework/psl-parser").AttributeSpec<{
|
|
244
245
|
fields: string[];
|
|
245
246
|
readonly map?: string;
|
|
246
247
|
}, import("@prisma/orm-framework/psl-parser").ModelAttributeCtx>;
|
|
247
|
-
readonly unique: () => import("@prisma/orm-framework/psl-parser").AttributeSpec<{
|
|
248
|
+
readonly unique: (_ctx: import("@prisma/orm-framework/psl-parser").AttributeSpecContext) => import("@prisma/orm-framework/psl-parser").AttributeSpec<{
|
|
248
249
|
fields: string[];
|
|
249
250
|
readonly map?: string;
|
|
250
251
|
}, import("@prisma/orm-framework/psl-parser").ModelAttributeCtx>;
|
|
251
|
-
readonly index: () => import("@prisma/orm-framework/psl-parser").AttributeSpec<{
|
|
252
|
+
readonly index: (ctx: import("@prisma/orm-framework/psl-parser").AttributeSpecContext) => import("@prisma/orm-framework/psl-parser").AttributeSpec<{
|
|
252
253
|
fields?: string[];
|
|
253
|
-
readonly expression?:
|
|
254
|
-
readonly where?:
|
|
254
|
+
readonly expression?: import("@prisma/orm-framework/psl-parser").ParsedTypedValue;
|
|
255
|
+
readonly where?: import("@prisma/orm-framework/psl-parser").ParsedTypedValue;
|
|
255
256
|
readonly unique?: boolean;
|
|
256
257
|
readonly name?: string;
|
|
257
258
|
readonly map?: string;
|
|
258
259
|
readonly type?: string;
|
|
259
260
|
readonly options?: Record<string, string>;
|
|
260
261
|
}, import("@prisma/orm-framework/psl-parser").ModelAttributeCtx>;
|
|
261
|
-
readonly check: () => import("@prisma/orm-framework/psl-parser").AttributeSpec<{
|
|
262
|
-
readonly expression:
|
|
262
|
+
readonly check: (ctx: import("@prisma/orm-framework/psl-parser").AttributeSpecContext) => import("@prisma/orm-framework/psl-parser").AttributeSpec<{
|
|
263
|
+
readonly expression: import("@prisma/orm-framework/psl-parser").ParsedTypedValue;
|
|
263
264
|
readonly name?: string;
|
|
264
265
|
readonly map?: string;
|
|
265
266
|
}, import("@prisma/orm-framework/psl-parser").ModelAttributeCtx>;
|
|
266
|
-
readonly control: () => import("@prisma/orm-framework/psl-parser").AttributeSpec<{
|
|
267
|
+
readonly control: (_ctx: import("@prisma/orm-framework/psl-parser").AttributeSpecContext) => import("@prisma/orm-framework/psl-parser").AttributeSpec<{
|
|
267
268
|
policy: "managed" | "tolerated" | "external" | "observed";
|
|
268
269
|
}, import("@prisma/orm-framework/psl-parser").ModelAttributeCtx>;
|
|
269
|
-
readonly discriminator: () => import("@prisma/orm-framework/psl-parser").AttributeSpec<{
|
|
270
|
+
readonly discriminator: (_ctx: import("@prisma/orm-framework/psl-parser").AttributeSpecContext) => import("@prisma/orm-framework/psl-parser").AttributeSpec<{
|
|
270
271
|
field: string;
|
|
271
272
|
}, import("@prisma/orm-framework/psl-parser").ModelAttributeCtx>;
|
|
272
|
-
readonly base: () => import("@prisma/orm-framework/psl-parser").AttributeSpec<{
|
|
273
|
+
readonly base: (_ctx: import("@prisma/orm-framework/psl-parser").AttributeSpecContext) => import("@prisma/orm-framework/psl-parser").AttributeSpec<{
|
|
273
274
|
base: import("@prisma/orm-framework/psl-parser").ResolvedEntityReference<import("@prisma/orm-framework/psl-parser").ModelSymbol>;
|
|
274
275
|
value: string;
|
|
275
276
|
}, import("@prisma/orm-framework/psl-parser").ModelAttributeCtx>;
|
|
276
277
|
};
|
|
277
278
|
readonly field: {
|
|
278
|
-
readonly map: () => import("@prisma/orm-framework/psl-parser").AttributeSpec<{
|
|
279
|
+
readonly map: (_ctx: import("@prisma/orm-framework/psl-parser").FieldAttributeSpecContext) => import("@prisma/orm-framework/psl-parser").AttributeSpec<{
|
|
279
280
|
name: string;
|
|
280
281
|
}, import("@prisma/orm-framework/psl-parser").FieldAttributeCtx>;
|
|
281
|
-
readonly id: () => import("@prisma/orm-framework/psl-parser").AttributeSpec<{
|
|
282
|
+
readonly id: (_ctx: import("@prisma/orm-framework/psl-parser").FieldAttributeSpecContext) => import("@prisma/orm-framework/psl-parser").AttributeSpec<{
|
|
282
283
|
readonly map?: string;
|
|
283
284
|
}, import("@prisma/orm-framework/psl-parser").FieldAttributeCtx>;
|
|
284
|
-
readonly unique: () => import("@prisma/orm-framework/psl-parser").AttributeSpec<{
|
|
285
|
+
readonly unique: (_ctx: import("@prisma/orm-framework/psl-parser").FieldAttributeSpecContext) => import("@prisma/orm-framework/psl-parser").AttributeSpec<{
|
|
285
286
|
readonly map?: string;
|
|
286
287
|
}, import("@prisma/orm-framework/psl-parser").FieldAttributeCtx>;
|
|
287
|
-
readonly noCheck: () => import("@prisma/orm-framework/psl-parser").AttributeSpec<{
|
|
288
|
+
readonly noCheck: (_ctx: import("@prisma/orm-framework/psl-parser").FieldAttributeSpecContext) => import("@prisma/orm-framework/psl-parser").AttributeSpec<{
|
|
288
289
|
first?: "membership" | "elementNotNull";
|
|
289
290
|
second?: "membership" | "elementNotNull";
|
|
290
291
|
}, import("@prisma/orm-framework/psl-parser").FieldAttributeCtx>;
|
|
291
|
-
readonly relation: () => import("@prisma/orm-framework/psl-parser").AttributeSpec<{
|
|
292
|
+
readonly relation: (_ctx: import("@prisma/orm-framework/psl-parser").FieldAttributeSpecContext) => import("@prisma/orm-framework/psl-parser").AttributeSpec<{
|
|
292
293
|
name?: string;
|
|
293
294
|
readonly fields?: string[];
|
|
294
295
|
readonly references?: string[];
|
|
@@ -298,7 +299,7 @@ declare const sqlFamilyPack: {
|
|
|
298
299
|
readonly index?: string | boolean;
|
|
299
300
|
}, import("@prisma/orm-framework/psl-parser").FieldAttributeCtx>;
|
|
300
301
|
readonly default: (ctx: import("@prisma/orm-framework/psl-parser").FieldAttributeSpecContext) => import("@prisma/orm-framework/psl-parser").AttributeSpec<{
|
|
301
|
-
value: import("@prisma/orm-framework/psl-parser").
|
|
302
|
+
value: import("@prisma/orm-framework/psl-parser").ParsedWrittenScalar | ParsedNullLiteral | import("@prisma/orm-framework/psl-parser").ParsedWrittenList<import("@prisma/orm-framework/psl-parser").ParsedWrittenScalar | ParsedNullLiteral> | DefaultFunctionCall | EnumMemberDefault | EnumMemberListDefault;
|
|
302
303
|
}, import("@prisma/orm-framework/psl-parser").FieldAttributeCtx>;
|
|
303
304
|
};
|
|
304
305
|
};
|
|
@@ -306,4 +307,4 @@ declare const sqlFamilyPack: {
|
|
|
306
307
|
};
|
|
307
308
|
//#endregion
|
|
308
309
|
export { sqlFamilyPack as t };
|
|
309
|
-
//# sourceMappingURL=pack-
|
|
310
|
+
//# sourceMappingURL=pack-g2rKoDhU.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pack-g2rKoDhU.d.mts","names":[],"sources":["../../../../2-sql/9-family/dist/pack.d.mts"],"mappings":";;;;cAEc;WACH;WACA;WACA;WACA;WACA;aACE;eACE;iBACE;iBACA;mBACE;mBACA;qBACE;;;;eAIN;iBACE;iBACA;mBACE;mBACA;qBACE;;;;eAIN;iBACE;iBACA;mBACE;mBACA;mBACA;qBACE;uBACE;uBACA;uBACA;uBACA;uBACA;;;;iBAIN;mBACE;mBACA;qBACE;uBACE;uBACA;uBACA;uBACA;;;;;eAKR;iBACE;iBACA;mBACE;mBACA;qBACE;;;;eAIN;iBACE;iBACA;mBACE;mBACA;qBACE;;;;eAIN;iBACE;mBACE;mBACA;qBACE;qBACA;uBACE;;qBAEF;uBACE;yBACE;yBACA;;;qBAGJ;;;iBAGJ;mBACE;mBACA;qBACE;qBACA;uBACE;;qBAEF;uBACE;yBACE;yBACA;;;qBAGJ;;;iBAGJ;mBACE;mBACA;qBACE;qBACA;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ACzG;0CACuB;iBACzB,UAAU,qCAAqC,6DAA6D;UACnH;UACA;0CACgC;iBACzB,WAAW,qCAAqC,6DAA6D;UACpH;mBACS;mBACA;mBACA;mBACA;mBACA;mBACA;0CACuB;iBACzB,UAAU,oCAAoC,6DAA6D;UAClH,sCAAsC,sBA1CnB,mDA0CiJ,iDAAiD,sBAApG,qBAA+K,sBAA0E,oBAA2E;0CACrZ"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./type-map-
|
|
1
|
+
import "./type-map-BMCZ_fb9-BTmWHQ-J.mjs";
|
|
2
2
|
//#region ../../../2-sql/9-family/dist/psl-build.d.mts
|
|
3
3
|
//#region src/core/psl-build/psl-names.d.ts
|
|
4
4
|
/**
|
|
@@ -10,4 +10,4 @@ import "./type-map-3w0ieDAb-DiMpKEc2.mjs";
|
|
|
10
10
|
declare function toEnumMemberName(value: string): string;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { toEnumMemberName as t };
|
|
13
|
-
//# sourceMappingURL=psl-build-
|
|
13
|
+
//# sourceMappingURL=psl-build-TrbDSGOA.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"psl-build-TrbDSGOA.d.mts","names":[],"sources":["../../../../2-sql/9-family/dist/psl-build.d.mts"],"mappings":";;;;;;;;;iBAQiB,iBAAiB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as numeralText } from "./numeral-text-Cqu87pVe-DJCqBaSC.mjs";
|
|
2
2
|
import { i as escapePslString } from "./data-type-support-Bu-VpT7z.mjs";
|
|
3
3
|
import { m as defaultInCanonicalForm } from "./types-D0GFxty0-CP8b4dR3.mjs";
|
|
4
|
-
import
|
|
4
|
+
import "./sql-expression-Dek0jx_g.mjs";
|
|
5
5
|
import { authoringEntryType, printTaggedLiteral } from "@prisma/orm-framework/components/authoring";
|
|
6
6
|
import { canonicalFormOf, dataTypeId } from "@prisma/orm-framework/components/codec";
|
|
7
7
|
//#region ../../../2-sql/9-family/dist/psl-build.mjs
|
|
@@ -11,7 +11,10 @@ const DEFAULT_FUNCTION_ATTRIBUTES = {
|
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
13
13
|
* The attribute a stored default prints as: a named function, a literal the column takes, or any
|
|
14
|
-
* other expression as a `sql` literal. `undefined` when a literal has no written form.
|
|
14
|
+
* other expression as a `sql` literal. `undefined` when a literal has no written form. An expression
|
|
15
|
+
* prints even when the literal would read back as different text: default expressions are compared
|
|
16
|
+
* with case and whitespace ignored (`resolvedDefaultsEqual`), and canonicalization changes only
|
|
17
|
+
* whitespace (ADR 129).
|
|
15
18
|
*/
|
|
16
19
|
function mapDefault(columnDefault, options) {
|
|
17
20
|
switch (columnDefault.kind) {
|
|
@@ -19,7 +22,7 @@ function mapDefault(columnDefault, options) {
|
|
|
19
22
|
const text = writeDefaultLiteral(columnDefault.value, options);
|
|
20
23
|
return text === void 0 ? void 0 : { attribute: `@default(${text})` };
|
|
21
24
|
}
|
|
22
|
-
case "function": return { attribute: options?.functionAttributes?.[columnDefault.expression] ?? DEFAULT_FUNCTION_ATTRIBUTES[columnDefault.expression] ?? `@default(${
|
|
25
|
+
case "function": return { attribute: options?.functionAttributes?.[columnDefault.expression] ?? DEFAULT_FUNCTION_ATTRIBUTES[columnDefault.expression] ?? `@default(${printTaggedLiteral("sql", columnDefault.expression)})` };
|
|
23
26
|
}
|
|
24
27
|
}
|
|
25
28
|
function writingSurface(entries) {
|
|
@@ -213,4 +216,4 @@ function sameForm(left, right) {
|
|
|
213
216
|
//#endregion
|
|
214
217
|
export { mapDefault as t };
|
|
215
218
|
|
|
216
|
-
//# sourceMappingURL=psl-build-
|
|
219
|
+
//# sourceMappingURL=psl-build-vdqjrTx6.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"psl-build-vdqjrTx6.mjs","names":[],"sources":["../../../../2-sql/9-family/dist/psl-build.mjs"],"sourcesContent":["import { s as toEnumMemberName } from \"./psl-names-C3cwe0rg.mjs\";\nimport { SQL_EXPRESSION_TAG } from \"@internal/sql-contract/sql-expression\";\nimport { authoringEntryType, printTaggedLiteral } from \"@internal/framework-components/authoring\";\nimport { canonicalFormOf, dataTypeId } from \"@internal/framework-components/codec\";\nimport { numeralText } from \"@internal/sql-contract/data-type\";\nimport { defaultInCanonicalForm } from \"@internal/sql-schema-ir/types\";\nimport { escapePslString } from \"@internal/sql-contract/data-type-support\";\n//#region src/core/psl-build/default-mapping.ts\nconst DEFAULT_FUNCTION_ATTRIBUTES = {\n\t\"autoincrement()\": \"@default(autoincrement())\",\n\t\"now()\": \"@default(now())\"\n};\n/**\n* The attribute a stored default prints as: a named function, a literal the column takes, or any\n* other expression as a `sql` literal. `undefined` when a literal has no written form. An expression\n* prints even when the literal would read back as different text: default expressions are compared\n* with case and whitespace ignored (`resolvedDefaultsEqual`), and canonicalization changes only\n* whitespace (ADR 129).\n*/\nfunction mapDefault(columnDefault, options) {\n\tswitch (columnDefault.kind) {\n\t\tcase \"literal\": {\n\t\t\tconst text = writeDefaultLiteral(columnDefault.value, options);\n\t\t\treturn text === void 0 ? void 0 : { attribute: `@default(${text})` };\n\t\t}\n\t\tcase \"function\": return { attribute: options?.functionAttributes?.[columnDefault.expression] ?? DEFAULT_FUNCTION_ATTRIBUTES[columnDefault.expression] ?? `@default(${printTaggedLiteral(SQL_EXPRESSION_TAG, columnDefault.expression)})` };\n\t}\n}\nfunction writingSurface(entries) {\n\tconst entryOf = /* @__PURE__ */ new Map();\n\tlet classify;\n\tlet plainStringType;\n\tlet plainBooleanType;\n\tconst tagTypes = [];\n\tfor (const [key, entry] of Object.entries(entries)) {\n\t\tconst written = entry.written;\n\t\tif (written.kind === \"tag\") {\n\t\t\tconst type = dataTypeId(authoringEntryType(key, entry));\n\t\t\tif (!entryOf.has(type)) entryOf.set(type, entry);\n\t\t\ttagTypes.push(type);\n\t\t\tcontinue;\n\t\t}\n\t\tif (written.syntax === \"number\") {\n\t\t\tclassify = written.classify;\n\t\t\tfor (const type of written.types) entryOf.set(type, entry);\n\t\t\tcontinue;\n\t\t}\n\t\tentryOf.set(key, entry);\n\t\tif (written.syntax === \"string\") plainStringType = dataTypeId(key);\n\t\telse plainBooleanType = dataTypeId(key);\n\t}\n\treturn {\n\t\tentryOf,\n\t\tclassify,\n\t\tplainStringType,\n\t\tplainBooleanType,\n\t\ttagTypes\n\t};\n}\n/**\n* Every type the stored form could be a value of, in the order a written value would be read: a\n* number or numeral text through the classifier first, then the plain syntax that matches the\n* shape, then each tag, whose canonical form is a whole document.\n*/\nfunction classifications(value, surface) {\n\tconst found = [];\n\tif (typeof value === \"number\") {\n\t\tconst classified = surface.classify?.(numeralText(value));\n\t\treturn classified === void 0 ? [] : [classified];\n\t}\n\tif (typeof value === \"boolean\") return surface.plainBooleanType === void 0 ? [] : [{\n\t\ttype: surface.plainBooleanType,\n\t\tvalue\n\t}];\n\tif (typeof value === \"string\") {\n\t\tconst classified = surface.classify?.(value);\n\t\tif (classified !== void 0) found.push(classified);\n\t\tif (surface.plainStringType !== void 0) found.push({\n\t\t\ttype: surface.plainStringType,\n\t\t\tvalue\n\t\t});\n\t}\n\tfor (const type of surface.tagTypes) found.push({\n\t\ttype,\n\t\tvalue\n\t});\n\treturn found;\n}\n/** The stored form the column takes this value as, or `undefined` when its type takes no such value. */\nfunction admitted(candidate, columnDataType, lookup) {\n\tif (candidate.type === columnDataType) return candidate.value;\n\tconst cast = lookup.get(columnDataType)?.casts[candidate.type];\n\tif (cast === void 0) return void 0;\n\ttry {\n\t\treturn cast(candidate.value);\n\t} catch {\n\t\treturn;\n\t}\n}\n/** The text of the literal: what the entry prints, before the syntax that fences it. */\nfunction printedText(entry, value) {\n\ttry {\n\t\treturn entry.print(value);\n\t} catch {\n\t\treturn;\n\t}\n}\n/** What the entry reads the printed text back as, which for a number is the classifier's answer. */\nfunction readBack(entry, type, text) {\n\tconst written = entry.written;\n\ttry {\n\t\treturn written.kind === \"plain\" && written.syntax === \"number\" ? written.classify(text) : {\n\t\t\ttype,\n\t\t\tvalue: written.parse(text)\n\t\t};\n\t} catch {\n\t\treturn;\n\t}\n}\nfunction literalText(entry, text) {\n\tconst written = entry.written;\n\tif (written.kind === \"tag\") return printTaggedLiteral(written.tag, text);\n\treturn written.syntax === \"string\" ? `\"${escapePslString(text)}\"` : text;\n}\n/**\n* The value written as the literal of one of its types, proven by reading the text straight back:\n* the same entry, the same cast, and the stored form again.\n*/\nfunction writeScalar(value, columnDataType, lookup, surface) {\n\tfor (const candidate of classifications(value, surface)) {\n\t\tconst entry = surface.entryOf.get(candidate.type);\n\t\tif (entry === void 0) continue;\n\t\tconst stored = admitted(candidate, columnDataType, lookup);\n\t\tif (stored === void 0 || !sameForm(stored, value)) continue;\n\t\tconst text = printedText(entry, candidate.value);\n\t\tif (text === void 0) continue;\n\t\tconst reread = readBack(entry, candidate.type, text);\n\t\tif (reread === void 0) continue;\n\t\tconst restored = admitted(reread, columnDataType, lookup);\n\t\tif (restored === void 0 || !sameForm(restored, value)) continue;\n\t\treturn literalText(entry, text);\n\t}\n}\n/** One written element of a list, printed as a value of any type, with no column type to admit it. */\nfunction writeElement(value, of, surface) {\n\tfor (const candidate of classifications(value, surface)) {\n\t\tif (!of.includes(candidate.type)) continue;\n\t\tconst entry = surface.entryOf.get(candidate.type);\n\t\tif (entry === void 0) continue;\n\t\tconst text = printedText(entry, candidate.value);\n\t\tif (text === void 0) continue;\n\t\tconst reread = readBack(entry, candidate.type, text);\n\t\tif (reread === void 0 || !of.includes(reread.type)) continue;\n\t\treturn {\n\t\t\ttext: literalText(entry, text),\n\t\t\tvalue: reread.value\n\t\t};\n\t}\n}\n/**\n* A written list on a scalar column, which the column type's list cast turns into its one value.\n* Each element is classified on its own and must be of a type the cast takes.\n*/\nfunction writeListCast(value, columnDataType, lookup, surface) {\n\tconst listCast = lookup.get(columnDataType)?.listCast;\n\tif (listCast === void 0) return void 0;\n\tconst parts = [];\n\tconst elements = [];\n\tfor (const element of value) {\n\t\tconst written = writeElement(element, listCast.of, surface);\n\t\tif (written === void 0) return void 0;\n\t\tparts.push(written.text);\n\t\telements.push(written.value);\n\t}\n\ttry {\n\t\tif (!sameForm(listCast.cast(elements), value)) return void 0;\n\t} catch {\n\t\treturn;\n\t}\n\treturn `[${parts.join(\", \")}]`;\n}\nfunction writeDefaultLiteral(stored, options) {\n\tif (stored instanceof Date) return void 0;\n\tconst { dataTypes, columnCodec } = options ?? {};\n\tif (dataTypes === void 0 || columnCodec === void 0) return void 0;\n\tconst { entries, lookup } = dataTypes;\n\tconst columnDataType = columnCodec.dataType;\n\tconst { value } = defaultInCanonicalForm(stored, canonicalFormOf(columnCodec, lookup), options?.list === true);\n\tif (value instanceof Date) return void 0;\n\tconst surface = writingSurface(entries);\n\tif (options?.list === true) {\n\t\tif (!Array.isArray(value)) return void 0;\n\t\tconst parts = [];\n\t\tfor (const element of value) {\n\t\t\tconst written = writeScalar(element, columnDataType, lookup, surface);\n\t\t\tif (written === void 0) return void 0;\n\t\t\tparts.push(written);\n\t\t}\n\t\treturn `[${parts.join(\", \")}]`;\n\t}\n\tconst written = writeScalar(value, columnDataType, lookup, surface);\n\tif (written !== void 0) return written;\n\treturn Array.isArray(value) ? writeListCast(value, columnDataType, lookup, surface) : void 0;\n}\n/** Whether two canonical forms are the same JSON value, member by member and element by element. */\nfunction sameForm(left, right) {\n\tif (left === right) return true;\n\tif (Array.isArray(left) !== Array.isArray(right)) return false;\n\tif (typeof left !== \"object\" || typeof right !== \"object\" || left === null || right === null) return false;\n\tconst members = Object.entries(left);\n\tconst others = new Map(Object.entries(right));\n\treturn members.length === others.size && members.every(([key, member]) => {\n\t\tconst other = others.get(key);\n\t\treturn other !== void 0 && sameForm(member, other);\n\t});\n}\n//#endregion\nexport { mapDefault, toEnumMemberName };\n\n//# sourceMappingURL=psl-build.mjs.map"],"mappings":";;;;;;;AAQA,MAAM,8BAA8B;CACnC,mBAAmB;CACnB,SAAS;AACV;;;;;;;;AAQA,SAAS,WAAW,eAAe,SAAS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AM,QAAQ,IAAI,MAAM,MAAM,QAAQ,KAAK,GAAG,OAAO;CACzD,IAAI,OAAO,SAAS,YAAY,OAAO,UAAU,YAAY,SAAS,QAAQ,UAAU,MAAM,OAAO;CACrG,MAAM,UAAU,OAAO,QAAQ,IAAI;CACnC,MAAM,SAAS,IAAI,IAAI,OAAO,QAAQ,KAAK,CAAC;CAC5C,OAAO,QAAQ,WAAW,OAAO,QAAQ,QAAQ,OAAO,CAAC,KAAK,YAAY;EACzE,MAAM,QAAQ,OAAO,IAAI,GAAG;EAC5B,OAAO,UAAU,KAAK,KAAK,SAAS,QAAQ,KAAK;CAClD,CAAC;AACF"}
|
|
@@ -4,7 +4,7 @@ import { CodecLookupWithDescriptors } from "@prisma/orm-framework/components/cod
|
|
|
4
4
|
import { ColumnDefault, ExecutionMutationDefaultPhases, ValueSetRef } from "@prisma/orm-framework/contract/types";
|
|
5
5
|
import "@prisma/orm-framework/components/control";
|
|
6
6
|
import "@prisma/orm-framework/psl-parser";
|
|
7
|
-
//#region ../../../2-sql/2-authoring/contract-psl/dist/psl-column-resolution-
|
|
7
|
+
//#region ../../../2-sql/2-authoring/contract-psl/dist/psl-column-resolution-Dm5LhN9b.d.mts
|
|
8
8
|
//#region src/psl-column-resolution.d.ts
|
|
9
9
|
type ColumnDescriptor = {
|
|
10
10
|
readonly codecId: string;
|
|
@@ -22,4 +22,4 @@ type ColumnDescriptor = {
|
|
|
22
22
|
};
|
|
23
23
|
//#endregion
|
|
24
24
|
export { ColumnDescriptor as t };
|
|
25
|
-
//# sourceMappingURL=psl-column-resolution-
|
|
25
|
+
//# sourceMappingURL=psl-column-resolution-Dm5LhN9b-Bz-Ax2iC.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"psl-column-resolution-Dm5LhN9b-Bz-Ax2iC.d.mts","names":[],"sources":["../../../../2-sql/2-authoring/contract-psl/dist/psl-column-resolution-Dm5LhN9b.d.mts"],"mappings":";;;;;;;;KAQK;WACM;WACA;WACA,aAAa;;;;;;;;;WASb,WAAW"}
|