@prisma/orm-family-sql 8.0.0-rc.11-dev.27 → 8.0.0-rc.11-dev.28
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/{control-I3ucqOtI.d.mts → control-D7OmKjH2.d.mts} +13 -9
- package/dist/{control-I3ucqOtI.d.mts.map → control-D7OmKjH2.d.mts.map} +1 -1
- package/dist/control-DCVNWLzt.mjs.map +1 -1
- package/dist/family.d.mts +1 -1
- package/dist/family.mjs +2 -2
- package/dist/family__control.d.mts +1 -1
- package/dist/family__control.mjs +1 -1
- package/dist/family__runtime.mjs +1 -1
- package/dist/orm-client.mjs +5 -5
- package/dist/orm-client.mjs.map +1 -1
- package/dist/{runtime-PknWErjr.mjs → runtime-DfvE_FqD.mjs} +2 -2
- package/dist/{runtime-PknWErjr.mjs.map → runtime-DfvE_FqD.mjs.map} +1 -1
- package/dist/{timestamp-now-generator-BZnBo7IC-DbN5Apqe.mjs → timestamp-now-generator-CVrEeaJp-Bt_PHBSf.mjs} +8 -8
- package/dist/timestamp-now-generator-CVrEeaJp-Bt_PHBSf.mjs.map +1 -0
- package/package.json +18 -18
- package/dist/timestamp-now-generator-BZnBo7IC-DbN5Apqe.mjs.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as TIMESTAMP_NOW_GENERATOR_ID } from "./timestamp-now-generator-
|
|
1
|
+
import { t as TIMESTAMP_NOW_GENERATOR_ID } from "./timestamp-now-generator-CVrEeaJp-Bt_PHBSf.mjs";
|
|
2
2
|
import { UNBOUND_DOMAIN_NAMESPACE_ID, resolveDomainModel } from "@prisma/orm-framework/contract/types";
|
|
3
3
|
//#region ../../../2-sql/9-family/dist/runtime.mjs
|
|
4
4
|
/**
|
|
@@ -52,4 +52,4 @@ var runtime_default = sqlRuntimeFamilyDescriptor;
|
|
|
52
52
|
//#endregion
|
|
53
53
|
export { timestampNowRuntimeGenerator as i, resolveDomainModel as n, runtime_default as r, UNBOUND_DOMAIN_NAMESPACE_ID as t };
|
|
54
54
|
|
|
55
|
-
//# sourceMappingURL=runtime-
|
|
55
|
+
//# sourceMappingURL=runtime-DfvE_FqD.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-
|
|
1
|
+
{"version":3,"file":"runtime-DfvE_FqD.mjs","names":[],"sources":["../../../../2-sql/9-family/dist/runtime.mjs"],"sourcesContent":["import { t as TIMESTAMP_NOW_GENERATOR_ID } from \"./timestamp-now-generator-CVrEeaJp.mjs\";\nimport { UNBOUND_DOMAIN_NAMESPACE_ID, resolveDomainModel } from \"@internal/contract/types\";\nimport { resolveStorageTable } from \"@internal/sql-contract/resolve-storage-table\";\n//#region src/core/runtime-instance.ts\n/**\n* Creates a SQL execution-plane family instance.\n*\n* This will be renamed to `createSqlExecutionFamilyInstance()` as part of `TML-1842`.\n*/\nfunction createSqlRuntimeFamilyInstance() {\n\treturn { familyId: \"sql\" };\n}\n//#endregion\n//#region src/core/runtime-descriptor.ts\n/**\n* SQL execution-plane family descriptor.\n*\n* Note: this is currently named `sqlRuntimeFamilyDescriptor` because the execution plane\n* framework types are still using the `Runtime*` naming (`RuntimeFamilyDescriptor`, etc.).\n*\n* This will be renamed to `sqlExecutionFamilyDescriptor` as part of `TML-1842`.\n*/\nconst sqlRuntimeFamilyDescriptor = {\n\tkind: \"family\",\n\tid: \"sql\",\n\tfamilyId: \"sql\",\n\tversion: \"0.0.1\",\n\tcreate() {\n\t\treturn createSqlRuntimeFamilyInstance();\n\t}\n};\nObject.freeze(sqlRuntimeFamilyDescriptor);\n//#endregion\n//#region src/core/timestamp-now-runtime-generator.ts\n/**\n* Builds the canonical runtime-plane generator for the wall-clock-now\n* mutation default. Returns `new Date()`; semantics are target-agnostic\n* so all SQL targets share this single implementation.\n*\n* Declares `stability: 'query'` so a single ORM bulk operation\n* (e.g. `createAll([...])`) shares one timestamp across every row and\n* every timestamp-defaulted column. Matches Prisma 6's `@updatedAt`\n* semantics: one `new Date()` per lowered mutation, not per row.\n*\n* Lives in a runtime-plane-only module so the control-plane\n* `timestamp-now-generator.ts` (descriptor + authoring presets) stays\n* free of `@internal/sql-runtime` imports.\n*/\nfunction timestampNowRuntimeGenerator() {\n\treturn {\n\t\tid: TIMESTAMP_NOW_GENERATOR_ID,\n\t\tgenerate: () => /* @__PURE__ */ new Date(),\n\t\tstability: \"query\"\n\t};\n}\n//#endregion\n//#region src/exports/runtime.ts\nvar runtime_default = sqlRuntimeFamilyDescriptor;\n//#endregion\nexport { UNBOUND_DOMAIN_NAMESPACE_ID, runtime_default as default, resolveDomainModel, resolveStorageTable, timestampNowRuntimeGenerator };\n\n//# sourceMappingURL=runtime.mjs.map"],"mappings":";;;;;;;;AASA,SAAS,iCAAiC;CACzC,OAAO,EAAE,UAAU,MAAM;AAC1B;;;;;;;;;AAWA,MAAM,6BAA6B;CAClC,MAAM;CACN,IAAI;CACJ,UAAU;CACV,SAAS;CACT,SAAS;EACR,OAAO,+BAA+B;CACvC;AACD;AACA,OAAO,OAAO,0BAA0B;;;;;;;;;;;;;;;AAiBxC,SAAS,+BAA+B;CACvC,OAAO;EACN,IAAI;EACJ,gCAAgC,IAAI,KAAK;EACzC,WAAW;CACZ;AACD;AAGA,IAAI,kBAAkB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../../2-sql/9-family/dist/timestamp-now-generator-
|
|
1
|
+
//#region ../../../2-sql/9-family/dist/timestamp-now-generator-CVrEeaJp.mjs
|
|
2
2
|
/**
|
|
3
3
|
* Canonical id for the wall-clock-now mutation default generator.
|
|
4
4
|
*
|
|
@@ -39,8 +39,8 @@ function timestampNowControlDescriptor() {
|
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
41
41
|
* Builds the canonical `temporal.{createdAt,updatedAt}` field-preset pair
|
|
42
|
-
* for a SQL target. `createdAt` lowers to
|
|
43
|
-
* `updatedAt` lowers to
|
|
42
|
+
* for a SQL target. `createdAt` lowers to an execution generator on `onCreate`;
|
|
43
|
+
* `updatedAt` lowers to the same generator on both `onCreate` and
|
|
44
44
|
* `onUpdate` (RD: "last modified time", non-null). Targets supply the
|
|
45
45
|
* codec/native-type pair that matches their timestamp column; everything
|
|
46
46
|
* else is shared so PSL `temporal.updatedAt()` and TS
|
|
@@ -57,10 +57,10 @@ function temporalAuthoringPresets(input) {
|
|
|
57
57
|
output: {
|
|
58
58
|
codecId,
|
|
59
59
|
nativeType,
|
|
60
|
-
|
|
61
|
-
kind: "
|
|
62
|
-
|
|
63
|
-
}
|
|
60
|
+
executionDefaults: { onCreate: {
|
|
61
|
+
kind: "generator",
|
|
62
|
+
id: generatorId
|
|
63
|
+
} }
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
66
|
updatedAt: {
|
|
@@ -178,4 +178,4 @@ function temporalCodecPreset(input) {
|
|
|
178
178
|
//#endregion
|
|
179
179
|
export { temporalStringAuthoringPresets as a, temporalCodecPresetWithPrecision as i, temporalAuthoringPresets as n, timestampNowControlDescriptor as o, temporalCodecPreset as r, TIMESTAMP_NOW_GENERATOR_ID as t };
|
|
180
180
|
|
|
181
|
-
//# sourceMappingURL=timestamp-now-generator-
|
|
181
|
+
//# sourceMappingURL=timestamp-now-generator-CVrEeaJp-Bt_PHBSf.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timestamp-now-generator-CVrEeaJp-Bt_PHBSf.mjs","names":[],"sources":["../../../../2-sql/9-family/dist/timestamp-now-generator-CVrEeaJp.mjs"],"sourcesContent":["//#region src/core/timestamp-now-generator.ts\n/**\n* Canonical id for the wall-clock-now mutation default generator.\n*\n* Owned by `family-sql` because that's where the generator lives. The\n* id flows out from here to (1) the control-plane descriptor and the\n* temporal field-preset pair below, (2) the runtime-plane sibling\n* `timestamp-now-runtime-generator.ts`, and (3) authoring surfaces\n* (PSL `temporal.updatedAt()`, TS `field.temporal.updatedAt()`) via\n* the descriptor flow. Co-locating the constant with its only owner\n* keeps the framework layer free of concrete generator ids.\n*/\nconst TIMESTAMP_NOW_GENERATOR_ID = \"timestampNow\";\n/**\n* Builds the canonical control-plane descriptor for the wall-clock-now\n* mutation default generator. The descriptor's `id` and `buildPhases`\n* are target-agnostic so PSL `temporal.updatedAt()` and TS\n* `field.temporal.updatedAt()` lower to byte-identical contracts.\n*\n* `applicableCodecIds` is omitted: `timestampNow` is preset-only (not\n* reachable via `@default(timestampNow())` lowering), and the codec is\n* co-registered by the preset descriptor itself, so the\n* `@default(...)` compatibility check has no role to play here.\n*/\nfunction timestampNowControlDescriptor() {\n\treturn {\n\t\tid: TIMESTAMP_NOW_GENERATOR_ID,\n\t\tbuildPhases: () => ({\n\t\t\tonCreate: {\n\t\t\t\tkind: \"generator\",\n\t\t\t\tid: TIMESTAMP_NOW_GENERATOR_ID\n\t\t\t},\n\t\t\tonUpdate: {\n\t\t\t\tkind: \"generator\",\n\t\t\t\tid: TIMESTAMP_NOW_GENERATOR_ID\n\t\t\t}\n\t\t})\n\t};\n}\n/**\n* Builds the canonical `temporal.{createdAt,updatedAt}` field-preset pair\n* for a SQL target. `createdAt` lowers to an execution generator on `onCreate`;\n* `updatedAt` lowers to the same generator on both `onCreate` and\n* `onUpdate` (RD: \"last modified time\", non-null). Targets supply the\n* codec/native-type pair that matches their timestamp column; everything\n* else is shared so PSL `temporal.updatedAt()` and TS\n* `field.temporal.updatedAt()` lower to byte-identical contracts across\n* targets by construction.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction temporalAuthoringPresets(input) {\n\tconst { codecId, nativeType } = input;\n\tconst generatorId = input.generatorId ?? \"timestampNow\";\n\treturn {\n\t\tcreatedAt: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId,\n\t\t\t\tnativeType,\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: generatorId\n\t\t\t\t} }\n\t\t\t}\n\t\t},\n\t\tupdatedAt: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId,\n\t\t\t\tnativeType,\n\t\t\t\texecutionDefaults: {\n\t\t\t\t\tonCreate: {\n\t\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\t\tid: generatorId\n\t\t\t\t\t},\n\t\t\t\t\tonUpdate: {\n\t\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\t\tid: generatorId\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n}\nfunction temporalStringAuthoringPresets(input) {\n\tconst presets = /* @__PURE__ */ temporalAuthoringPresets(input);\n\treturn {\n\t\tcreatedAtString: presets.createdAt,\n\t\tupdatedAtString: presets.updatedAt\n\t};\n}\nconst TEMPORAL_PRECISION_ARG = {\n\tname: \"precision\",\n\tkind: \"number\",\n\toptional: true,\n\tinteger: true,\n\tminimum: 0\n};\nconst TEMPORAL_ON_CREATE_ARG = {\n\tname: \"onCreate\",\n\tkind: \"option\",\n\tvalues: [\"now\"],\n\toptional: true\n};\nconst TEMPORAL_ON_UPDATE_ARG = {\n\tname: \"onUpdate\",\n\tkind: \"option\",\n\tvalues: [\"now\"],\n\toptional: true\n};\n/**\n* Selects a generator descriptor for the preset's `now` token. The token is preset vocabulary; the\n* generator id never appears in a user's spelling (ADR 169 — these generators are preset-only).\n*/\nfunction temporalPhaseTemplate(index, generatorId) {\n\treturn {\n\t\tkind: \"select\",\n\t\tindex,\n\t\tcases: { now: {\n\t\t\tkind: \"generator\",\n\t\t\tid: generatorId\n\t\t} }\n\t};\n}\n/**\n* Builds a `temporal.<codec>` field preset for a codec that takes a precision\n* parameter (`pg/timestamp-temporal@1`, `pg/timestamptz-temporal@1`). Arguments change field\n* properties only — never the codec, which the caller fixes here.\n*\n* All three arguments are optional: omitting `precision` omits `typeParams`\n* entirely, and omitting a phase omits that phase (both omitted omits\n* `executionDefaults`).\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction temporalCodecPresetWithPrecision(input) {\n\tconst generatorId = input.generatorId ?? \"timestampNow\";\n\treturn {\n\t\tkind: \"fieldPreset\",\n\t\targs: [\n\t\t\tTEMPORAL_PRECISION_ARG,\n\t\t\tTEMPORAL_ON_CREATE_ARG,\n\t\t\tTEMPORAL_ON_UPDATE_ARG\n\t\t],\n\t\toutput: {\n\t\t\tcodecId: input.codecId,\n\t\t\tnativeType: input.nativeType,\n\t\t\ttypeParams: { precision: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} },\n\t\t\texecutionDefaults: {\n\t\t\t\tonCreate: temporalPhaseTemplate(1, generatorId),\n\t\t\t\tonUpdate: temporalPhaseTemplate(2, generatorId)\n\t\t\t}\n\t\t}\n\t};\n}\n/**\n* Builds a `temporal.<codec>` field preset for a codec with no type\n* parameters (`sqlite/datetime@1`). As with the precision-bearing variant,\n* both phase arguments are optional and omitting one omits that phase.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction temporalCodecPreset(input) {\n\treturn {\n\t\tkind: \"fieldPreset\",\n\t\targs: [TEMPORAL_ON_CREATE_ARG, TEMPORAL_ON_UPDATE_ARG],\n\t\toutput: {\n\t\t\tcodecId: input.codecId,\n\t\t\tnativeType: input.nativeType,\n\t\t\texecutionDefaults: {\n\t\t\t\tonCreate: temporalPhaseTemplate(0, TIMESTAMP_NOW_GENERATOR_ID),\n\t\t\t\tonUpdate: temporalPhaseTemplate(1, TIMESTAMP_NOW_GENERATOR_ID)\n\t\t\t}\n\t\t}\n\t};\n}\n//#endregion\nexport { temporalStringAuthoringPresets as a, temporalCodecPresetWithPrecision as i, temporalAuthoringPresets as n, timestampNowControlDescriptor as o, temporalCodecPreset as r, TIMESTAMP_NOW_GENERATOR_ID as t };\n\n//# sourceMappingURL=timestamp-now-generator-CVrEeaJp.mjs.map"],"mappings":";;;;;;;;;;;;AAYA,MAAM,6BAA6B;;;;;;;;;;;;AAYnC,SAAS,gCAAgC;CACxC,OAAO;EACN,IAAI;EACJ,oBAAoB;GACnB,UA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WAAW;IAC9C,UAAU,sBAAsB,GAAG,WAAW;GAC/C;EACD;CACD;AACD;;;;;;;AAOA,SAAS,oBAAoB,OAAO;CACnC,OAAO;EACN,MAAM;EACN,MAAM,CAAC,wBAAwB,sBAAsB;EACrD,QAAQ;GACP,SAAS,MAAM;GACf,YAAY,MAAM;GAClB,mBAAmB;IAClB,UAAU,sBAAsB,GAAG,0BAA0B;IAC7D,UAAU,sBAAsB,GAAG,0BAA0B;GAC9D;EACD;CACD;AACD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/orm-family-sql",
|
|
3
|
-
"version": "8.0.0-rc.11-dev.
|
|
3
|
+
"version": "8.0.0-rc.11-dev.28",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
"dist"
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@prisma/orm-framework": "8.0.0-rc.11-dev.
|
|
13
|
-
"@prisma/orm-toolchain": "8.0.0-rc.11-dev.
|
|
12
|
+
"@prisma/orm-framework": "8.0.0-rc.11-dev.28",
|
|
13
|
+
"@prisma/orm-toolchain": "8.0.0-rc.11-dev.28",
|
|
14
14
|
"@standard-schema/spec": "^1.1.0",
|
|
15
15
|
"arktype": "^2.2.2",
|
|
16
16
|
"pathe": "^2.0.3",
|
|
@@ -18,21 +18,21 @@
|
|
|
18
18
|
"ts-toolbelt": "^9.6.0"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@internal/family-sql": "8.0.0-rc.11-dev.
|
|
22
|
-
"@internal/sql-builder": "8.0.0-rc.11-dev.
|
|
23
|
-
"@internal/sql-contract": "8.0.0-rc.11-dev.
|
|
24
|
-
"@internal/sql-contract-emitter": "8.0.0-rc.11-dev.
|
|
25
|
-
"@internal/sql-contract-prisma7": "8.0.0-rc.11-dev.
|
|
26
|
-
"@internal/sql-contract-psl": "8.0.0-rc.11-dev.
|
|
27
|
-
"@internal/sql-contract-ts": "8.0.0-rc.11-dev.
|
|
28
|
-
"@internal/sql-errors": "8.0.0-rc.11-dev.
|
|
29
|
-
"@internal/sql-operations": "8.0.0-rc.11-dev.
|
|
30
|
-
"@internal/sql-orm-client": "8.0.0-rc.11-dev.
|
|
31
|
-
"@internal/sql-relational-core": "8.0.0-rc.11-dev.
|
|
32
|
-
"@internal/sql-runtime": "8.0.0-rc.11-dev.
|
|
33
|
-
"@internal/sql-schema-ir": "8.0.0-rc.11-dev.
|
|
34
|
-
"@repo/tsconfig": "8.0.0-rc.11-dev.
|
|
35
|
-
"@repo/tsdown": "8.0.0-rc.11-dev.
|
|
21
|
+
"@internal/family-sql": "8.0.0-rc.11-dev.28",
|
|
22
|
+
"@internal/sql-builder": "8.0.0-rc.11-dev.28",
|
|
23
|
+
"@internal/sql-contract": "8.0.0-rc.11-dev.28",
|
|
24
|
+
"@internal/sql-contract-emitter": "8.0.0-rc.11-dev.28",
|
|
25
|
+
"@internal/sql-contract-prisma7": "8.0.0-rc.11-dev.28",
|
|
26
|
+
"@internal/sql-contract-psl": "8.0.0-rc.11-dev.28",
|
|
27
|
+
"@internal/sql-contract-ts": "8.0.0-rc.11-dev.28",
|
|
28
|
+
"@internal/sql-errors": "8.0.0-rc.11-dev.28",
|
|
29
|
+
"@internal/sql-operations": "8.0.0-rc.11-dev.28",
|
|
30
|
+
"@internal/sql-orm-client": "8.0.0-rc.11-dev.28",
|
|
31
|
+
"@internal/sql-relational-core": "8.0.0-rc.11-dev.28",
|
|
32
|
+
"@internal/sql-runtime": "8.0.0-rc.11-dev.28",
|
|
33
|
+
"@internal/sql-schema-ir": "8.0.0-rc.11-dev.28",
|
|
34
|
+
"@repo/tsconfig": "8.0.0-rc.11-dev.28",
|
|
35
|
+
"@repo/tsdown": "8.0.0-rc.11-dev.28",
|
|
36
36
|
"tsdown": "0.22.14",
|
|
37
37
|
"typescript": "5.9.3"
|
|
38
38
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"timestamp-now-generator-BZnBo7IC-DbN5Apqe.mjs","names":[],"sources":["../../../../2-sql/9-family/dist/timestamp-now-generator-BZnBo7IC.mjs"],"sourcesContent":["//#region src/core/timestamp-now-generator.ts\n/**\n* Canonical id for the wall-clock-now mutation default generator.\n*\n* Owned by `family-sql` because that's where the generator lives. The\n* id flows out from here to (1) the control-plane descriptor and the\n* temporal field-preset pair below, (2) the runtime-plane sibling\n* `timestamp-now-runtime-generator.ts`, and (3) authoring surfaces\n* (PSL `temporal.updatedAt()`, TS `field.temporal.updatedAt()`) via\n* the descriptor flow. Co-locating the constant with its only owner\n* keeps the framework layer free of concrete generator ids.\n*/\nconst TIMESTAMP_NOW_GENERATOR_ID = \"timestampNow\";\n/**\n* Builds the canonical control-plane descriptor for the wall-clock-now\n* mutation default generator. The descriptor's `id` and `buildPhases`\n* are target-agnostic so PSL `temporal.updatedAt()` and TS\n* `field.temporal.updatedAt()` lower to byte-identical contracts.\n*\n* `applicableCodecIds` is omitted: `timestampNow` is preset-only (not\n* reachable via `@default(timestampNow())` lowering), and the codec is\n* co-registered by the preset descriptor itself, so the\n* `@default(...)` compatibility check has no role to play here.\n*/\nfunction timestampNowControlDescriptor() {\n\treturn {\n\t\tid: TIMESTAMP_NOW_GENERATOR_ID,\n\t\tbuildPhases: () => ({\n\t\t\tonCreate: {\n\t\t\t\tkind: \"generator\",\n\t\t\t\tid: TIMESTAMP_NOW_GENERATOR_ID\n\t\t\t},\n\t\t\tonUpdate: {\n\t\t\t\tkind: \"generator\",\n\t\t\t\tid: TIMESTAMP_NOW_GENERATOR_ID\n\t\t\t}\n\t\t})\n\t};\n}\n/**\n* Builds the canonical `temporal.{createdAt,updatedAt}` field-preset pair\n* for a SQL target. `createdAt` lowers to a `now()` storage default;\n* `updatedAt` lowers to an execution generator on both `onCreate` and\n* `onUpdate` (RD: \"last modified time\", non-null). Targets supply the\n* codec/native-type pair that matches their timestamp column; everything\n* else is shared so PSL `temporal.updatedAt()` and TS\n* `field.temporal.updatedAt()` lower to byte-identical contracts across\n* targets by construction.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction temporalAuthoringPresets(input) {\n\tconst { codecId, nativeType } = input;\n\tconst generatorId = input.generatorId ?? \"timestampNow\";\n\treturn {\n\t\tcreatedAt: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId,\n\t\t\t\tnativeType,\n\t\t\t\tdefault: {\n\t\t\t\t\tkind: \"function\",\n\t\t\t\t\texpression: \"now()\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tupdatedAt: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId,\n\t\t\t\tnativeType,\n\t\t\t\texecutionDefaults: {\n\t\t\t\t\tonCreate: {\n\t\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\t\tid: generatorId\n\t\t\t\t\t},\n\t\t\t\t\tonUpdate: {\n\t\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\t\tid: generatorId\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n}\nfunction temporalStringAuthoringPresets(input) {\n\tconst presets = /* @__PURE__ */ temporalAuthoringPresets(input);\n\treturn {\n\t\tcreatedAtString: presets.createdAt,\n\t\tupdatedAtString: presets.updatedAt\n\t};\n}\nconst TEMPORAL_PRECISION_ARG = {\n\tname: \"precision\",\n\tkind: \"number\",\n\toptional: true,\n\tinteger: true,\n\tminimum: 0\n};\nconst TEMPORAL_ON_CREATE_ARG = {\n\tname: \"onCreate\",\n\tkind: \"option\",\n\tvalues: [\"now\"],\n\toptional: true\n};\nconst TEMPORAL_ON_UPDATE_ARG = {\n\tname: \"onUpdate\",\n\tkind: \"option\",\n\tvalues: [\"now\"],\n\toptional: true\n};\n/**\n* Selects a generator descriptor for the preset's `now` token. The token is preset vocabulary; the\n* generator id never appears in a user's spelling (ADR 169 — these generators are preset-only).\n*/\nfunction temporalPhaseTemplate(index, generatorId) {\n\treturn {\n\t\tkind: \"select\",\n\t\tindex,\n\t\tcases: { now: {\n\t\t\tkind: \"generator\",\n\t\t\tid: generatorId\n\t\t} }\n\t};\n}\n/**\n* Builds a `temporal.<codec>` field preset for a codec that takes a precision\n* parameter (`pg/timestamp-temporal@1`, `pg/timestamptz-temporal@1`). Arguments change field\n* properties only — never the codec, which the caller fixes here.\n*\n* All three arguments are optional: omitting `precision` omits `typeParams`\n* entirely, and omitting a phase omits that phase (both omitted omits\n* `executionDefaults`).\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction temporalCodecPresetWithPrecision(input) {\n\tconst generatorId = input.generatorId ?? \"timestampNow\";\n\treturn {\n\t\tkind: \"fieldPreset\",\n\t\targs: [\n\t\t\tTEMPORAL_PRECISION_ARG,\n\t\t\tTEMPORAL_ON_CREATE_ARG,\n\t\t\tTEMPORAL_ON_UPDATE_ARG\n\t\t],\n\t\toutput: {\n\t\t\tcodecId: input.codecId,\n\t\t\tnativeType: input.nativeType,\n\t\t\ttypeParams: { precision: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} },\n\t\t\texecutionDefaults: {\n\t\t\t\tonCreate: temporalPhaseTemplate(1, generatorId),\n\t\t\t\tonUpdate: temporalPhaseTemplate(2, generatorId)\n\t\t\t}\n\t\t}\n\t};\n}\n/**\n* Builds a `temporal.<codec>` field preset for a codec with no type\n* parameters (`sqlite/datetime@1`). As with the precision-bearing variant,\n* both phase arguments are optional and omitting one omits that phase.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction temporalCodecPreset(input) {\n\treturn {\n\t\tkind: \"fieldPreset\",\n\t\targs: [TEMPORAL_ON_CREATE_ARG, TEMPORAL_ON_UPDATE_ARG],\n\t\toutput: {\n\t\t\tcodecId: input.codecId,\n\t\t\tnativeType: input.nativeType,\n\t\t\texecutionDefaults: {\n\t\t\t\tonCreate: temporalPhaseTemplate(0, TIMESTAMP_NOW_GENERATOR_ID),\n\t\t\t\tonUpdate: temporalPhaseTemplate(1, TIMESTAMP_NOW_GENERATOR_ID)\n\t\t\t}\n\t\t}\n\t};\n}\n//#endregion\nexport { temporalStringAuthoringPresets as a, temporalCodecPresetWithPrecision as i, temporalAuthoringPresets as n, timestampNowControlDescriptor as o, temporalCodecPreset as r, TIMESTAMP_NOW_GENERATOR_ID as t };\n\n//# sourceMappingURL=timestamp-now-generator-BZnBo7IC.mjs.map"],"mappings":";;;;;;;;;;;;AAYA,MAAM,6BAA6B;;;;;;;;;;;;AAYnC,SAAS,gCAAgC;CACxC,OAAO;EACN,IAAI;EACJ,oBAAoB;GACnB,UAAU;IACT,MAAM;IACN,IAAI;GACL;GACA,UAAU;IACT,MAAM;IACN,IAAI;GACL;EACD;CACD;AACD;;;;;;;;;;;;AAYA,SAAS,yBAAyB,OAAO;CACxC,MAAM,EAAE,SAAS,eAAe;CAChC,MAAM,cAAc,MAAM,eAAe;CACzC,OAAO;EACN,WAAW;GACV,MAAM;GACN,QAAQ;IACP;IACA;IACA,SAAS;KACR,MAAM;KACN,YAAY;IACb;GACD;EACD;EACA,WAAW;GACV,MAAM;GACN,QAAQ;IACP;IACA;IACA,mBAAmB;KAClB,UAAU;MACT,MAAM;MACN,IAAI;KACL;KACA,UAAU;MACT,MAAM;MACN,IAAI;KACL;IACD;GACD;EACD;CACD;AACD;AACA,SAAS,+BAA+B,OAAO;CAC9C,MAAM,UAA0B,yCAAyB,KAAK;CAC9D,OAAO;EACN,iBAAiB,QAAQ;EACzB,iBAAiB,QAAQ;CAC1B;AACD;AACA,MAAM,yBAAyB;CAC9B,MAAM;CACN,MAAM;CACN,UAAU;CACV,SAAS;CACT,SAAS;AACV;AACA,MAAM,yBAAyB;CAC9B,MAAM;CACN,MAAM;CACN,QAAQ,CAAC,KAAK;CACd,UAAU;AACX;AACA,MAAM,yBAAyB;CAC9B,MAAM;CACN,MA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