@prisma/orm-family-sql 8.0.0-rc.11-dev.42 → 8.0.0-rc.11-dev.43
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/{ast-BHZ0g4iL.d.mts → ast-d2-iNoEs.d.mts} +72 -10
- package/dist/ast-d2-iNoEs.d.mts.map +1 -0
- package/dist/{ast-C8jX7HNs.mjs → ast-um6jG7BL.mjs} +129 -8
- package/dist/ast-um6jG7BL.mjs.map +1 -0
- package/dist/{authoring-type-constructors-C1ogrr_x-BeSS93gc.mjs → authoring-type-constructors-C1ogrr_x-VWDkCaSq.mjs} +2 -2
- package/dist/{authoring-type-constructors-C1ogrr_x-BeSS93gc.mjs.map → authoring-type-constructors-C1ogrr_x-VWDkCaSq.mjs.map} +1 -1
- package/dist/builder.d.mts +2 -2
- package/dist/builder__runtime.d.mts +8 -8
- package/dist/builder__types.d.mts +2 -2
- package/dist/{config-types-C-rrJ_8P.d.mts → config-types-Bd3ud-mX.d.mts} +3 -3
- package/dist/{config-types-C-rrJ_8P.d.mts.map → config-types-Bd3ud-mX.d.mts.map} +1 -1
- package/dist/{config-types-B98UYjF0.mjs → config-types-fwqTEhK6.mjs} +2 -2
- package/dist/{config-types-B98UYjF0.mjs.map → config-types-fwqTEhK6.mjs.map} +1 -1
- package/dist/{contract-builder-DV-DZX4h.d.mts → contract-builder-BHCjHphC.d.mts} +12 -5
- package/dist/{contract-builder-DV-DZX4h.d.mts.map → contract-builder-BHCjHphC.d.mts.map} +1 -1
- package/dist/{contract-builder-BCqPVNbs.mjs → contract-builder-BgWPuVYv.mjs} +2 -2
- package/dist/{contract-builder-BCqPVNbs.mjs.map → contract-builder-BgWPuVYv.mjs.map} +1 -1
- package/dist/contract-prisma7__provider.d.mts +1 -1
- package/dist/contract-prisma7__provider.mjs +118 -48
- package/dist/contract-prisma7__provider.mjs.map +1 -1
- package/dist/contract-psl.d.mts +10 -6
- package/dist/contract-psl.d.mts.map +1 -1
- package/dist/contract-psl.mjs +1 -1
- package/dist/contract-psl__attribute-specs.d.mts +3 -2
- package/dist/contract-psl__attribute-specs.d.mts.map +1 -1
- package/dist/contract-psl__attribute-specs.mjs +1 -1
- package/dist/contract-psl__provider.d.mts +1 -1
- package/dist/contract-psl__provider.mjs +3 -2
- package/dist/contract-psl__provider.mjs.map +1 -1
- package/dist/contract-ts.d.mts +3 -3
- package/dist/contract-ts.mjs +3 -3
- package/dist/contract-ts__config-types.d.mts +1 -1
- package/dist/contract-ts__config-types.mjs +1 -1
- package/dist/contract-ts__contract-builder.d.mts +2 -2
- package/dist/contract-ts__contract-builder.mjs +2 -2
- package/dist/contract.d.mts +5 -5
- package/dist/contract__factories.d.mts +1 -1
- package/dist/contract__index-type-validation.d.mts +1 -1
- package/dist/contract__types.d.mts +2 -2
- package/dist/contract__validators.d.mts +1 -1
- package/dist/{control-Cijy1SHG.mjs → control-Ber3kz3q.mjs} +11 -6
- package/dist/{control-Cijy1SHG.mjs.map → control-Ber3kz3q.mjs.map} +1 -1
- package/dist/{control-C9oCqe39.d.mts → control-CkJbZTUB.d.mts} +20 -17
- package/dist/control-CkJbZTUB.d.mts.map +1 -0
- package/dist/{control-adapter-C99J7aEF-B2G4GA5s.d.mts → control-adapter-C99J7aEF-DwFChl8n.d.mts} +8 -8
- package/dist/{control-adapter-C99J7aEF-B2G4GA5s.d.mts.map → control-adapter-C99J7aEF-DwFChl8n.d.mts.map} +1 -1
- package/dist/control-adapter-DPWKLNdH.d.mts +1 -0
- package/dist/{db-BhQdL6Za-Dod07quT.d.mts → db-BhQdL6Za-BBgu_awF.d.mts} +8 -8
- package/dist/{db-BhQdL6Za-Dod07quT.d.mts.map → db-BhQdL6Za-BBgu_awF.d.mts.map} +1 -1
- package/dist/{ddl-types-BGdnAbXo-DKPHPUGx.mjs → ddl-types-DOgOmDOh-Cs_MY05h.mjs} +2 -2
- package/dist/{ddl-types-BGdnAbXo-DKPHPUGx.mjs.map → ddl-types-DOgOmDOh-Cs_MY05h.mjs.map} +1 -1
- package/dist/{ddl-types-Biy7miT--CSyPnOHq.d.mts → ddl-types-DrK8E0jL-ClX_UkVh.d.mts} +4 -4
- package/dist/{ddl-types-Biy7miT--CSyPnOHq.d.mts.map → ddl-types-DrK8E0jL-ClX_UkVh.d.mts.map} +1 -1
- package/dist/{derived-checks-C4BPtrnO-B9MQRh6W.mjs → derived-checks-6WZKIUxH-B3Pd6QA5.mjs} +30 -12
- package/dist/derived-checks-6WZKIUxH-B3Pd6QA5.mjs.map +1 -0
- package/dist/{derived-checks-DPdD01O0-DCKdvxNK.d.mts → derived-checks-DPdD01O0-DNBs1ZDA.d.mts} +2 -2
- package/dist/{derived-checks-DPdD01O0-DCKdvxNK.d.mts.map → derived-checks-DPdD01O0-DNBs1ZDA.d.mts.map} +1 -1
- package/dist/{diff-CwozLSiO.d.mts → diff-C9tzE_nE.d.mts} +7 -7
- package/dist/{diff-CwozLSiO.d.mts.map → diff-C9tzE_nE.d.mts.map} +1 -1
- package/dist/{expression-CTADTPZW.d.mts → expression-CAJjmssr.d.mts} +6 -6
- package/dist/{expression-CTADTPZW.d.mts.map → expression-CAJjmssr.d.mts.map} +1 -1
- package/dist/{factories-B9PfKd5k.d.mts → factories-P3qBQhO-.d.mts} +2 -2
- package/dist/{factories-B9PfKd5k.d.mts.map → factories-P3qBQhO-.d.mts.map} +1 -1
- package/dist/family.d.mts +11 -11
- package/dist/family.mjs +2 -2
- package/dist/family__control-adapter.d.mts +2 -2
- package/dist/family__control.d.mts +4 -4
- package/dist/family__control.mjs +1 -1
- package/dist/family__diff.d.mts +2 -2
- package/dist/family__ir.d.mts +1 -1
- package/dist/family__migration.d.mts +1 -1
- package/dist/family__pack.d.mts +1 -1
- package/dist/family__pack.d.mts.map +1 -1
- package/dist/family__pack.mjs +2 -2
- package/dist/family__psl-infer.d.mts +1 -1
- package/dist/family__psl-infer.mjs +1 -1
- package/dist/family__runtime.d.mts +1 -1
- package/dist/{index-C6_--MKi.d.mts → index-CLAshwKN.d.mts} +3 -3
- package/dist/{index-C6_--MKi.d.mts.map → index-CLAshwKN.d.mts.map} +1 -1
- package/dist/{index-CA_WLNy1.d.mts → index-DI6YpxCw.d.mts} +10 -10
- package/dist/{index-CA_WLNy1.d.mts.map → index-DI6YpxCw.d.mts.map} +1 -1
- package/dist/{index-type-validation-BFiTwZub.d.mts → index-type-validation-CZ5L2lli.d.mts} +2 -2
- package/dist/{index-type-validation-BFiTwZub.d.mts.map → index-type-validation-CZ5L2lli.d.mts.map} +1 -1
- package/dist/{interpreter-Bf7Um__3-DC_thY44.mjs → interpreter-DvKii7Bl-D8Ipte3f.mjs} +463 -104
- package/dist/interpreter-DvKii7Bl-D8Ipte3f.mjs.map +1 -0
- package/dist/{ir-CodnAisu.d.mts → ir-BJ-dsbe-.d.mts} +2 -2
- package/dist/{ir-CodnAisu.d.mts.map → ir-BJ-dsbe-.d.mts.map} +1 -1
- package/dist/{middleware-0yjzaoBT-BqmCD6Dt.d.mts → middleware-CHg6zJkn-DJAKnDpd.d.mts} +3 -3
- package/dist/{middleware-0yjzaoBT-BqmCD6Dt.d.mts.map → middleware-CHg6zJkn-DJAKnDpd.d.mts.map} +1 -1
- package/dist/middleware-wyJe8dVq.d.mts +1 -0
- package/dist/{migration-CniGZoFt.d.mts → migration-BQWwBE8Q.d.mts} +3 -3
- package/dist/{migration-CniGZoFt.d.mts.map → migration-BQWwBE8Q.d.mts.map} +1 -1
- package/dist/operations.d.mts +1 -1
- package/dist/orm-client.d.mts +13 -13
- package/dist/orm-client.mjs +1 -1
- package/dist/{plan-Bs-Pdirc-BCy94--G.d.mts → plan-DVkrl9Pq-DOf_eQ84.d.mts} +4 -4
- package/dist/plan-DVkrl9Pq-DOf_eQ84.d.mts.map +1 -0
- package/dist/plan-Dzq6Nwb4.d.mts +2 -0
- package/dist/{prepared-statement-DZtymlzd-DFIuG_WK.d.mts → prepared-statement-DZtymlzd-DmbP44p0.d.mts} +15 -15
- package/dist/{prepared-statement-DZtymlzd-DFIuG_WK.d.mts.map → prepared-statement-DZtymlzd-DmbP44p0.d.mts.map} +1 -1
- package/dist/{psl-infer-6p4x9ebN.mjs → psl-infer-BAbdN_ZR.mjs} +195 -13
- package/dist/psl-infer-BAbdN_ZR.mjs.map +1 -0
- package/dist/{psl-infer-CLZsT2Hz.d.mts → psl-infer-DQCWvJtk.d.mts} +16 -3
- package/dist/psl-infer-DQCWvJtk.d.mts.map +1 -0
- package/dist/{query-lane-context-QIUURgPP-CvQ9jQRm.d.mts → query-lane-context-BUNC86DS-C_hIrqaW.d.mts} +6 -6
- package/dist/{query-lane-context-QIUURgPP-CvQ9jQRm.d.mts.map → query-lane-context-BUNC86DS-C_hIrqaW.d.mts.map} +1 -1
- package/dist/query-lane-context-CeOxBL6I.d.mts +1 -0
- package/dist/relational-core.d.mts +12 -12
- package/dist/relational-core.mjs +3 -3
- package/dist/relational-core__aggregate-descriptor-registry.d.mts +1 -1
- package/dist/relational-core__ast.d.mts +4 -4
- package/dist/relational-core__ast.mjs +3 -3
- package/dist/relational-core__codec-descriptor-registry.d.mts +3 -3
- package/dist/relational-core__contract-free.d.mts +3 -3
- package/dist/relational-core__contract-free.mjs +1 -1
- package/dist/relational-core__contract-free.mjs.map +1 -1
- package/dist/relational-core__expression.d.mts +1 -1
- package/dist/relational-core__middleware.d.mts +2 -2
- package/dist/relational-core__plan.d.mts +3 -3
- package/dist/relational-core__query-lane-context.d.mts +2 -2
- package/dist/relational-core__types.d.mts +2 -2
- package/dist/{runtime-gCSNgykk.d.mts → runtime-BqAUXvAl.d.mts} +3 -3
- package/dist/{runtime-gCSNgykk.d.mts.map → runtime-BqAUXvAl.d.mts.map} +1 -1
- package/dist/runtime.d.mts +4 -4
- package/dist/runtime.mjs +1 -1
- package/dist/runtime__internal__prepared-query.d.mts +1 -1
- package/dist/{schema-differ-DpG_gnur-DrAcUO68.d.mts → schema-differ-DpG_gnur-CXVM1Oed.d.mts} +4 -4
- package/dist/{schema-differ-DpG_gnur-DrAcUO68.d.mts.map → schema-differ-DpG_gnur-CXVM1Oed.d.mts.map} +1 -1
- package/dist/schema-ir.d.mts +1 -1
- package/dist/schema-ir__types.d.mts +2 -2
- package/dist/{sql-attribute-specs-DAEpjrWl-C0kmaUJt.mjs → sql-attribute-specs-CQoOV2MU-DLD9uxC6.mjs} +16 -8
- package/dist/sql-attribute-specs-CQoOV2MU-DLD9uxC6.mjs.map +1 -0
- package/dist/{sql-execution-plan-S3HvDKIP-8KF1nBHu.d.mts → sql-execution-plan-DBvAsaOB-LUMcfRpN.d.mts} +3 -3
- package/dist/sql-execution-plan-DBvAsaOB-LUMcfRpN.d.mts.map +1 -0
- package/dist/{types-BDUG29Df-DRoC4zw1.d.mts → types-BDUG29Df-LE85dIXP.d.mts} +2 -2
- package/dist/{types-BDUG29Df-DRoC4zw1.d.mts.map → types-BDUG29Df-LE85dIXP.d.mts.map} +1 -1
- package/dist/{types-BFPRCYGW-CvvVz-AC.d.mts → types-BFPRCYGW-CBv60DKI.d.mts} +7 -7
- package/dist/{types-BFPRCYGW-CvvVz-AC.d.mts.map → types-BFPRCYGW-CBv60DKI.d.mts.map} +1 -1
- package/dist/{types-CRU1CBUk-CR2_opbw.d.mts → types-BLVS175T-DmpY58Nx.d.mts} +9 -9
- package/dist/{types-CRU1CBUk-CR2_opbw.d.mts.map → types-BLVS175T-DmpY58Nx.d.mts.map} +1 -1
- package/dist/types-BijNazlM.d.mts +1 -0
- package/dist/{types-BmgtemBx.d.mts → types-C36_3E6_.d.mts} +2 -2
- package/dist/{types-BmgtemBx.d.mts.map → types-C36_3E6_.d.mts.map} +1 -1
- package/dist/{types-CHOgKgHg-DMlDrQz6.d.mts → types-CHOgKgHg-BxgkL3GS.d.mts} +2 -2
- package/dist/{types-CHOgKgHg-DMlDrQz6.d.mts.map → types-CHOgKgHg-BxgkL3GS.d.mts.map} +1 -1
- package/dist/types-CQ8FfvRk.d.mts +1 -0
- package/dist/{types-BXSw7th1-pL1Iggyd.d.mts → types-YGX78yVc-BBy1pp_1.d.mts} +7 -5
- package/dist/types-YGX78yVc-BBy1pp_1.d.mts.map +1 -0
- package/dist/{validators-DvtOcB04.d.mts → validators-CJSyNFS4.d.mts} +2 -2
- package/dist/{validators-DvtOcB04.d.mts.map → validators-CJSyNFS4.d.mts.map} +1 -1
- package/package.json +18 -18
- package/dist/ast-BHZ0g4iL.d.mts.map +0 -1
- package/dist/ast-C8jX7HNs.mjs.map +0 -1
- package/dist/control-C9oCqe39.d.mts.map +0 -1
- package/dist/control-adapter-Bx5ZQKj-.d.mts +0 -1
- package/dist/derived-checks-C4BPtrnO-B9MQRh6W.mjs.map +0 -1
- package/dist/interpreter-Bf7Um__3-DC_thY44.mjs.map +0 -1
- package/dist/middleware-Di3_d2T5.d.mts +0 -1
- package/dist/plan-BEJGOQ-l.d.mts +0 -2
- package/dist/plan-Bs-Pdirc-BCy94--G.d.mts.map +0 -1
- package/dist/psl-infer-6p4x9ebN.mjs.map +0 -1
- package/dist/psl-infer-CLZsT2Hz.d.mts.map +0 -1
- package/dist/query-lane-context-yy5kDAlG.d.mts +0 -1
- package/dist/sql-attribute-specs-DAEpjrWl-C0kmaUJt.mjs.map +0 -1
- package/dist/sql-execution-plan-S3HvDKIP-8KF1nBHu.d.mts.map +0 -1
- package/dist/types-BXSw7th1-pL1Iggyd.d.mts.map +0 -1
- package/dist/types-D3XRY_cO.d.mts +0 -1
- package/dist/types-RPn42d0t.d.mts +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { dt as LoweredStatement, h as AnyQueryAst, m as AnyParamRef } from "./types-YGX78yVc-BBy1pp_1.mjs";
|
|
2
2
|
import { c as SqlQueryable } from "./driver-types-BQtRkOJ0-Bv2RPSfr.mjs";
|
|
3
|
-
import "./ddl-types-
|
|
3
|
+
import "./ddl-types-DrK8E0jL-ClX_UkVh.mjs";
|
|
4
4
|
import { ContractMarkerRecord, JsonValue } from "@prisma/orm-framework/contract/types";
|
|
5
|
-
import { CodecCallContext,
|
|
5
|
+
import { CodecCallContext, CodecDescriptorTemplateImpl, CodecImpl, CodecInstanceContext, DataTypeId } from "@prisma/orm-framework/components/codec";
|
|
6
6
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
7
7
|
//#region ../../../2-sql/4-lanes/relational-core/dist/exports/ast.d.mts
|
|
8
8
|
//#region src/ast/adapter-types.d.ts
|
|
@@ -43,6 +43,68 @@ interface Adapter<Ast = unknown, TContract = unknown, TBody = LoweredStatement>
|
|
|
43
43
|
lower(ast: Ast, context: LowererContext<TContract>): TBody;
|
|
44
44
|
}
|
|
45
45
|
//#endregion
|
|
46
|
+
//#region src/ast/data-type-support.d.ts
|
|
47
|
+
/** Whether `text` is a whole number or a decimal as a contract source writes one. */
|
|
48
|
+
declare function isNumeralText(text: string): boolean;
|
|
49
|
+
/** Whether `text` is one of the three words a floating-point value is written as. */
|
|
50
|
+
declare function isNonFiniteText(text: string): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* A written numeral as the contract stores it. Leading zeros and the sign of zero never change a
|
|
53
|
+
* number, so they go; trailing zeros stay, because a type without a scale keeps them.
|
|
54
|
+
*/
|
|
55
|
+
declare function canonicalNumeralText(text: string): string;
|
|
56
|
+
/**
|
|
57
|
+
* A number as a contract source writes it: no exponent, because no schema language has that syntax,
|
|
58
|
+
* so the decimal point moves to where the exponent puts it. A non-finite number is its own word.
|
|
59
|
+
*/
|
|
60
|
+
declare function numeralText(value: number): string;
|
|
61
|
+
/** A string as a contract source writes it, with the escapes its string reader resolves. */
|
|
62
|
+
declare function escapePslString(value: string): string;
|
|
63
|
+
/** Which data type a written number is, and whether that type stores it as a number or as text. */
|
|
64
|
+
interface NumberClassification {
|
|
65
|
+
readonly type: DataTypeId;
|
|
66
|
+
readonly form: 'number' | 'text';
|
|
67
|
+
}
|
|
68
|
+
/** One integer type and the range of whole numbers it holds. */
|
|
69
|
+
interface IntegerStep extends NumberClassification {
|
|
70
|
+
readonly min: bigint;
|
|
71
|
+
readonly max: bigint;
|
|
72
|
+
}
|
|
73
|
+
/** The range of a signed integer of `bits` bits. */
|
|
74
|
+
declare function signedRange(bits: number): {
|
|
75
|
+
readonly min: bigint;
|
|
76
|
+
readonly max: bigint;
|
|
77
|
+
};
|
|
78
|
+
interface NumberClassifierSpec {
|
|
79
|
+
/** Tried in order; the first whose range holds the digits wins. */
|
|
80
|
+
readonly integers: readonly IntegerStep[];
|
|
81
|
+
/** A whole number no step holds. Absent means the target has no type for it. */
|
|
82
|
+
readonly largerWhole?: NumberClassification | undefined;
|
|
83
|
+
/** A number with a fraction. Absent means the target has no type for it. */
|
|
84
|
+
readonly fraction?: NumberClassification | undefined;
|
|
85
|
+
/** `NaN`, `Infinity` and `-Infinity`. Absent means the target has no type for them. */
|
|
86
|
+
readonly words?: NumberClassification | undefined;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* The classifier one target's plain-number authoring entry carries: it reads the digits and says
|
|
90
|
+
* which of the target's types the value is, in that type's canonical form. `undefined` means no
|
|
91
|
+
* type of this target holds the number.
|
|
92
|
+
*/
|
|
93
|
+
declare function createNumberClassifier(spec: NumberClassifierSpec): (text: string) => {
|
|
94
|
+
readonly type: DataTypeId;
|
|
95
|
+
readonly value: JsonValue;
|
|
96
|
+
} | undefined;
|
|
97
|
+
/**
|
|
98
|
+
* Read a JSON body into the document it holds.
|
|
99
|
+
*
|
|
100
|
+
* `JSON.parse` reads a numeral too large for a double as `Infinity`, and `JSON.stringify` writes
|
|
101
|
+
* that back as `null`, so a document holding one would not be the document stored; it is refused
|
|
102
|
+
* here instead, naming where the number is.
|
|
103
|
+
*/
|
|
104
|
+
declare function parseJsonBody(text: string): JsonValue;
|
|
105
|
+
/** Write a document as the body of a JSON literal. */
|
|
106
|
+
declare function printJsonBody(value: JsonValue): string;
|
|
107
|
+
//#endregion
|
|
46
108
|
//#region src/ast/sql-codec-helpers.d.ts
|
|
47
109
|
declare const SQL_CHAR_CODEC_ID: "sql/char@1";
|
|
48
110
|
declare const SQL_VARCHAR_CODEC_ID: "sql/varchar@1";
|
|
@@ -84,7 +146,7 @@ declare class SqlTextCodec extends CodecImpl<typeof SQL_TEXT_CODEC_ID, readonly
|
|
|
84
146
|
encodeJson(value: string): JsonValue;
|
|
85
147
|
decodeJson(json: JsonValue): string;
|
|
86
148
|
}
|
|
87
|
-
declare class SqlTextDescriptor extends
|
|
149
|
+
declare class SqlTextDescriptor extends CodecDescriptorTemplateImpl<void> {
|
|
88
150
|
readonly codecId: "sql/text@1";
|
|
89
151
|
readonly traits: readonly ["equality", "order", "textual"];
|
|
90
152
|
readonly targetTypes: readonly ["text"];
|
|
@@ -99,7 +161,7 @@ declare class SqlIntCodec extends CodecImpl<typeof SQL_INT_CODEC_ID, readonly ['
|
|
|
99
161
|
encodeJson(value: number): JsonValue;
|
|
100
162
|
decodeJson(json: JsonValue): number;
|
|
101
163
|
}
|
|
102
|
-
declare class SqlIntDescriptor extends
|
|
164
|
+
declare class SqlIntDescriptor extends CodecDescriptorTemplateImpl<void> {
|
|
103
165
|
readonly codecId: "sql/int@1";
|
|
104
166
|
readonly traits: readonly ["equality", "order", "numeric"];
|
|
105
167
|
readonly targetTypes: readonly ["int"];
|
|
@@ -114,7 +176,7 @@ declare class SqlFloatCodec extends CodecImpl<typeof SQL_FLOAT_CODEC_ID, readonl
|
|
|
114
176
|
encodeJson(value: number): JsonValue;
|
|
115
177
|
decodeJson(json: JsonValue): number;
|
|
116
178
|
}
|
|
117
|
-
declare class SqlFloatDescriptor extends
|
|
179
|
+
declare class SqlFloatDescriptor extends CodecDescriptorTemplateImpl<void> {
|
|
118
180
|
readonly codecId: "sql/float@1";
|
|
119
181
|
readonly traits: readonly ["equality", "order", "numeric"];
|
|
120
182
|
readonly targetTypes: readonly ["float"];
|
|
@@ -129,7 +191,7 @@ declare class SqlCharCodec extends CodecImpl<typeof SQL_CHAR_CODEC_ID, readonly
|
|
|
129
191
|
encodeJson(value: string): JsonValue;
|
|
130
192
|
decodeJson(json: JsonValue): string;
|
|
131
193
|
}
|
|
132
|
-
declare class SqlCharDescriptor extends
|
|
194
|
+
declare class SqlCharDescriptor extends CodecDescriptorTemplateImpl<LengthParams> {
|
|
133
195
|
readonly codecId: "sql/char@1";
|
|
134
196
|
readonly traits: readonly ["equality", "order", "textual"];
|
|
135
197
|
readonly targetTypes: readonly ["char"];
|
|
@@ -145,7 +207,7 @@ declare class SqlVarcharCodec extends CodecImpl<typeof SQL_VARCHAR_CODEC_ID, rea
|
|
|
145
207
|
encodeJson(value: string): JsonValue;
|
|
146
208
|
decodeJson(json: JsonValue): string;
|
|
147
209
|
}
|
|
148
|
-
declare class SqlVarcharDescriptor extends
|
|
210
|
+
declare class SqlVarcharDescriptor extends CodecDescriptorTemplateImpl<LengthParams> {
|
|
149
211
|
readonly codecId: "sql/varchar@1";
|
|
150
212
|
readonly traits: readonly ["equality", "order", "textual"];
|
|
151
213
|
readonly targetTypes: readonly ["varchar"];
|
|
@@ -170,5 +232,5 @@ declare function compact<T extends Record<string, unknown>>(o: T): T;
|
|
|
170
232
|
*/
|
|
171
233
|
declare function collectOrderedParamRefs(ast: AnyQueryAst): ReadonlyArray<AnyParamRef>;
|
|
172
234
|
//#endregion
|
|
173
|
-
export {
|
|
174
|
-
//# sourceMappingURL=ast-
|
|
235
|
+
export { sqlTextDescriptor as $, isNonFiniteText as A, sqlCharRenderOutputType as B, SqlVarcharCodec as C, compact as D, collectOrderedParamRefs as E, signedRange as F, sqlFloatEncode as G, sqlFloatDecode as H, sqlCharColumn as I, sqlIntDecode as J, sqlFloatEncodeJson as K, sqlCharDecode as L, numeralText as M, parseJsonBody as N, createNumberClassifier as O, printJsonBody as P, sqlTextDecode as Q, sqlCharDescriptor as R, SqlTextDescriptor as S, canonicalNumeralText as T, sqlFloatDecodeJson as U, sqlFloatColumn as V, sqlFloatDescriptor as W, sqlIntEncode as X, sqlIntDescriptor as Y, sqlTextColumn as Z, SqlFloatCodec as _, Lowerer as a, sqlVarcharRenderOutputType as at, SqlIntDescriptor as b, NumberClassification as c, SQL_FLOAT_CODEC_ID as d, sqlTextEncode as et, SQL_INT_CODEC_ID as f, SqlCharDescriptor as g, SqlCharCodec as h, IntegerStep as i, sqlVarcharEncode as it, isNumeralText as j, escapePslString as k, NumberClassifierSpec as l, SQL_VARCHAR_CODEC_ID as m, AdapterProfile as n, sqlVarcharDecode as nt, LowererContext as o, SQL_TEXT_CODEC_ID as p, sqlIntColumn as q, AdapterTarget as r, sqlVarcharDescriptor as rt, MarkerReadResult as s, Adapter as t, sqlVarcharColumn as tt, SQL_CHAR_CODEC_ID as u, SqlFloatDescriptor as v, SqlVarcharDescriptor as w, SqlTextCodec as x, SqlIntCodec as y, sqlCharEncode as z };
|
|
236
|
+
//# sourceMappingURL=ast-d2-iNoEs.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ast-d2-iNoEs.d.mts","names":[],"sources":["../../../../2-sql/4-lanes/relational-core/dist/exports/ast.d.mts"],"mappings":";;;;;;;;KAOK;;;;;;;KAOA;WACM;WACA,QAAQ;;WAER;;WAEA;;UAED,eAAe,gBAAgB,gBAAgB;WAC9C;WACA,QAAQ;WACR,cAAc;;;;EAIvB,WAAW,WAAW,eAAe,QAAQ;;UAErC,eAAe;WACd,UAAU;WACV;;KAEN,QAAQ,eAAe,qBAAqB,QAAQ,qBAAqB,KAAK,KAAK,SAAS,eAAe,eAAe;;;;UAIrH,QAAQ,eAAe,qBAAqB,QAAQ;WACnD,SAAS;EAClB,MAAM,KAAK,KAAK,SAAS,eAAe,aAAa;;;;;iBAKtC,cAAc;;iBAEd,gBAAgB;;;;;iBAKhB,qBAAqB;;;;;iBAKrB,YAAY;;iBAEZ,gBAAgB;;UAEvB;WACC,MAAM;WACN;;;UAGD,oBAAoB;WACnB;WACA;;;iBAGM,YAAY;WAClB;WACA;;UAED;;WAEC,mBAAmB;;WAEnB,cAAc;;WAEd,WAAW;;WAEX,QAAQ;;;;;;;iBAOF,uBAAu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WACA;WACA;WACA,cAAc,iBAAiB;EACxC,iBAAiB,QAAQ;EACzB,QAAQ,SAAS,gBAAgB,KAAK,yBAAyB;;cAEnD,mBAAmB;cACnB,gBAAgB,SAAS,gEAAgE,WAAW,cAAc;cAClH,wBAAwB,iBAAiB;EACrD,OAAO,eAAe,MAAM,mBAAqB;EACjD,OAAO,cAAc,MAAM,mBAAqB;EAChD,WAAW,gBAAgB;EAC3B,WAAW,MAAM;;cAEL,6BAA6B,4BAA4B;WAC5D;WACA;WACA;WACA,cAAc,iBAAiB;EACxC,iBAAiB,QAAQ;EACzB,QAAQ,SAAS,gBAAgB,KAAK,yBAAyB;;cAEnD,sBAAsB;cACtB,mBAAmB,SAAS,gEAAgE,WAAW,iBAAiB;;;iBAGrH,QAAQ,UAAU,yBAAyB,GAAG,IAAI;;;;;;;;;;;iBAWlD,wBAAwB,KAAK,cAAc,cAAc"}
|
|
@@ -1,8 +1,129 @@
|
|
|
1
1
|
import { B as frozenCodecRef } from "./types-ZNKYVjLr-DzjvSHKB.mjs";
|
|
2
2
|
import { structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
3
3
|
import { type } from "arktype";
|
|
4
|
-
import {
|
|
4
|
+
import { CodecDescriptorTemplateImpl, CodecImpl, column, voidParamsSchema } from "@prisma/orm-framework/components/codec";
|
|
5
5
|
//#region ../../../2-sql/4-lanes/relational-core/dist/exports/ast.mjs
|
|
6
|
+
const INTEGER_TEXT = /^-?\d+$/;
|
|
7
|
+
const DECIMAL_TEXT = /^-?\d+\.\d+$/;
|
|
8
|
+
const NON_FINITE_WORDS = /* @__PURE__ */ new Set([
|
|
9
|
+
"NaN",
|
|
10
|
+
"Infinity",
|
|
11
|
+
"-Infinity"
|
|
12
|
+
]);
|
|
13
|
+
const DECIMAL_NUMERAL = /^(-?)0*(\d+)(\.\d+)?$/;
|
|
14
|
+
/** Whether `text` is a whole number or a decimal as a contract source writes one. */
|
|
15
|
+
function isNumeralText(text) {
|
|
16
|
+
return INTEGER_TEXT.test(text) || DECIMAL_TEXT.test(text);
|
|
17
|
+
}
|
|
18
|
+
/** Whether `text` is one of the three words a floating-point value is written as. */
|
|
19
|
+
function isNonFiniteText(text) {
|
|
20
|
+
return NON_FINITE_WORDS.has(text);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* A written numeral as the contract stores it. Leading zeros and the sign of zero never change a
|
|
24
|
+
* number, so they go; trailing zeros stay, because a type without a scale keeps them.
|
|
25
|
+
*/
|
|
26
|
+
function canonicalNumeralText(text) {
|
|
27
|
+
const numeral = DECIMAL_NUMERAL.exec(text);
|
|
28
|
+
if (numeral === null) return text;
|
|
29
|
+
const [, sign = "", whole = "", fraction = ""] = numeral;
|
|
30
|
+
const digits = `${whole}${fraction}`;
|
|
31
|
+
return /^[0.]+$/.test(digits) ? digits : `${sign}${digits}`;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* A number as a contract source writes it: no exponent, because no schema language has that syntax,
|
|
35
|
+
* so the decimal point moves to where the exponent puts it. A non-finite number is its own word.
|
|
36
|
+
*/
|
|
37
|
+
function numeralText(value) {
|
|
38
|
+
const [coefficient = "", exponent] = String(value).split("e");
|
|
39
|
+
if (exponent === void 0) return coefficient;
|
|
40
|
+
const sign = coefficient.startsWith("-") ? "-" : "";
|
|
41
|
+
const [whole = "", fraction = ""] = coefficient.slice(sign.length).split(".");
|
|
42
|
+
const digits = `${whole}${fraction}`;
|
|
43
|
+
const point = whole.length + Number(exponent);
|
|
44
|
+
if (point <= 0) return `${sign}0.${"0".repeat(-point)}${digits}`;
|
|
45
|
+
if (point >= digits.length) return `${sign}${digits}${"0".repeat(point - digits.length)}`;
|
|
46
|
+
return `${sign}${digits.slice(0, point)}.${digits.slice(point)}`;
|
|
47
|
+
}
|
|
48
|
+
/** A string as a contract source writes it, with the escapes its string reader resolves. */
|
|
49
|
+
function escapePslString(value) {
|
|
50
|
+
return value.replace(/\\/g, "\\\\").replace(/"/g, "\\\"").replace(/\n/g, "\\n").replace(/\r/g, "\\r");
|
|
51
|
+
}
|
|
52
|
+
/** The range of a signed integer of `bits` bits. */
|
|
53
|
+
function signedRange(bits) {
|
|
54
|
+
const half = 2n ** (BigInt(bits) - 1n);
|
|
55
|
+
return {
|
|
56
|
+
min: -half,
|
|
57
|
+
max: half - 1n
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* The classifier one target's plain-number authoring entry carries: it reads the digits and says
|
|
62
|
+
* which of the target's types the value is, in that type's canonical form. `undefined` means no
|
|
63
|
+
* type of this target holds the number.
|
|
64
|
+
*/
|
|
65
|
+
function createNumberClassifier(spec) {
|
|
66
|
+
const as = (classification, value) => classification === void 0 ? void 0 : {
|
|
67
|
+
type: classification.type,
|
|
68
|
+
value
|
|
69
|
+
};
|
|
70
|
+
return (text) => {
|
|
71
|
+
if (NON_FINITE_WORDS.has(text)) return as(spec.words, spec.words?.form === "number" ? Number(text) : text);
|
|
72
|
+
if (DECIMAL_TEXT.test(text)) {
|
|
73
|
+
const canonical = canonicalNumeralText(text);
|
|
74
|
+
return as(spec.fraction, spec.fraction?.form === "number" ? Number(canonical) : canonical);
|
|
75
|
+
}
|
|
76
|
+
if (!INTEGER_TEXT.test(text)) return void 0;
|
|
77
|
+
const digits = BigInt(text);
|
|
78
|
+
const classification = spec.integers.find(({ min, max }) => digits >= min && digits <= max) ?? spec.largerWhole;
|
|
79
|
+
return as(classification, classification?.form === "number" ? Number(digits) : digits.toString());
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Read a JSON body into the document it holds.
|
|
84
|
+
*
|
|
85
|
+
* `JSON.parse` reads a numeral too large for a double as `Infinity`, and `JSON.stringify` writes
|
|
86
|
+
* that back as `null`, so a document holding one would not be the document stored; it is refused
|
|
87
|
+
* here instead, naming where the number is.
|
|
88
|
+
*/
|
|
89
|
+
function parseJsonBody(text) {
|
|
90
|
+
let value;
|
|
91
|
+
try {
|
|
92
|
+
value = JSON.parse(text);
|
|
93
|
+
} catch (error) {
|
|
94
|
+
throw structuredError("CONTRACT.INVALID_JSON_LITERAL", error instanceof Error ? error.message : String(error), {
|
|
95
|
+
why: "The body is not a JSON document.",
|
|
96
|
+
fix: "Write a JSON document."
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
const overflowed = nonFiniteNumberIn(value, "");
|
|
100
|
+
if (overflowed !== void 0) throw structuredError("CONTRACT.INVALID_JSON_LITERAL", `${overflowed.path} is ${overflowed.value}, which JSON cannot write back: the number in the text is outside the range a JSON number holds.`, {
|
|
101
|
+
why: "JSON.parse reads a numeral too large for a double as Infinity, which JSON.stringify writes back as null.",
|
|
102
|
+
fix: "Write a number JSON can hold, or write it as text."
|
|
103
|
+
});
|
|
104
|
+
return value;
|
|
105
|
+
}
|
|
106
|
+
/** Write a document as the body of a JSON literal. */
|
|
107
|
+
function printJsonBody(value) {
|
|
108
|
+
return JSON.stringify(value);
|
|
109
|
+
}
|
|
110
|
+
function nonFiniteNumberIn(value, path) {
|
|
111
|
+
if (typeof value === "number") return Number.isFinite(value) ? void 0 : {
|
|
112
|
+
path: path === "" ? "The value" : path,
|
|
113
|
+
value
|
|
114
|
+
};
|
|
115
|
+
if (Array.isArray(value)) {
|
|
116
|
+
for (const [index, element] of value.entries()) {
|
|
117
|
+
const found = nonFiniteNumberIn(element, `${path}[${index}]`);
|
|
118
|
+
if (found !== void 0) return found;
|
|
119
|
+
}
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
if (typeof value === "object" && value !== null) for (const [key, member] of Object.entries(value)) {
|
|
123
|
+
const found = nonFiniteNumberIn(member, path === "" ? key : `${path}.${key}`);
|
|
124
|
+
if (found !== void 0) return found;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
6
127
|
var JsonValueProjection = class {
|
|
7
128
|
value;
|
|
8
129
|
constructor(value) {
|
|
@@ -126,7 +247,7 @@ var SqlTextCodec = class extends CodecImpl {
|
|
|
126
247
|
return json;
|
|
127
248
|
}
|
|
128
249
|
};
|
|
129
|
-
var SqlTextDescriptor = class extends
|
|
250
|
+
var SqlTextDescriptor = class extends CodecDescriptorTemplateImpl {
|
|
130
251
|
codecId = SQL_TEXT_CODEC_ID;
|
|
131
252
|
traits = [
|
|
132
253
|
"equality",
|
|
@@ -155,7 +276,7 @@ var SqlIntCodec = class extends CodecImpl {
|
|
|
155
276
|
return json;
|
|
156
277
|
}
|
|
157
278
|
};
|
|
158
|
-
var SqlIntDescriptor = class extends
|
|
279
|
+
var SqlIntDescriptor = class extends CodecDescriptorTemplateImpl {
|
|
159
280
|
codecId = SQL_INT_CODEC_ID;
|
|
160
281
|
traits = [
|
|
161
282
|
"equality",
|
|
@@ -184,7 +305,7 @@ var SqlFloatCodec = class extends CodecImpl {
|
|
|
184
305
|
return sqlFloatDecodeJson(json);
|
|
185
306
|
}
|
|
186
307
|
};
|
|
187
|
-
var SqlFloatDescriptor = class extends
|
|
308
|
+
var SqlFloatDescriptor = class extends CodecDescriptorTemplateImpl {
|
|
188
309
|
codecId = SQL_FLOAT_CODEC_ID;
|
|
189
310
|
traits = [
|
|
190
311
|
"equality",
|
|
@@ -213,7 +334,7 @@ var SqlCharCodec = class extends CodecImpl {
|
|
|
213
334
|
return json;
|
|
214
335
|
}
|
|
215
336
|
};
|
|
216
|
-
var SqlCharDescriptor = class extends
|
|
337
|
+
var SqlCharDescriptor = class extends CodecDescriptorTemplateImpl {
|
|
217
338
|
codecId = SQL_CHAR_CODEC_ID;
|
|
218
339
|
traits = [
|
|
219
340
|
"equality",
|
|
@@ -245,7 +366,7 @@ var SqlVarcharCodec = class extends CodecImpl {
|
|
|
245
366
|
return json;
|
|
246
367
|
}
|
|
247
368
|
};
|
|
248
|
-
var SqlVarcharDescriptor = class extends
|
|
369
|
+
var SqlVarcharDescriptor = class extends CodecDescriptorTemplateImpl {
|
|
249
370
|
codecId = SQL_VARCHAR_CODEC_ID;
|
|
250
371
|
traits = [
|
|
251
372
|
"equality",
|
|
@@ -264,6 +385,6 @@ var SqlVarcharDescriptor = class extends CodecDescriptorImpl {
|
|
|
264
385
|
const sqlVarcharDescriptor = new SqlVarcharDescriptor();
|
|
265
386
|
const sqlVarcharColumn = (params = {}) => column(sqlVarcharDescriptor.factory(params), sqlVarcharDescriptor.codecId, params, "varchar");
|
|
266
387
|
//#endregion
|
|
267
|
-
export {
|
|
388
|
+
export { sqlCharDescriptor as A, sqlIntDecode as B, isNumeralText as C, signedRange as D, printJsonBody as E, sqlFloatDecodeJson as F, sqlTextDescriptor as G, sqlIntEncode as H, sqlFloatDescriptor as I, sqlVarcharDecode as J, sqlTextEncode as K, sqlFloatEncode as L, sqlCharRenderOutputType as M, sqlFloatColumn as N, sqlCharColumn as O, sqlFloatDecode as P, sqlFloatEncodeJson as R, isNonFiniteText as S, parseJsonBody as T, sqlTextColumn as U, sqlIntDescriptor as V, sqlTextDecode as W, sqlVarcharEncode as X, sqlVarcharDescriptor as Y, sqlVarcharRenderOutputType as Z, SqlVarcharCodec as _, SQL_FLOAT_CODEC_ID as a, createNumberClassifier as b, SQL_VARCHAR_CODEC_ID as c, SqlFloatCodec as d, SqlFloatDescriptor as f, SqlTextDescriptor as g, SqlTextCodec as h, SQL_CHAR_CODEC_ID as i, sqlCharEncode as j, sqlCharDecode as k, SqlCharCodec as l, SqlIntDescriptor as m, JsonDocumentProjection as n, SQL_INT_CODEC_ID as o, SqlIntCodec as p, sqlVarcharColumn as q, NativeJsonValueProjection as r, SQL_TEXT_CODEC_ID as s, CodecJsonValueProjection as t, SqlCharDescriptor as u, SqlVarcharDescriptor as v, numeralText as w, escapePslString as x, canonicalNumeralText as y, sqlIntColumn as z };
|
|
268
389
|
|
|
269
|
-
//# sourceMappingURL=ast-
|
|
390
|
+
//# sourceMappingURL=ast-um6jG7BL.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ast-um6jG7BL.mjs","names":[],"sources":["../../../../2-sql/4-lanes/relational-core/dist/exports/ast.mjs"],"sourcesContent":["import { A as PreparedParamRef, B as isAggregateFn, C as LiteralExpr, D as OrExpr, E as OperationExpr, F as SubqueryExpr, G as frozenCodecRef, H as isWhereExpr, I as TableSource, L as UpdateAst, M as RawExpr, N as RawQueryAst, O as OrderByItem, P as SelectAst, R as WindowFuncExpr, S as ListExpression, T as NullCheckExpr, U as queryAstKinds, V as isQueryAst, W as whereExprKinds, _ as InsertAst, a as CastExpr, b as JsonArrayAggExpr, c as DeleteAst, d as DoUpdateSetConflictAction, f as EqColJoinOn, g as IdentifierRef, h as FunctionSource, i as CaseExpr, j as ProjectionItem, k as ParamRef, l as DerivedTableSource, m as FunctionCallExpr, n as AndExpr, o as ColumnRef, p as ExistsExpr, r as BinaryExpr, s as DefaultValueExpr, t as AggregateExpr, u as DoNothingConflictAction, v as InsertOnConflict, w as NotExpr, x as JsonObjectExpr, y as JoinAst, z as aggregateFnNames } from \"../types-ZNKYVjLr.mjs\";\nimport { a as ForeignKeyConstraint, c as PrimaryKeyConstraint, i as DdlNode, l as UniqueConstraint, n as DdlColumn, o as FunctionColumnDefault, r as DdlColumnDefault, s as LiteralColumnDefault, t as CheckExpressionConstraint, u as isDdlNode } from \"../ddl-types-DOgOmDOh.mjs\";\nimport { n as compact, t as collectOrderedParamRefs } from \"../util-DQQgv2j1.mjs\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { CodecDescriptorTemplateImpl, CodecImpl, column, voidParamsSchema } from \"@internal/framework-components/codec\";\nimport { type } from \"arktype\";\n//#region src/ast/data-type-support.ts\nconst INTEGER_TEXT = /^-?\\d+$/;\nconst DECIMAL_TEXT = /^-?\\d+\\.\\d+$/;\nconst NON_FINITE_WORDS = /* @__PURE__ */ new Set([\n\t\"NaN\",\n\t\"Infinity\",\n\t\"-Infinity\"\n]);\nconst DECIMAL_NUMERAL = /^(-?)0*(\\d+)(\\.\\d+)?$/;\n/** Whether `text` is a whole number or a decimal as a contract source writes one. */\nfunction isNumeralText(text) {\n\treturn INTEGER_TEXT.test(text) || DECIMAL_TEXT.test(text);\n}\n/** Whether `text` is one of the three words a floating-point value is written as. */\nfunction isNonFiniteText(text) {\n\treturn NON_FINITE_WORDS.has(text);\n}\n/**\n* A written numeral as the contract stores it. Leading zeros and the sign of zero never change a\n* number, so they go; trailing zeros stay, because a type without a scale keeps them.\n*/\nfunction canonicalNumeralText(text) {\n\tconst numeral = DECIMAL_NUMERAL.exec(text);\n\tif (numeral === null) return text;\n\tconst [, sign = \"\", whole = \"\", fraction = \"\"] = numeral;\n\tconst digits = `${whole}${fraction}`;\n\treturn /^[0.]+$/.test(digits) ? digits : `${sign}${digits}`;\n}\n/**\n* A number as a contract source writes it: no exponent, because no schema language has that syntax,\n* so the decimal point moves to where the exponent puts it. A non-finite number is its own word.\n*/\nfunction numeralText(value) {\n\tconst [coefficient = \"\", exponent] = String(value).split(\"e\");\n\tif (exponent === void 0) return coefficient;\n\tconst sign = coefficient.startsWith(\"-\") ? \"-\" : \"\";\n\tconst [whole = \"\", fraction = \"\"] = coefficient.slice(sign.length).split(\".\");\n\tconst digits = `${whole}${fraction}`;\n\tconst point = whole.length + Number(exponent);\n\tif (point <= 0) return `${sign}0.${\"0\".repeat(-point)}${digits}`;\n\tif (point >= digits.length) return `${sign}${digits}${\"0\".repeat(point - digits.length)}`;\n\treturn `${sign}${digits.slice(0, point)}.${digits.slice(point)}`;\n}\n/** A string as a contract source writes it, with the escapes its string reader resolves. */\nfunction escapePslString(value) {\n\treturn value.replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g, \"\\\\\\\"\").replace(/\\n/g, \"\\\\n\").replace(/\\r/g, \"\\\\r\");\n}\n/** The range of a signed integer of `bits` bits. */\nfunction signedRange(bits) {\n\tconst half = 2n ** (BigInt(bits) - 1n);\n\treturn {\n\t\tmin: -half,\n\t\tmax: half - 1n\n\t};\n}\n/**\n* The classifier one target's plain-number authoring entry carries: it reads the digits and says\n* which of the target's types the value is, in that type's canonical form. `undefined` means no\n* type of this target holds the number.\n*/\nfunction createNumberClassifier(spec) {\n\tconst as = (classification, value) => classification === void 0 ? void 0 : {\n\t\ttype: classification.type,\n\t\tvalue\n\t};\n\treturn (text) => {\n\t\tif (NON_FINITE_WORDS.has(text)) return as(spec.words, spec.words?.form === \"number\" ? Number(text) : text);\n\t\tif (DECIMAL_TEXT.test(text)) {\n\t\t\tconst canonical = canonicalNumeralText(text);\n\t\t\treturn as(spec.fraction, spec.fraction?.form === \"number\" ? Number(canonical) : canonical);\n\t\t}\n\t\tif (!INTEGER_TEXT.test(text)) return void 0;\n\t\tconst digits = BigInt(text);\n\t\tconst classification = spec.integers.find(({ min, max }) => digits >= min && digits <= max) ?? spec.largerWhole;\n\t\treturn as(classification, classification?.form === \"number\" ? Number(digits) : digits.toString());\n\t};\n}\n/**\n* Read a JSON body into the document it holds.\n*\n* `JSON.parse` reads a numeral too large for a double as `Infinity`, and `JSON.stringify` writes\n* that back as `null`, so a document holding one would not be the document stored; it is refused\n* here instead, naming where the number is.\n*/\nfunction parseJsonBody(text) {\n\tlet value;\n\ttry {\n\t\tvalue = JSON.parse(text);\n\t} catch (error) {\n\t\tthrow structuredError(\"CONTRACT.INVALID_JSON_LITERAL\", error instanceof Error ? error.message : String(error), {\n\t\t\twhy: \"The body is not a JSON document.\",\n\t\t\tfix: \"Write a JSON document.\"\n\t\t});\n\t}\n\tconst overflowed = nonFiniteNumberIn(value, \"\");\n\tif (overflowed !== void 0) throw structuredError(\"CONTRACT.INVALID_JSON_LITERAL\", `${overflowed.path} is ${overflowed.value}, which JSON cannot write back: the number in the text is outside the range a JSON number holds.`, {\n\t\twhy: \"JSON.parse reads a numeral too large for a double as Infinity, which JSON.stringify writes back as null.\",\n\t\tfix: \"Write a number JSON can hold, or write it as text.\"\n\t});\n\treturn value;\n}\n/** Write a document as the body of a JSON literal. */\nfunction printJsonBody(value) {\n\treturn JSON.stringify(value);\n}\nfunction nonFiniteNumberIn(value, path) {\n\tif (typeof value === \"number\") return Number.isFinite(value) ? void 0 : {\n\t\tpath: path === \"\" ? \"The value\" : path,\n\t\tvalue\n\t};\n\tif (Array.isArray(value)) {\n\t\tfor (const [index, element] of value.entries()) {\n\t\t\tconst found = nonFiniteNumberIn(element, `${path}[${index}]`);\n\t\t\tif (found !== void 0) return found;\n\t\t}\n\t\treturn;\n\t}\n\tif (typeof value === \"object\" && value !== null) for (const [key, member] of Object.entries(value)) {\n\t\tconst found = nonFiniteNumberIn(member, path === \"\" ? key : `${path}.${key}`);\n\t\tif (found !== void 0) return found;\n\t}\n}\n//#endregion\n//#region src/ast/json-value-projection.ts\nvar JsonValueProjection = class {\n\tvalue;\n\tconstructor(value) {\n\t\tthis.value = value;\n\t}\n\tfold(folder) {\n\t\treturn this.value.fold(folder);\n\t}\n\tcollectColumnRefs() {\n\t\treturn this.value.collectColumnRefs();\n\t}\n\tcollectParamRefs() {\n\t\treturn this.value.collectParamRefs();\n\t}\n\tfreeze() {\n\t\tObject.freeze(this);\n\t}\n};\nvar CodecJsonValueProjection = class CodecJsonValueProjection extends JsonValueProjection {\n\tkind = \"codec\";\n\tcodec;\n\tconstructor(value, codec) {\n\t\tsuper(value);\n\t\tthis.codec = frozenCodecRef(codec);\n\t\tthis.freeze();\n\t}\n\taccept(visitor) {\n\t\treturn visitor.codec(this);\n\t}\n\trewrite(rewriter) {\n\t\treturn new CodecJsonValueProjection(this.value.rewrite(rewriter), this.codec);\n\t}\n};\nvar NativeJsonValueProjection = class NativeJsonValueProjection extends JsonValueProjection {\n\tkind = \"native\";\n\tconstructor(value) {\n\t\tsuper(value);\n\t\tthis.freeze();\n\t}\n\taccept(visitor) {\n\t\treturn visitor.native(this);\n\t}\n\trewrite(rewriter) {\n\t\treturn new NativeJsonValueProjection(this.value.rewrite(rewriter));\n\t}\n};\nvar JsonDocumentProjection = class JsonDocumentProjection extends JsonValueProjection {\n\tkind = \"document\";\n\tconstructor(value) {\n\t\tsuper(value);\n\t\tthis.freeze();\n\t}\n\taccept(visitor) {\n\t\treturn visitor.document(this);\n\t}\n\trewrite(rewriter) {\n\t\treturn new JsonDocumentProjection(this.value.rewrite(rewriter));\n\t}\n};\n//#endregion\n//#region src/ast/sql-codec-helpers.ts\nconst SQL_CHAR_CODEC_ID = \"sql/char@1\";\nconst SQL_VARCHAR_CODEC_ID = \"sql/varchar@1\";\nconst SQL_INT_CODEC_ID = \"sql/int@1\";\nconst SQL_FLOAT_CODEC_ID = \"sql/float@1\";\nconst SQL_TEXT_CODEC_ID = \"sql/text@1\";\nconst sqlCharEncode = (value) => value;\nconst sqlCharDecode = (wire) => wire.trimEnd();\nconst sqlCharRenderOutputType = (typeParams) => {\n\tconst length = typeParams.length;\n\tif (length === void 0) return void 0;\n\tif (typeof length !== \"number\" || !Number.isFinite(length) || !Number.isInteger(length)) throw structuredError(\"RUNTIME.TYPE_PARAMS_INVALID\", `renderOutputType: expected integer \"length\" in typeParams for Char, got ${String(length)}`, { meta: {\n\t\tcodec: SQL_CHAR_CODEC_ID,\n\t\tparam: \"length\",\n\t\treceived: String(length)\n\t} });\n\treturn `Char<${length}>`;\n};\nconst sqlVarcharEncode = (value) => value;\nconst sqlVarcharDecode = (wire) => wire;\nconst sqlVarcharRenderOutputType = (typeParams) => {\n\tconst length = typeParams.length;\n\tif (length === void 0) return void 0;\n\tif (typeof length !== \"number\" || !Number.isFinite(length) || !Number.isInteger(length)) throw structuredError(\"RUNTIME.TYPE_PARAMS_INVALID\", `renderOutputType: expected integer \"length\" in typeParams for Varchar, got ${String(length)}`, { meta: {\n\t\tcodec: SQL_VARCHAR_CODEC_ID,\n\t\tparam: \"length\",\n\t\treceived: String(length)\n\t} });\n\treturn `Varchar<${length}>`;\n};\nconst sqlIntEncode = (value) => value;\nconst sqlIntDecode = (wire) => wire;\nconst sqlFloatEncode = (value) => value;\nconst sqlFloatDecode = (wire) => wire;\n/**\n* JSON has no spelling for a non-finite number, and a database that holds one\n* emits it as a string — PostgreSQL writes `\"NaN\"` and `\"Infinity\"`. This\n* codec's application type is `number`, so both directions reject rather than\n* carry a value that type cannot hold.\n*/\nconst sqlFloatEncodeJson = (value) => {\n\tif (!Number.isFinite(value)) throw structuredError(\"RUNTIME.ENCODE_FAILED\", `${SQL_FLOAT_CODEC_ID} application value must be a finite number, got ${value}`, { meta: { codec: SQL_FLOAT_CODEC_ID } });\n\treturn value;\n};\nconst sqlFloatDecodeJson = (json) => {\n\tif (typeof json !== \"number\" || !Number.isFinite(json)) throw structuredError(\"RUNTIME.DECODE_FAILED\", `Expected a finite number for ${SQL_FLOAT_CODEC_ID}, got ${JSON.stringify(json)}`, { meta: { codec: SQL_FLOAT_CODEC_ID } });\n\treturn json;\n};\nconst sqlTextEncode = (value) => value;\nconst sqlTextDecode = (wire) => wire;\n//#endregion\n//#region src/ast/sql-codecs.ts\nconst lengthParamsSchema = type({ \"length?\": \"number.integer > 0\" });\nvar SqlTextCodec = class extends CodecImpl {\n\tasync encode(value, _ctx) {\n\t\treturn sqlTextEncode(value);\n\t}\n\tasync decode(wire, _ctx) {\n\t\treturn sqlTextDecode(wire);\n\t}\n\tencodeJson(value) {\n\t\treturn value;\n\t}\n\tdecodeJson(json) {\n\t\treturn json;\n\t}\n};\nvar SqlTextDescriptor = class extends CodecDescriptorTemplateImpl {\n\tcodecId = SQL_TEXT_CODEC_ID;\n\ttraits = [\n\t\t\"equality\",\n\t\t\"order\",\n\t\t\"textual\"\n\t];\n\ttargetTypes = [\"text\"];\n\tparamsSchema = voidParamsSchema;\n\tfactory() {\n\t\treturn () => new SqlTextCodec(this);\n\t}\n};\nconst sqlTextDescriptor = new SqlTextDescriptor();\nconst sqlTextColumn = () => column(sqlTextDescriptor.factory(), sqlTextDescriptor.codecId, void 0, \"text\");\nvar SqlIntCodec = class extends CodecImpl {\n\tasync encode(value, _ctx) {\n\t\treturn sqlIntEncode(value);\n\t}\n\tasync decode(wire, _ctx) {\n\t\treturn sqlIntDecode(wire);\n\t}\n\tencodeJson(value) {\n\t\treturn value;\n\t}\n\tdecodeJson(json) {\n\t\treturn json;\n\t}\n};\nvar SqlIntDescriptor = class extends CodecDescriptorTemplateImpl {\n\tcodecId = SQL_INT_CODEC_ID;\n\ttraits = [\n\t\t\"equality\",\n\t\t\"order\",\n\t\t\"numeric\"\n\t];\n\ttargetTypes = [\"int\"];\n\tparamsSchema = voidParamsSchema;\n\tfactory() {\n\t\treturn () => new SqlIntCodec(this);\n\t}\n};\nconst sqlIntDescriptor = new SqlIntDescriptor();\nconst sqlIntColumn = () => column(sqlIntDescriptor.factory(), sqlIntDescriptor.codecId, void 0, \"int\");\nvar SqlFloatCodec = class extends CodecImpl {\n\tasync encode(value, _ctx) {\n\t\treturn sqlFloatEncode(value);\n\t}\n\tasync decode(wire, _ctx) {\n\t\treturn sqlFloatDecode(wire);\n\t}\n\tencodeJson(value) {\n\t\treturn sqlFloatEncodeJson(value);\n\t}\n\tdecodeJson(json) {\n\t\treturn sqlFloatDecodeJson(json);\n\t}\n};\nvar SqlFloatDescriptor = class extends CodecDescriptorTemplateImpl {\n\tcodecId = SQL_FLOAT_CODEC_ID;\n\ttraits = [\n\t\t\"equality\",\n\t\t\"order\",\n\t\t\"numeric\"\n\t];\n\ttargetTypes = [\"float\"];\n\tparamsSchema = voidParamsSchema;\n\tfactory() {\n\t\treturn () => new SqlFloatCodec(this);\n\t}\n};\nconst sqlFloatDescriptor = new SqlFloatDescriptor();\nconst sqlFloatColumn = () => column(sqlFloatDescriptor.factory(), sqlFloatDescriptor.codecId, void 0, \"float\");\nvar SqlCharCodec = class extends CodecImpl {\n\tasync encode(value, _ctx) {\n\t\treturn sqlCharEncode(value);\n\t}\n\tasync decode(wire, _ctx) {\n\t\treturn sqlCharDecode(wire);\n\t}\n\tencodeJson(value) {\n\t\treturn value;\n\t}\n\tdecodeJson(json) {\n\t\treturn json;\n\t}\n};\nvar SqlCharDescriptor = class extends CodecDescriptorTemplateImpl {\n\tcodecId = SQL_CHAR_CODEC_ID;\n\ttraits = [\n\t\t\"equality\",\n\t\t\"order\",\n\t\t\"textual\"\n\t];\n\ttargetTypes = [\"char\"];\n\tparamsSchema = lengthParamsSchema;\n\trenderOutputType(params) {\n\t\treturn sqlCharRenderOutputType(params);\n\t}\n\tfactory(_params) {\n\t\treturn () => new SqlCharCodec(this);\n\t}\n};\nconst sqlCharDescriptor = new SqlCharDescriptor();\nconst sqlCharColumn = (params = {}) => column(sqlCharDescriptor.factory(params), sqlCharDescriptor.codecId, params, \"char\");\nvar SqlVarcharCodec = class extends CodecImpl {\n\tasync encode(value, _ctx) {\n\t\treturn sqlVarcharEncode(value);\n\t}\n\tasync decode(wire, _ctx) {\n\t\treturn sqlVarcharDecode(wire);\n\t}\n\tencodeJson(value) {\n\t\treturn value;\n\t}\n\tdecodeJson(json) {\n\t\treturn json;\n\t}\n};\nvar SqlVarcharDescriptor = class extends CodecDescriptorTemplateImpl {\n\tcodecId = SQL_VARCHAR_CODEC_ID;\n\ttraits = [\n\t\t\"equality\",\n\t\t\"order\",\n\t\t\"textual\"\n\t];\n\ttargetTypes = [\"varchar\"];\n\tparamsSchema = lengthParamsSchema;\n\trenderOutputType(params) {\n\t\treturn sqlVarcharRenderOutputType(params);\n\t}\n\tfactory(_params) {\n\t\treturn () => new SqlVarcharCodec(this);\n\t}\n};\nconst sqlVarcharDescriptor = new SqlVarcharDescriptor();\nconst sqlVarcharColumn = (params = {}) => column(sqlVarcharDescriptor.factory(params), sqlVarcharDescriptor.codecId, params, \"varchar\");\n//#endregion\nexport { AggregateExpr, AndExpr, BinaryExpr, CaseExpr, CastExpr, CheckExpressionConstraint, CodecJsonValueProjection, ColumnRef, DdlColumn, DdlColumnDefault, DdlNode, DefaultValueExpr, DeleteAst, DerivedTableSource, DoNothingConflictAction, DoUpdateSetConflictAction, EqColJoinOn, ExistsExpr, ForeignKeyConstraint, FunctionCallExpr, FunctionColumnDefault, FunctionSource, IdentifierRef, InsertAst, InsertOnConflict, JoinAst, JsonArrayAggExpr, JsonDocumentProjection, JsonObjectExpr, ListExpression, LiteralColumnDefault, LiteralExpr, NativeJsonValueProjection, NotExpr, NullCheckExpr, OperationExpr, OrExpr, OrderByItem, ParamRef, PreparedParamRef, PrimaryKeyConstraint, ProjectionItem, RawExpr, RawQueryAst, SQL_CHAR_CODEC_ID, SQL_FLOAT_CODEC_ID, SQL_INT_CODEC_ID, SQL_TEXT_CODEC_ID, SQL_VARCHAR_CODEC_ID, SelectAst, SqlCharCodec, SqlCharDescriptor, SqlFloatCodec, SqlFloatDescriptor, SqlIntCodec, SqlIntDescriptor, SqlTextCodec, SqlTextDescriptor, SqlVarcharCodec, SqlVarcharDescriptor, SubqueryExpr, TableSource, UniqueConstraint, UpdateAst, WindowFuncExpr, aggregateFnNames, canonicalNumeralText, collectOrderedParamRefs, compact, createNumberClassifier, escapePslString, frozenCodecRef, isAggregateFn, isDdlNode, isNonFiniteText, isNumeralText, isQueryAst, isWhereExpr, numeralText, parseJsonBody, printJsonBody, queryAstKinds, signedRange, sqlCharColumn, sqlCharDecode, sqlCharDescriptor, sqlCharEncode, sqlCharRenderOutputType, sqlFloatColumn, sqlFloatDecode, sqlFloatDecodeJson, sqlFloatDescriptor, sqlFloatEncode, sqlFloatEncodeJson, sqlIntColumn, sqlIntDecode, sqlIntDescriptor, sqlIntEncode, sqlTextColumn, sqlTextDecode, sqlTextDescriptor, sqlTextEncode, sqlVarcharColumn, sqlVarcharDecode, sqlVarcharDescriptor, sqlVarcharEncode, sqlVarcharRenderOutputType, whereExprKinds };\n\n//# sourceMappingURL=ast.mjs.map"],"mappings":";;;;;AAOA,MAAM,eAAe;AACrB,MAAM,eAAe;AACrB,MAAM,mCAAmC,IAAI,IAAI;CAChD;CACA;CACA;AACD,CAAC;AACD,MAAM,kBAAkB;;AAExB,SAAS,cAAc,MAAM;CAC5B,OAAO,aAAa,KAAK,IAAI,KAAK,aAAa,KAAK,IAAI;AACzD;;AAEA,SAAS,gBAAgB,MAAM;CAC9B,OAAO,iBAAiB,IAAI,IAAI;AACjC;;;;;AAKA,SAAS,qBAAqB,MAAM;CACnC,MAAM,UAAU,gBAAg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EAChB,aAAa,IAAI,aAAa,IAAI;CACnC;AACD;AACA,MAAM,oBAAoB,IAAI,kBAAkB;AAChD,MAAM,iBAAiB,SAAS,CAAC,MAAM,OAAO,kBAAkB,QAAQ,MAAM,GAAG,kBAAkB,SAAS,QAAQ,MAAM;AAC1H,IAAI,kBAAkB,cAAc,UAAU;CAC7C,MAAM,OAAO,OAAO,MAAM;EACzB,OAAO,iBAAiB,KAAK;CAC9B;CACA,MAAM,OAAO,MAAM,MAAM;EACxB,OAAO,iBAAiB,IAAI;CAC7B;CACA,WAAW,OAAO;EACjB,OAAO;CACR;CACA,WAAW,MAAM;EAChB,OAAO;CACR;AACD;AACA,IAAI,uBAAuB,cAAc,4BAA4B;CACpE,UAAU;CACV,SAAS;EACR;EACA;EACA;CACD;CACA,cAAc,CAAC,SAAS;CACxB,eAAe;CACf,iBAAiB,QAAQ;EACxB,OAAO,2BAA2B,MAAM;CACzC;CACA,QAAQ,SAAS;EAChB,aAAa,IAAI,gBAAgB,IAAI;CACtC;AACD;AACA,MAAM,uBAAuB,IAAI,qBAAqB;AACtD,MAAM,oBAAoB,SAAS,CAAC,MAAM,OAAO,qBAAqB,QAAQ,MAAM,GAAG,qBAAqB,SAAS,QAAQ,SAAS"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { s as enumType } from "./contract-builder-
|
|
1
|
+
import { s as enumType } from "./contract-builder-BgWPuVYv.mjs";
|
|
2
2
|
import { resolveEnumCodecId } from "@prisma/orm-framework/components/authoring";
|
|
3
3
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
4
4
|
import { blockAttribute, str } from "@prisma/orm-framework/psl-parser";
|
|
@@ -325,4 +325,4 @@ const sqlFamilyAuthoringTypes = { sql: { String: {
|
|
|
325
325
|
//#endregion
|
|
326
326
|
export { sqlFamilyPslBlockDescriptors as i, sqlFamilyAuthoringTypes as n, sqlFamilyEntityTypes as r, sqlFamilyAuthoringFieldPresets as t };
|
|
327
327
|
|
|
328
|
-
//# sourceMappingURL=authoring-type-constructors-C1ogrr_x-
|
|
328
|
+
//# sourceMappingURL=authoring-type-constructors-C1ogrr_x-VWDkCaSq.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authoring-type-constructors-C1ogrr_x-BeSS93gc.mjs","names":[],"sources":["../../../../2-sql/9-family/dist/authoring-type-constructors-C1ogrr_x.mjs"],"sourcesContent":["import { resolveEnumCodecId } from \"@internal/framework-components/authoring\";\nimport { blockAttribute, str } from \"@internal/psl-parser\";\nimport { enumType } from \"@internal/sql-contract-ts/contract-builder\";\nimport { blindCast } from \"@internal/utils/casts\";\nconst sqlFamilyEntityTypes = { enum: {\n\tkind: \"entity\",\n\tdiscriminator: \"enum\",\n\toutput: { factory: (block, ctx) => {\n\t\tconst sourceId = ctx.sourceId ?? \"unknown\";\n\t\tconst diagnostics = ctx.diagnostics;\n\t\tconst resolved = resolveEnumCodecId(block, ctx);\n\t\tif (resolved === void 0) return;\n\t\tconst { codecId, codecSpan } = resolved;\n\t\tconst nativeType = ctx.codecLookup?.targetTypesFor(codecId)?.[0];\n\t\tif (nativeType === void 0) {\n\t\t\tdiagnostics?.push({\n\t\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\t\tmessage: `enum \"${block.name}\" @@type references unknown codec \"${codecId}\"`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: codecSpan\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconst codec = ctx.codecLookup?.get(codecId);\n\t\tif (codec === void 0) {\n\t\t\tdiagnostics?.push({\n\t\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\t\tmessage: `enum \"${block.name}\" @@type codec \"${codecId}\" resolves in targetTypesFor but is absent from codecLookup.get`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: codecSpan\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconst seenValues = /* @__PURE__ */ new Set();\n\t\tconst members = [];\n\t\tlet memberError = false;\n\t\tfor (const [memberName, paramValue] of Object.entries(block.parameters)) {\n\t\t\tlet value;\n\t\t\tif (paramValue.kind === \"bare\") try {\n\t\t\t\tvalue = codec.decodeJson(memberName);\n\t\t\t} catch {\n\t\t\t\tdiagnostics?.push({\n\t\t\t\t\tcode: \"PSL_ENUM_BARE_MEMBER_NON_STRING_CODEC\",\n\t\t\t\t\tmessage: `enum \"${block.name}\" member \"${memberName}\" has no value and codec \"${codecId}\" does not accept a bare name as input`,\n\t\t\t\t\tsourceId,\n\t\t\t\t\tspan: paramValue.span\n\t\t\t\t});\n\t\t\t\tmemberError = true;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\telse if (paramValue.kind === \"value\") {\n\t\t\t\tlet jsonValue;\n\t\t\t\ttry {\n\t\t\t\t\tjsonValue = JSON.parse(paramValue.raw);\n\t\t\t\t} catch {\n\t\t\t\t\tdiagnostics?.push({\n\t\t\t\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\t\t\t\tmessage: `enum \"${block.name}\" member \"${memberName}\" value \"${paramValue.raw}\" is not valid JSON`,\n\t\t\t\t\t\tsourceId,\n\t\t\t\t\t\tspan: paramValue.span\n\t\t\t\t\t});\n\t\t\t\t\tmemberError = true;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tvalue = codec.decodeJson(blindCast(jsonValue));\n\t\t\t\t} catch (err) {\n\t\t\t\t\tconst reason = err instanceof Error ? err.message : String(err);\n\t\t\t\t\tdiagnostics?.push({\n\t\t\t\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\t\t\t\tmessage: `enum \"${block.name}\" member \"${memberName}\" was rejected by codec \"${codecId}\": ${reason}`,\n\t\t\t\t\t\tsourceId,\n\t\t\t\t\t\tspan: paramValue.span\n\t\t\t\t\t});\n\t\t\t\t\tmemberError = true;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t} else continue;\n\t\t\tconst valueKey = String(value);\n\t\t\tif (seenValues.has(valueKey)) {\n\t\t\t\tdiagnostics?.push({\n\t\t\t\t\tcode: \"PSL_ENUM_DUPLICATE_MEMBER_VALUE\",\n\t\t\t\t\tmessage: `enum \"${block.name}\": duplicate member value \"${valueKey}\"`,\n\t\t\t\t\tsourceId,\n\t\t\t\t\tspan: paramValue.span\n\t\t\t\t});\n\t\t\t\tmemberError = true;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tseenValues.add(valueKey);\n\t\t\tmembers.push({\n\t\t\t\tname: memberName,\n\t\t\t\tvalue\n\t\t\t});\n\t\t}\n\t\tif (memberError) return void 0;\n\t\tif (members.length === 0) {\n\t\t\tdiagnostics?.push({\n\t\t\t\tcode: \"PSL_ENUM_MISSING_TYPE\",\n\t\t\t\tmessage: `enum \"${block.name}\" must have at least one member`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: block.span\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\treturn enumType(block.name, {\n\t\t\tcodecId,\n\t\t\tnativeType\n\t\t}, ...members.map((m) => ({\n\t\t\tname: m.name,\n\t\t\tvalue: m.value\n\t\t})));\n\t} }\n} };\nconst enumTypeBlockAttribute = blockAttribute(\"type\", {\n\tdocumentation: \"Selects the storage codec for this enum.\",\n\tpositional: [{\n\t\tkey: \"codecId\",\n\t\ttype: str(),\n\t\tdocumentation: \"The fully qualified codec identifier used to store enum values.\"\n\t}]\n});\nconst sqlFamilyPslBlockDescriptors = { enum: {\n\tkind: \"pslBlock\",\n\tkeyword: \"enum\",\n\tdocumentation: \"Defines an enum with named values and an inferred or explicitly selected storage codec.\",\n\tdiscriminator: \"enum\",\n\tname: { required: true },\n\tparameters: {},\n\tvariadicParameters: true,\n\tattributes: { type: () => enumTypeBlockAttribute }\n} };\n//#endregion\n//#region src/core/authoring-field-presets.ts\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 `@internal/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* The `uuidString` / `id.uuidv4String` / `id.uuidv7String` presets store UUID\n* values as `character(36)` — portable across all SQL targets. For a native\n* Postgres `uuid` column use `uuidNative` / `id.uuidv4Native` /\n* `id.uuidv7Native` from `@internal/target-postgres`.\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 `@internal/target-postgres`) so the\n* TS callback surface and the PSL scalar surface lower to byte-identical\n* contracts for the active target.\n*/\nconst CHARACTER_CODEC_ID = \"sql/char@1\";\nconst CHARACTER_NATIVE_TYPE = \"character\";\nconst nanoidOptionsArgument = {\n\tkind: \"object\",\n\toptional: true,\n\tproperties: { size: {\n\t\tkind: \"number\",\n\t\toptional: true,\n\t\tinteger: true,\n\t\tminimum: 2,\n\t\tmaximum: 255\n\t} }\n};\nconst sqlFamilyAuthoringFieldPresets = {\n\tuuidString: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: {\n\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\ttypeParams: { length: 36 }\n\t\t}\n\t},\n\tulid: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: {\n\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\ttypeParams: { length: 26 }\n\t\t}\n\t},\n\tnanoid: {\n\t\tkind: \"fieldPreset\",\n\t\targs: [nanoidOptionsArgument],\n\t\toutput: {\n\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\ttypeParams: { length: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0,\n\t\t\t\tpath: [\"size\"],\n\t\t\t\tdefault: 21\n\t\t\t} }\n\t\t}\n\t},\n\tcuid2: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: {\n\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\ttypeParams: { length: 24 }\n\t\t}\n\t},\n\tksuid: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: {\n\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\ttypeParams: { length: 27 }\n\t\t}\n\t},\n\tid: {\n\t\tuuidv4String: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\t\ttypeParams: { length: 36 },\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"uuidv4\"\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t},\n\t\tuuidv7String: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\t\ttypeParams: { length: 36 },\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"uuidv7\"\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t},\n\t\tulid: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\t\ttypeParams: { length: 26 },\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"ulid\"\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t},\n\t\tnanoid: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\targs: [nanoidOptionsArgument],\n\t\t\toutput: {\n\t\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\t\ttypeParams: { length: {\n\t\t\t\t\tkind: \"arg\",\n\t\t\t\t\tindex: 0,\n\t\t\t\t\tpath: [\"size\"],\n\t\t\t\t\tdefault: 21\n\t\t\t\t} },\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"nanoid\",\n\t\t\t\t\tparams: { size: {\n\t\t\t\t\t\tkind: \"arg\",\n\t\t\t\t\t\tindex: 0,\n\t\t\t\t\t\tpath: [\"size\"]\n\t\t\t\t\t} }\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t},\n\t\tcuid2: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\t\ttypeParams: { length: 24 },\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"cuid2\"\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t},\n\t\tksuid: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\t\ttypeParams: { length: 27 },\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"ksuid\"\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t}\n\t}\n};\n//#endregion\n//#region src/core/authoring-type-constructors.ts\nconst sqlFamilyAuthoringTypes = { sql: { String: {\n\tkind: \"typeConstructor\",\n\tdocumentation: \"Variable-length text with a required maximum character length.\",\n\targs: [{\n\t\tkind: \"number\",\n\t\tname: \"length\",\n\t\tinteger: true,\n\t\tminimum: 1,\n\t\tmaximum: 10485760\n\t}],\n\toutput: {\n\t\tcodecId: \"sql/varchar@1\",\n\t\tnativeType: \"character varying\",\n\t\ttypeParams: { length: {\n\t\t\tkind: \"arg\",\n\t\t\tindex: 0\n\t\t} }\n\t}\n} } };\n//#endregion\nexport { sqlFamilyPslBlockDescriptors as i, sqlFamilyAuthoringFieldPresets as n, sqlFamilyEntityTypes as r, sqlFamilyAuthoringTypes as t };\n\n//# sourceMappingURL=authoring-type-constructors-C1ogrr_x.mjs.map"],"mappings":";;;;;AAIA,MAAM,uBAAuB,EAAE,MAAM;CACpC,MAAM;CACN,eAAe;CACf,QAAQ,EAAE,UAAU,OAAO,QAAQ;EAClC,MAAM,WAAW,IAAI,YAAY;EACjC,MAAM,cAAc,IAAI;EACxB,MAAM,WAAW,mBAAmB,OAAO,GAAG;EAC9C,IAAI,aAAa,KAAK,GAAG;EACzB,MAAM,EAAE,SAAS,cAAc;EAC/B,MAAM,aAAa,IAAI,aAAa,eAAe,OAAO,CAAC,GAAG;EAC9D,IAAI,eAAe,KAAK,GAAG;GAC1B,aAAa,KAAK;IACjB,MAAM;IACN,SAAS,SAAS,MAAM,KAAK,qCAAqC,QAAQ;IAC1E;IACA,MAAM;GACP,CAAC;GACD;EACD;EACA,MAAM,QAAQ,IAAI,aAAa,IAAI,OAAO;EAC1C,IAAI,UAAU,KAAK,GAAG;GACrB,aAAa,KAAK;IACjB,MAAM;IACN,SAAS,SAAS,MAAM,KAAK,kBAAkB,QAAQ;IACvD;IACA,MAAM;GACP,CAAC;GACD;EACD;EACA,MAAM,6BAA6B,IAAI,IAAI;EAC3C,MAAM,UAAU,CAAC;EACjB,IAAI,cAAc;EAClB,KAAK,MAAM,CAAC,YAAY,eAAe,OAAO,QAAQ,MAAM,UAAU,GAAG;GACxE,IAAI;GACJ,IAAI,WAAW,SAAS,QAAQ,IAAI;IACnC,QAAQ,MAAM,WAAW,UAAU;GACpC,QA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AAS;EACT,SAAS;EACT,SAAS;CACV,CAAC;CACD,QAAQ;EACP,SAAS;EACT,YAAY;EACZ,YAAY,EAAE,QAAQ;GACrB,MAAM;GACN,OAAO;EACR,EAAE;CACH;AACD,EAAE,EAAE"}
|
|
1
|
+
{"version":3,"file":"authoring-type-constructors-C1ogrr_x-VWDkCaSq.mjs","names":[],"sources":["../../../../2-sql/9-family/dist/authoring-type-constructors-C1ogrr_x.mjs"],"sourcesContent":["import { resolveEnumCodecId } from \"@internal/framework-components/authoring\";\nimport { blockAttribute, str } from \"@internal/psl-parser\";\nimport { enumType } from \"@internal/sql-contract-ts/contract-builder\";\nimport { blindCast } from \"@internal/utils/casts\";\nconst sqlFamilyEntityTypes = { enum: {\n\tkind: \"entity\",\n\tdiscriminator: \"enum\",\n\toutput: { factory: (block, ctx) => {\n\t\tconst sourceId = ctx.sourceId ?? \"unknown\";\n\t\tconst diagnostics = ctx.diagnostics;\n\t\tconst resolved = resolveEnumCodecId(block, ctx);\n\t\tif (resolved === void 0) return;\n\t\tconst { codecId, codecSpan } = resolved;\n\t\tconst nativeType = ctx.codecLookup?.targetTypesFor(codecId)?.[0];\n\t\tif (nativeType === void 0) {\n\t\t\tdiagnostics?.push({\n\t\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\t\tmessage: `enum \"${block.name}\" @@type references unknown codec \"${codecId}\"`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: codecSpan\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconst codec = ctx.codecLookup?.get(codecId);\n\t\tif (codec === void 0) {\n\t\t\tdiagnostics?.push({\n\t\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\t\tmessage: `enum \"${block.name}\" @@type codec \"${codecId}\" resolves in targetTypesFor but is absent from codecLookup.get`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: codecSpan\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconst seenValues = /* @__PURE__ */ new Set();\n\t\tconst members = [];\n\t\tlet memberError = false;\n\t\tfor (const [memberName, paramValue] of Object.entries(block.parameters)) {\n\t\t\tlet value;\n\t\t\tif (paramValue.kind === \"bare\") try {\n\t\t\t\tvalue = codec.decodeJson(memberName);\n\t\t\t} catch {\n\t\t\t\tdiagnostics?.push({\n\t\t\t\t\tcode: \"PSL_ENUM_BARE_MEMBER_NON_STRING_CODEC\",\n\t\t\t\t\tmessage: `enum \"${block.name}\" member \"${memberName}\" has no value and codec \"${codecId}\" does not accept a bare name as input`,\n\t\t\t\t\tsourceId,\n\t\t\t\t\tspan: paramValue.span\n\t\t\t\t});\n\t\t\t\tmemberError = true;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\telse if (paramValue.kind === \"value\") {\n\t\t\t\tlet jsonValue;\n\t\t\t\ttry {\n\t\t\t\t\tjsonValue = JSON.parse(paramValue.raw);\n\t\t\t\t} catch {\n\t\t\t\t\tdiagnostics?.push({\n\t\t\t\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\t\t\t\tmessage: `enum \"${block.name}\" member \"${memberName}\" value \"${paramValue.raw}\" is not valid JSON`,\n\t\t\t\t\t\tsourceId,\n\t\t\t\t\t\tspan: paramValue.span\n\t\t\t\t\t});\n\t\t\t\t\tmemberError = true;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tvalue = codec.decodeJson(blindCast(jsonValue));\n\t\t\t\t} catch (err) {\n\t\t\t\t\tconst reason = err instanceof Error ? err.message : String(err);\n\t\t\t\t\tdiagnostics?.push({\n\t\t\t\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\t\t\t\tmessage: `enum \"${block.name}\" member \"${memberName}\" was rejected by codec \"${codecId}\": ${reason}`,\n\t\t\t\t\t\tsourceId,\n\t\t\t\t\t\tspan: paramValue.span\n\t\t\t\t\t});\n\t\t\t\t\tmemberError = true;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t} else continue;\n\t\t\tconst valueKey = String(value);\n\t\t\tif (seenValues.has(valueKey)) {\n\t\t\t\tdiagnostics?.push({\n\t\t\t\t\tcode: \"PSL_ENUM_DUPLICATE_MEMBER_VALUE\",\n\t\t\t\t\tmessage: `enum \"${block.name}\": duplicate member value \"${valueKey}\"`,\n\t\t\t\t\tsourceId,\n\t\t\t\t\tspan: paramValue.span\n\t\t\t\t});\n\t\t\t\tmemberError = true;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tseenValues.add(valueKey);\n\t\t\tmembers.push({\n\t\t\t\tname: memberName,\n\t\t\t\tvalue\n\t\t\t});\n\t\t}\n\t\tif (memberError) return void 0;\n\t\tif (members.length === 0) {\n\t\t\tdiagnostics?.push({\n\t\t\t\tcode: \"PSL_ENUM_MISSING_TYPE\",\n\t\t\t\tmessage: `enum \"${block.name}\" must have at least one member`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: block.span\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\treturn enumType(block.name, {\n\t\t\tcodecId,\n\t\t\tnativeType\n\t\t}, ...members.map((m) => ({\n\t\t\tname: m.name,\n\t\t\tvalue: m.value\n\t\t})));\n\t} }\n} };\nconst enumTypeBlockAttribute = blockAttribute(\"type\", {\n\tdocumentation: \"Selects the storage codec for this enum.\",\n\tpositional: [{\n\t\tkey: \"codecId\",\n\t\ttype: str(),\n\t\tdocumentation: \"The fully qualified codec identifier used to store enum values.\"\n\t}]\n});\nconst sqlFamilyPslBlockDescriptors = { enum: {\n\tkind: \"pslBlock\",\n\tkeyword: \"enum\",\n\tdocumentation: \"Defines an enum with named values and an inferred or explicitly selected storage codec.\",\n\tdiscriminator: \"enum\",\n\tname: { required: true },\n\tparameters: {},\n\tvariadicParameters: true,\n\tattributes: { type: () => enumTypeBlockAttribute }\n} };\n//#endregion\n//#region src/core/authoring-field-presets.ts\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 `@internal/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* The `uuidString` / `id.uuidv4String` / `id.uuidv7String` presets store UUID\n* values as `character(36)` — portable across all SQL targets. For a native\n* Postgres `uuid` column use `uuidNative` / `id.uuidv4Native` /\n* `id.uuidv7Native` from `@internal/target-postgres`.\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 `@internal/target-postgres`) so the\n* TS callback surface and the PSL scalar surface lower to byte-identical\n* contracts for the active target.\n*/\nconst CHARACTER_CODEC_ID = \"sql/char@1\";\nconst CHARACTER_NATIVE_TYPE = \"character\";\nconst nanoidOptionsArgument = {\n\tkind: \"object\",\n\toptional: true,\n\tproperties: { size: {\n\t\tkind: \"number\",\n\t\toptional: true,\n\t\tinteger: true,\n\t\tminimum: 2,\n\t\tmaximum: 255\n\t} }\n};\nconst sqlFamilyAuthoringFieldPresets = {\n\tuuidString: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: {\n\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\ttypeParams: { length: 36 }\n\t\t}\n\t},\n\tulid: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: {\n\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\ttypeParams: { length: 26 }\n\t\t}\n\t},\n\tnanoid: {\n\t\tkind: \"fieldPreset\",\n\t\targs: [nanoidOptionsArgument],\n\t\toutput: {\n\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\ttypeParams: { length: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0,\n\t\t\t\tpath: [\"size\"],\n\t\t\t\tdefault: 21\n\t\t\t} }\n\t\t}\n\t},\n\tcuid2: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: {\n\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\ttypeParams: { length: 24 }\n\t\t}\n\t},\n\tksuid: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: {\n\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\ttypeParams: { length: 27 }\n\t\t}\n\t},\n\tid: {\n\t\tuuidv4String: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\t\ttypeParams: { length: 36 },\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"uuidv4\"\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t},\n\t\tuuidv7String: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\t\ttypeParams: { length: 36 },\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"uuidv7\"\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t},\n\t\tulid: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\t\ttypeParams: { length: 26 },\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"ulid\"\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t},\n\t\tnanoid: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\targs: [nanoidOptionsArgument],\n\t\t\toutput: {\n\t\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\t\ttypeParams: { length: {\n\t\t\t\t\tkind: \"arg\",\n\t\t\t\t\tindex: 0,\n\t\t\t\t\tpath: [\"size\"],\n\t\t\t\t\tdefault: 21\n\t\t\t\t} },\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"nanoid\",\n\t\t\t\t\tparams: { size: {\n\t\t\t\t\t\tkind: \"arg\",\n\t\t\t\t\t\tindex: 0,\n\t\t\t\t\t\tpath: [\"size\"]\n\t\t\t\t\t} }\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t},\n\t\tcuid2: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\t\ttypeParams: { length: 24 },\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"cuid2\"\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t},\n\t\tksuid: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\t\ttypeParams: { length: 27 },\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"ksuid\"\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t}\n\t}\n};\n//#endregion\n//#region src/core/authoring-type-constructors.ts\nconst sqlFamilyAuthoringTypes = { sql: { String: {\n\tkind: \"typeConstructor\",\n\tdocumentation: \"Variable-length text with a required maximum character length.\",\n\targs: [{\n\t\tkind: \"number\",\n\t\tname: \"length\",\n\t\tinteger: true,\n\t\tminimum: 1,\n\t\tmaximum: 10485760\n\t}],\n\toutput: {\n\t\tcodecId: \"sql/varchar@1\",\n\t\tnativeType: \"character varying\",\n\t\ttypeParams: { length: {\n\t\t\tkind: \"arg\",\n\t\t\tindex: 0\n\t\t} }\n\t}\n} } };\n//#endregion\nexport { sqlFamilyPslBlockDescriptors as i, sqlFamilyAuthoringFieldPresets as n, sqlFamilyEntityTypes as r, sqlFamilyAuthoringTypes as t };\n\n//# sourceMappingURL=authoring-type-constructors-C1ogrr_x.mjs.map"],"mappings":";;;;;AAIA,MAAM,uBAAuB,EAAE,MAAM;CACpC,MAAM;CACN,eAAe;CACf,QAAQ,EAAE,UAAU,OAAO,QAAQ;EAClC,MAAM,WAAW,IAAI,YAAY;EACjC,MAAM,cAAc,IAAI;EACxB,MAAM,WAAW,mBAAmB,OAAO,GAAG;EAC9C,IAAI,aAAa,KAAK,GAAG;EACzB,MAAM,EAAE,SAAS,cAAc;EAC/B,MAAM,aAAa,IAAI,aAAa,eAAe,OAAO,CAAC,GAAG;EAC9D,IAAI,eAAe,KAAK,GAAG;GAC1B,aAAa,KAAK;IACjB,MAAM;IACN,SAAS,SAAS,MAAM,KAAK,qCAAqC,QAAQ;IAC1E;IACA,MAAM;GACP,CAAC;GACD;EACD;EACA,MAAM,QAAQ,IAAI,aAAa,IAAI,OAAO;EAC1C,IAAI,UAAU,KAAK,GAAG;GACrB,aAAa,KAAK;IACjB,MAAM;IACN,SAAS,SAAS,MAAM,KAAK,kBAAkB,QAAQ;IACvD;IACA,MAAM;GACP,CAAC;GACD;EACD;EACA,MAAM,6BAA6B,IAAI,IAAI;EAC3C,MAAM,UAAU,CAAC;EACjB,IAAI,cAAc;EAClB,KAAK,MAAM,CAAC,YAAY,eAAe,OAAO,QAAQ,MAAM,UAAU,GAAG;GACxE,IAAI;GACJ,IAAI,WAAW,SAAS,QAAQ,IAAI;IACnC,QA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AC;EACN,MAAM;EACN,MAAM;EACN,SAAS;EACT,SAAS;EACT,SAAS;CACV,CAAC;CACD,QAAQ;EACP,SAAS;EACT,YAAY;EACZ,YAAY,EAAE,QAAQ;GACrB,MAAM;GACN,OAAO;EACR,EAAE;CACH;AACD,EAAE,EAAE"}
|
package/dist/builder.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { o as Expression, x as ScopeField } from "./expression-
|
|
2
|
-
import { T as WhereFilter, _ as SelectQuery, a as DeleteQuery, c as GatedMethod, f as QueryContext, g as Scope, h as ResolveRow, i as Db, l as GroupedQuery, s as Functions, t as AggregateFunctions, u as InsertQuery, v as Subquery, w as UpdateQuery, x as TableProxy } from "./db-BhQdL6Za-
|
|
1
|
+
import { o as Expression, x as ScopeField } from "./expression-CAJjmssr.mjs";
|
|
2
|
+
import { T as WhereFilter, _ as SelectQuery, a as DeleteQuery, c as GatedMethod, f as QueryContext, g as Scope, h as ResolveRow, i as Db, l as GroupedQuery, s as Functions, t as AggregateFunctions, u as InsertQuery, v as Subquery, w as UpdateQuery, x as TableProxy } from "./db-BhQdL6Za-BBgu_awF.mjs";
|
|
3
3
|
export type { AggregateFunctions, Db, DeleteQuery, Expression, Functions, GatedMethod, GroupedQuery, InsertQuery, QueryContext, ResolveRow, Scope, ScopeField, SelectQuery, Subquery, TableProxy, UpdateQuery, WhereFilter };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { c as SqlStorage } from "./sql-storage-8LqxeLAY-DH4DdUXx.mjs";
|
|
2
|
-
import "./types-
|
|
3
|
-
import { i as SqlOperationEntry } from "./index-
|
|
4
|
-
import {
|
|
5
|
-
import "./ast-
|
|
6
|
-
import { l as RawCodecInferer, o as Expression, x as ScopeField } from "./expression-
|
|
7
|
-
import { S as TableProxyContract, f as QueryContext, g as Scope, i as Db, o as FieldProxy, p as RawLane, s as Functions, t as AggregateFunctions } from "./db-BhQdL6Za-
|
|
8
|
-
import { c as SqlAggregateDescriptorRegistry, r as ExecutionContext } from "./query-lane-context-
|
|
9
|
-
import "./query-lane-context-
|
|
2
|
+
import "./types-C36_3E6_.mjs";
|
|
3
|
+
import { i as SqlOperationEntry } from "./index-CLAshwKN.mjs";
|
|
4
|
+
import { c as AnyExpression } from "./types-YGX78yVc-BBy1pp_1.mjs";
|
|
5
|
+
import "./ast-d2-iNoEs.mjs";
|
|
6
|
+
import { l as RawCodecInferer, o as Expression, x as ScopeField } from "./expression-CAJjmssr.mjs";
|
|
7
|
+
import { S as TableProxyContract, f as QueryContext, g as Scope, i as Db, o as FieldProxy, p as RawLane, s as Functions, t as AggregateFunctions } from "./db-BhQdL6Za-BBgu_awF.mjs";
|
|
8
|
+
import { c as SqlAggregateDescriptorRegistry, r as ExecutionContext } from "./query-lane-context-BUNC86DS-C_hIrqaW.mjs";
|
|
9
|
+
import "./query-lane-context-CeOxBL6I.mjs";
|
|
10
10
|
import { Contract } from "@prisma/orm-framework/contract/types";
|
|
11
11
|
//#region ../../../2-sql/4-lanes/sql-builder/dist/runtime/index.d.mts
|
|
12
12
|
//#region src/runtime/expression-impl.d.ts
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { o as Expression, x as ScopeField } from "./expression-
|
|
2
|
-
import { C as UnboundTables, S as TableProxyContract, T as WhereFilter, _ as SelectQuery, a as DeleteQuery, b as TableNamesAcrossNamespaces, c as GatedMethod, d as Namespace, f as QueryContext, g as Scope, h as ResolveRow, i as Db, l as GroupedQuery, m as RawTagFor, n as BooleanCodecType, p as RawLane, r as ContractRawTag, s as Functions, t as AggregateFunctions, u as InsertQuery, v as Subquery, w as UpdateQuery, x as TableProxy, y as TableInAnyNamespace } from "./db-BhQdL6Za-
|
|
1
|
+
import { o as Expression, x as ScopeField } from "./expression-CAJjmssr.mjs";
|
|
2
|
+
import { C as UnboundTables, S as TableProxyContract, T as WhereFilter, _ as SelectQuery, a as DeleteQuery, b as TableNamesAcrossNamespaces, c as GatedMethod, d as Namespace, f as QueryContext, g as Scope, h as ResolveRow, i as Db, l as GroupedQuery, m as RawTagFor, n as BooleanCodecType, p as RawLane, r as ContractRawTag, s as Functions, t as AggregateFunctions, u as InsertQuery, v as Subquery, w as UpdateQuery, x as TableProxy, y as TableInAnyNamespace } from "./db-BhQdL6Za-BBgu_awF.mjs";
|
|
3
3
|
export type { AggregateFunctions, BooleanCodecType, ContractRawTag, Db, DeleteQuery, Expression, Functions, GatedMethod, GroupedQuery, InsertQuery, Namespace, QueryContext, RawLane, RawTagFor, ResolveRow, Scope, ScopeField, SelectQuery, Subquery, TableInAnyNamespace, TableNamesAcrossNamespaces, TableProxy, TableProxyContract, UnboundTables, UpdateQuery, WhereFilter };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as SqlNamespaceBase, s as SqlNamespaceInput } from "./sql-storage-8LqxeLAY-DH4DdUXx.mjs";
|
|
2
|
-
import "./types-
|
|
3
|
-
import { t as SqlNamespaceFactory } from "./derived-checks-DPdD01O0-
|
|
2
|
+
import "./types-C36_3E6_.mjs";
|
|
3
|
+
import { t as SqlNamespaceFactory } from "./derived-checks-DPdD01O0-DNBs1ZDA.mjs";
|
|
4
4
|
import { Contract, ControlPolicy } from "@prisma/orm-framework/contract/types";
|
|
5
5
|
import { TargetPackRef } from "@prisma/orm-framework/components/components";
|
|
6
6
|
import { ContractConfig, ContractConfig as ContractConfig$1 } from "@prisma/orm-framework/config/config-types";
|
|
@@ -25,4 +25,4 @@ declare function typescriptContract(contract: Contract, output?: string, options
|
|
|
25
25
|
declare function typescriptContractFromPath(contractPath: string, output?: string, options?: TypeScriptContractSpecifierOptions): ContractConfig;
|
|
26
26
|
//#endregion
|
|
27
27
|
export { typescriptContractFromPath as i, emptyContract as n, typescriptContract as r, ContractConfig$1 as t };
|
|
28
|
-
//# sourceMappingURL=config-types-
|
|
28
|
+
//# sourceMappingURL=config-types-Bd3ud-mX.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-types-
|
|
1
|
+
{"version":3,"file":"config-types-Bd3ud-mX.d.mts","names":[],"sources":["../../../../2-sql/2-authoring/contract-ts/dist/config-types.d.mts"],"mappings":";;;;;;;;;;;;;UAWU;WACC,sBAAsB;WACtB,iBAAiB;;iBAEX,cAAc;WACpB;WACA,QAAQ;WACR,kBAAkB,OAAO,sBAAsB;WAC/C,uBAAuB;IAC9B;iBACa,mBAAmB,UAAU,UAAU,iBAAiB,UAAU,qCAAqC;iBACvG,2BAA2B,sBAAsB,iBAAiB,UAAU,qCAAqC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as buildSqlContractFromDefinition, r as contractError, t as applySqlSpecifierControlPolicy } from "./derived-checks-
|
|
1
|
+
import { n as buildSqlContractFromDefinition, r as contractError, t as applySqlSpecifierControlPolicy } from "./derived-checks-6WZKIUxH-B3Pd6QA5.mjs";
|
|
2
2
|
import { InternalError } from "@prisma/orm-framework/utils/internal-error";
|
|
3
3
|
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
4
4
|
import { ok } from "@prisma/orm-framework/utils/result";
|
|
@@ -61,4 +61,4 @@ function typescriptContractFromPath(contractPath, output, options) {
|
|
|
61
61
|
//#endregion
|
|
62
62
|
export { typescriptContract as n, typescriptContractFromPath as r, emptyContract as t };
|
|
63
63
|
|
|
64
|
-
//# sourceMappingURL=config-types-
|
|
64
|
+
//# sourceMappingURL=config-types-fwqTEhK6.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-types-
|
|
1
|
+
{"version":3,"file":"config-types-fwqTEhK6.mjs","names":[],"sources":["../../../../2-sql/2-authoring/contract-ts/dist/config-types.mjs"],"sourcesContent":["import { i as contractError, n as buildSqlContractFromDefinition, t as applySqlSpecifierControlPolicy } from \"./derived-checks-6WZKIUxH.mjs\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { pathToFileURL } from \"node:url\";\nimport { ok } from \"@internal/utils/result\";\nimport { extname } from \"pathe\";\n//#region src/config-types.ts\n/**\n* Derives the emit output path from the TS contract input so artefacts land\n* colocated with the source (e.g. `prisma/contract.ts` →\n* `prisma/contract.json`). Mirrors the same default-derivation logic in\n* `@internal/sql-contract-psl/provider`.\n*/\nfunction defaultOutputFromContractPath(contractPath) {\n\tconst ext = extname(contractPath);\n\tif (ext.length === 0) return `${contractPath}.json`;\n\treturn `${contractPath.slice(0, -ext.length)}.json`;\n}\nfunction emptyContract(options) {\n\treturn {\n\t\tsource: {\n\t\t\tformat: \"typescript\",\n\t\t\tload: async () => {\n\t\t\t\treturn ok(applySqlSpecifierControlPolicy(buildSqlContractFromDefinition({\n\t\t\t\t\twarnings: void 0,\n\t\t\t\t\ttarget: options.target,\n\t\t\t\t\tcreateNamespace: options.createNamespace,\n\t\t\t\t\tmodels: []\n\t\t\t\t}), options.defaultControlPolicy, options.createNamespace));\n\t\t\t}\n\t\t},\n\t\t...ifDefined(\"output\", options.output)\n\t};\n}\nfunction typescriptContract(contract, output, options) {\n\treturn {\n\t\tsource: {\n\t\t\tformat: \"typescript\",\n\t\t\tload: async () => ok(options === void 0 ? contract : applySqlSpecifierControlPolicy(contract, options.defaultControlPolicy, options.createNamespace))\n\t\t},\n\t\t...ifDefined(\"output\", output)\n\t};\n}\nfunction typescriptContractFromPath(contractPath, output, options) {\n\treturn {\n\t\tsource: {\n\t\t\tformat: \"typescript\",\n\t\t\tinputs: [contractPath],\n\t\t\tload: async (context) => {\n\t\t\t\tconst [absolutePath] = context.resolvedInputs;\n\t\t\t\tif (absolutePath === void 0) throw new InternalError(\"typescriptContractFromPath: context.resolvedInputs is empty. The CLI config loader should populate it positional-matched with source.inputs.\");\n\t\t\t\tconst mod = await import(pathToFileURL(absolutePath).href);\n\t\t\t\tconst contract = mod.default ?? mod.contract;\n\t\t\t\tif (contract === void 0) throw contractError(\"CONTRACT.MODULE_EXPORT_MISSING\", `typescriptContractFromPath: module at \"${absolutePath}\" has no \"default\" or \"contract\" export.`, { meta: { path: absolutePath } });\n\t\t\t\treturn ok(options === void 0 ? contract : applySqlSpecifierControlPolicy(contract, options.defaultControlPolicy, options.createNamespace));\n\t\t\t}\n\t\t},\n\t\toutput: output ?? defaultOutputFromContractPath(contractPath)\n\t};\n}\n//#endregion\nexport { emptyContract, typescriptContract, typescriptContractFromPath };\n\n//# sourceMappingURL=config-types.mjs.map"],"mappings":";;;;;;;;;;;;;AAaA,SAAS,8BAA8B,cAAc;CACpD,MAAM,MAAM,QAAQ,YAAY;CAChC,IAAI,IAAI,WAAW,GAAG,OAAO,GAAG,aAAa;CAC7C,OAAO,GAAG,aAAa,MAAM,GAAG,CAAC,IAAI,MAAM,EAAE;AAC9C;AACA,SAAS,cAAc,SAAS;CAC/B,OAAO;EACN,QAAQ;GACP,QAAQ;GACR,MAAM,YAAY;IACjB,OAAO,GAAG,+BAA+B,+BAA+B;KACvE,UAAU,KAAK;KACf,QAAQ,QAAQ;KAChB,iBAAiB,QAAQ;KACzB,QAAQ,CAAC;IACV,CAAC,GAAG,QAAQ,sBAAsB,QAAQ,eAAe,CAAC;GAC3D;EACD;EACA,GAAG,UAAU,UAAU,QAAQ,MAAM;CACtC;AACD;AACA,SAAS,mBAAmB,UAAU,QAAQ,SAAS;CACtD,OAAO;EACN,QAAQ;GACP,QAAQ;GACR,MAAM,YAAY,GAAG,YAAY,KAAK,IAAI,WAAW,+BAA+B,UAAU,QAAQ,sBAAsB,QAAQ,eAAe,CAAC;EACrJ;EACA,GAAG,UAAU,UAAU,MAAM;CAC9B;AACD;AACA,SAAS,2BAA2B,cAAc,QAAQ,SAAS;CAClE,OAAO;EACN,QAAQ;GACP,QAAQ;GACR,QAAQ,CAAC,YAAY;GACrB,MAAM,OAAO,YAAY;IACxB,MAAM,CAAC,gBAAgB,QAAQ;IAC/B,IAAI,iBAAiB,KAAK,GAAG,MAAM,IAAI,cAAc,8IAA8I;IACnM,MAAM,MAAM,MAAM,OAAO,cAAc,YAAY,CAAC,CAAC;IACrD,MAAM,W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