@prisma-next/family-sql 0.5.0-dev.51 → 0.5.0-dev.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{authoring-type-constructors-BAR65pSK.mjs → authoring-type-constructors-D9b8AG6y.mjs} +13 -13
- package/dist/authoring-type-constructors-D9b8AG6y.mjs.map +1 -0
- package/dist/control-adapter.d.mts +1 -1
- package/dist/control.d.mts +95 -26
- package/dist/control.d.mts.map +1 -1
- package/dist/control.mjs +3 -2
- package/dist/control.mjs.map +1 -1
- package/dist/migration.d.mts +1 -1
- package/dist/pack.d.mts +35 -23
- package/dist/pack.mjs +1 -1
- package/dist/runtime.d.mts +19 -1
- package/dist/runtime.d.mts.map +1 -1
- package/dist/runtime.mjs +27 -1
- package/dist/runtime.mjs.map +1 -1
- package/dist/schema-verify.d.mts +2 -2
- package/dist/timestamp-now-generator-Bt4L3cfM.mjs +86 -0
- package/dist/timestamp-now-generator-Bt4L3cfM.mjs.map +1 -0
- package/dist/{types-UI3K69S6.d.mts → types-DiBtjG6M.d.mts} +1 -1
- package/dist/{types-UI3K69S6.d.mts.map → types-DiBtjG6M.d.mts.map} +1 -1
- package/dist/{verify-sql-schema-_EoNcGIq.d.mts → verify-sql-schema-DW8Agf1F.d.mts} +1 -1
- package/dist/{verify-sql-schema-_EoNcGIq.d.mts.map → verify-sql-schema-DW8Agf1F.d.mts.map} +1 -1
- package/package.json +20 -20
- package/src/core/authoring-field-presets.ts +35 -23
- package/src/core/timestamp-now-generator.ts +74 -0
- package/src/core/timestamp-now-runtime-generator.ts +24 -0
- package/src/exports/control.ts +4 -0
- package/src/exports/runtime.ts +2 -0
- package/dist/authoring-type-constructors-BAR65pSK.mjs.map +0 -1
package/dist/{authoring-type-constructors-BAR65pSK.mjs → authoring-type-constructors-D9b8AG6y.mjs}
RENAMED
|
@@ -81,10 +81,10 @@ const sqlFamilyAuthoringFieldPresets = {
|
|
|
81
81
|
codecId: CHARACTER_CODEC_ID,
|
|
82
82
|
nativeType: CHARACTER_NATIVE_TYPE,
|
|
83
83
|
typeParams: { length: 36 },
|
|
84
|
-
|
|
84
|
+
executionDefaults: { onCreate: {
|
|
85
85
|
kind: "generator",
|
|
86
86
|
id: "uuidv4"
|
|
87
|
-
},
|
|
87
|
+
} },
|
|
88
88
|
id: true
|
|
89
89
|
}
|
|
90
90
|
},
|
|
@@ -94,10 +94,10 @@ const sqlFamilyAuthoringFieldPresets = {
|
|
|
94
94
|
codecId: CHARACTER_CODEC_ID,
|
|
95
95
|
nativeType: CHARACTER_NATIVE_TYPE,
|
|
96
96
|
typeParams: { length: 36 },
|
|
97
|
-
|
|
97
|
+
executionDefaults: { onCreate: {
|
|
98
98
|
kind: "generator",
|
|
99
99
|
id: "uuidv7"
|
|
100
|
-
},
|
|
100
|
+
} },
|
|
101
101
|
id: true
|
|
102
102
|
}
|
|
103
103
|
},
|
|
@@ -107,10 +107,10 @@ const sqlFamilyAuthoringFieldPresets = {
|
|
|
107
107
|
codecId: CHARACTER_CODEC_ID,
|
|
108
108
|
nativeType: CHARACTER_NATIVE_TYPE,
|
|
109
109
|
typeParams: { length: 26 },
|
|
110
|
-
|
|
110
|
+
executionDefaults: { onCreate: {
|
|
111
111
|
kind: "generator",
|
|
112
112
|
id: "ulid"
|
|
113
|
-
},
|
|
113
|
+
} },
|
|
114
114
|
id: true
|
|
115
115
|
}
|
|
116
116
|
},
|
|
@@ -126,7 +126,7 @@ const sqlFamilyAuthoringFieldPresets = {
|
|
|
126
126
|
path: ["size"],
|
|
127
127
|
default: 21
|
|
128
128
|
} },
|
|
129
|
-
|
|
129
|
+
executionDefaults: { onCreate: {
|
|
130
130
|
kind: "generator",
|
|
131
131
|
id: "nanoid",
|
|
132
132
|
params: { size: {
|
|
@@ -134,7 +134,7 @@ const sqlFamilyAuthoringFieldPresets = {
|
|
|
134
134
|
index: 0,
|
|
135
135
|
path: ["size"]
|
|
136
136
|
} }
|
|
137
|
-
},
|
|
137
|
+
} },
|
|
138
138
|
id: true
|
|
139
139
|
}
|
|
140
140
|
},
|
|
@@ -144,10 +144,10 @@ const sqlFamilyAuthoringFieldPresets = {
|
|
|
144
144
|
codecId: CHARACTER_CODEC_ID,
|
|
145
145
|
nativeType: CHARACTER_NATIVE_TYPE,
|
|
146
146
|
typeParams: { length: 24 },
|
|
147
|
-
|
|
147
|
+
executionDefaults: { onCreate: {
|
|
148
148
|
kind: "generator",
|
|
149
149
|
id: "cuid2"
|
|
150
|
-
},
|
|
150
|
+
} },
|
|
151
151
|
id: true
|
|
152
152
|
}
|
|
153
153
|
},
|
|
@@ -157,10 +157,10 @@ const sqlFamilyAuthoringFieldPresets = {
|
|
|
157
157
|
codecId: CHARACTER_CODEC_ID,
|
|
158
158
|
nativeType: CHARACTER_NATIVE_TYPE,
|
|
159
159
|
typeParams: { length: 27 },
|
|
160
|
-
|
|
160
|
+
executionDefaults: { onCreate: {
|
|
161
161
|
kind: "generator",
|
|
162
162
|
id: "ksuid"
|
|
163
|
-
},
|
|
163
|
+
} },
|
|
164
164
|
id: true
|
|
165
165
|
}
|
|
166
166
|
}
|
|
@@ -190,4 +190,4 @@ const sqlFamilyAuthoringTypes = { sql: { String: {
|
|
|
190
190
|
|
|
191
191
|
//#endregion
|
|
192
192
|
export { sqlFamilyAuthoringFieldPresets as n, sqlFamilyAuthoringTypes as t };
|
|
193
|
-
//# sourceMappingURL=authoring-type-constructors-
|
|
193
|
+
//# sourceMappingURL=authoring-type-constructors-D9b8AG6y.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authoring-type-constructors-D9b8AG6y.mjs","names":[],"sources":["../src/core/authoring-field-presets.ts","../src/core/authoring-type-constructors.ts"],"sourcesContent":["import type { AuthoringFieldNamespace } from '@prisma-next/framework-components/authoring';\n\n/**\n * Family-level SQL authoring field presets.\n *\n * Only presets whose codec IDs align with the ID generator metadata live here\n * (see `@prisma-next/ids`). These presets are target-agnostic because the\n * generator metadata fixes their codec/native-type to `sql/char@1`\n * (`character`) regardless of target, and the PSL interpreter lets the\n * generator override the scalar descriptor.\n *\n * Scalar presets that map to target-specific codecs (e.g. `text`, `int`,\n * `boolean`, `dateTime`) are contributed by the target pack (see\n * `postgresAuthoringFieldPresets` in `@prisma-next/target-postgres`) so the\n * TS callback surface and the PSL scalar surface lower to byte-identical\n * contracts for the active target.\n */\n\nconst CHARACTER_CODEC_ID = 'sql/char@1';\nconst CHARACTER_NATIVE_TYPE = 'character';\n\nconst nanoidOptionsArgument = {\n kind: 'object',\n optional: true,\n properties: {\n size: {\n kind: 'number',\n optional: true,\n integer: true,\n minimum: 2,\n maximum: 255,\n },\n },\n} as const;\n\nexport const sqlFamilyAuthoringFieldPresets = {\n uuid: {\n kind: 'fieldPreset',\n output: {\n codecId: CHARACTER_CODEC_ID,\n nativeType: CHARACTER_NATIVE_TYPE,\n typeParams: {\n length: 36,\n },\n },\n },\n ulid: {\n kind: 'fieldPreset',\n output: {\n codecId: CHARACTER_CODEC_ID,\n nativeType: CHARACTER_NATIVE_TYPE,\n typeParams: {\n length: 26,\n },\n },\n },\n nanoid: {\n kind: 'fieldPreset',\n args: [nanoidOptionsArgument],\n output: {\n codecId: CHARACTER_CODEC_ID,\n nativeType: CHARACTER_NATIVE_TYPE,\n typeParams: {\n length: {\n kind: 'arg',\n index: 0,\n path: ['size'],\n default: 21,\n },\n },\n },\n },\n cuid2: {\n kind: 'fieldPreset',\n output: {\n codecId: CHARACTER_CODEC_ID,\n nativeType: CHARACTER_NATIVE_TYPE,\n typeParams: {\n length: 24,\n },\n },\n },\n ksuid: {\n kind: 'fieldPreset',\n output: {\n codecId: CHARACTER_CODEC_ID,\n nativeType: CHARACTER_NATIVE_TYPE,\n typeParams: {\n length: 27,\n },\n },\n },\n id: {\n uuidv4: {\n kind: 'fieldPreset',\n output: {\n codecId: CHARACTER_CODEC_ID,\n nativeType: CHARACTER_NATIVE_TYPE,\n typeParams: {\n length: 36,\n },\n executionDefaults: {\n onCreate: {\n kind: 'generator',\n id: 'uuidv4',\n },\n },\n id: true,\n },\n },\n uuidv7: {\n kind: 'fieldPreset',\n output: {\n codecId: CHARACTER_CODEC_ID,\n nativeType: CHARACTER_NATIVE_TYPE,\n typeParams: {\n length: 36,\n },\n executionDefaults: {\n onCreate: {\n kind: 'generator',\n id: 'uuidv7',\n },\n },\n id: true,\n },\n },\n ulid: {\n kind: 'fieldPreset',\n output: {\n codecId: CHARACTER_CODEC_ID,\n nativeType: CHARACTER_NATIVE_TYPE,\n typeParams: {\n length: 26,\n },\n executionDefaults: {\n onCreate: {\n kind: 'generator',\n id: 'ulid',\n },\n },\n id: true,\n },\n },\n nanoid: {\n kind: 'fieldPreset',\n args: [nanoidOptionsArgument],\n output: {\n codecId: CHARACTER_CODEC_ID,\n nativeType: CHARACTER_NATIVE_TYPE,\n typeParams: {\n length: {\n kind: 'arg',\n index: 0,\n path: ['size'],\n default: 21,\n },\n },\n executionDefaults: {\n onCreate: {\n kind: 'generator',\n id: 'nanoid',\n params: {\n size: {\n kind: 'arg',\n index: 0,\n path: ['size'],\n },\n },\n },\n },\n id: true,\n },\n },\n cuid2: {\n kind: 'fieldPreset',\n output: {\n codecId: CHARACTER_CODEC_ID,\n nativeType: CHARACTER_NATIVE_TYPE,\n typeParams: {\n length: 24,\n },\n executionDefaults: {\n onCreate: {\n kind: 'generator',\n id: 'cuid2',\n },\n },\n id: true,\n },\n },\n ksuid: {\n kind: 'fieldPreset',\n output: {\n codecId: CHARACTER_CODEC_ID,\n nativeType: CHARACTER_NATIVE_TYPE,\n typeParams: {\n length: 27,\n },\n executionDefaults: {\n onCreate: {\n kind: 'generator',\n id: 'ksuid',\n },\n },\n id: true,\n },\n },\n },\n} as const satisfies AuthoringFieldNamespace;\n","import type { AuthoringTypeNamespace } from '@prisma-next/framework-components/authoring';\n\nexport const sqlFamilyAuthoringTypes = {\n sql: {\n String: {\n kind: 'typeConstructor',\n args: [{ kind: 'number', name: 'length', integer: true, minimum: 1, maximum: 10485760 }],\n output: {\n codecId: 'sql/varchar@1',\n nativeType: 'character varying',\n typeParams: {\n length: { kind: 'arg', index: 0 },\n },\n },\n },\n },\n} as const satisfies AuthoringTypeNamespace;\n"],"mappings":";;;;;;;;;;;;;;;;AAkBA,MAAM,qBAAqB;AAC3B,MAAM,wBAAwB;AAE9B,MAAM,wBAAwB;CAC5B,MAAM;CACN,UAAU;CACV,YAAY,EACV,MAAM;EACJ,MAAM;EACN,UAAU;EACV,SAAS;EACT,SAAS;EACT,SAAS;EACV,EACF;CACF;AAED,MAAa,iCAAiC;CAC5C,MAAM;EACJ,MAAM;EACN,QAAQ;GACN,SAAS;GACT,YAAY;GACZ,YAAY,EACV,QAAQ,IACT;GACF;EACF;CACD,MAAM;EACJ,MAAM;EACN,QAAQ;GACN,SAAS;GACT,YAAY;GACZ,YAAY,EACV,QAAQ,IACT;GACF;EACF;CACD,QAAQ;EACN,MAAM;EACN,MAAM,CAAC,sBAAsB;EAC7B,QAAQ;GACN,SAAS;GACT,YAAY;GACZ,YAAY,EACV,QAAQ;IACN,MAAM;IACN,OAAO;IACP,MAAM,CAAC,OAAO;IACd,SAAS;IACV,EACF;GACF;EACF;CACD,OAAO;EACL,MAAM;EACN,QAAQ;GACN,SAAS;GACT,YAAY;GACZ,YAAY,EACV,QAAQ,IACT;GACF;EACF;CACD,OAAO;EACL,MAAM;EACN,QAAQ;GACN,SAAS;GACT,YAAY;GACZ,YAAY,EACV,QAAQ,IACT;GACF;EACF;CACD,IAAI;EACF,QAAQ;GACN,MAAM;GACN,QAAQ;IACN,SAAS;IACT,YAAY;IACZ,YAAY,EACV,QAAQ,IACT;IACD,mBAAmB,EACjB,UAAU;KACR,MAAM;KACN,IAAI;KACL,EACF;IACD,IAAI;IACL;GACF;EACD,QAAQ;GACN,MAAM;GACN,QAAQ;IACN,SAAS;IACT,YAAY;IACZ,YAAY,EACV,QAAQ,IACT;IACD,mBAAmB,EACjB,UAAU;KACR,MAAM;KACN,IAAI;KACL,EACF;IACD,IAAI;IACL;GACF;EACD,MAAM;GACJ,MAAM;GACN,QAAQ;IACN,SAAS;IACT,YAAY;IACZ,YAAY,EACV,QAAQ,IACT;IACD,mBAAmB,EACjB,UAAU;KACR,MAAM;KACN,IAAI;KACL,EACF;IACD,IAAI;IACL;GACF;EACD,QAAQ;GACN,MAAM;GACN,MAAM,CAAC,sBAAsB;GAC7B,QAAQ;IACN,SAAS;IACT,YAAY;IACZ,YAAY,EACV,QAAQ;KACN,MAAM;KACN,OAAO;KACP,MAAM,CAAC,OAAO;KACd,SAAS;KACV,EACF;IACD,mBAAmB,EACjB,UAAU;KACR,MAAM;KACN,IAAI;KACJ,QAAQ,EACN,MAAM;MACJ,MAAM;MACN,OAAO;MACP,MAAM,CAAC,OAAO;MACf,EACF;KACF,EACF;IACD,IAAI;IACL;GACF;EACD,OAAO;GACL,MAAM;GACN,QAAQ;IACN,SAAS;IACT,YAAY;IACZ,YAAY,EACV,QAAQ,IACT;IACD,mBAAmB,EACjB,UAAU;KACR,MAAM;KACN,IAAI;KACL,EACF;IACD,IAAI;IACL;GACF;EACD,OAAO;GACL,MAAM;GACN,QAAQ;IACN,SAAS;IACT,YAAY;IACZ,YAAY,EACV,QAAQ,IACT;IACD,mBAAmB,EACjB,UAAU;KACR,MAAM;KACN,IAAI;KACL,EACF;IACD,IAAI;IACL;GACF;EACF;CACF;;;;AC/MD,MAAa,0BAA0B,EACrC,KAAK,EACH,QAAQ;CACN,MAAM;CACN,MAAM,CAAC;EAAE,MAAM;EAAU,MAAM;EAAU,SAAS;EAAM,SAAS;EAAG,SAAS;EAAU,CAAC;CACxF,QAAQ;EACN,SAAS;EACT,YAAY;EACZ,YAAY,EACV,QAAQ;GAAE,MAAM;GAAO,OAAO;GAAG,EAClC;EACF;CACF,EACF,EACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as NativeTypeNormalizer, t as DefaultNormalizer } from "./verify-sql-schema-
|
|
1
|
+
import { n as NativeTypeNormalizer, t as DefaultNormalizer } from "./verify-sql-schema-DW8Agf1F.mjs";
|
|
2
2
|
import { ControlAdapterInstance, ControlDriverInstance, ControlStack } from "@prisma-next/framework-components/control";
|
|
3
3
|
import { ContractMarkerRecord } from "@prisma-next/contract/types";
|
|
4
4
|
import { AnyQueryAst, LoweredStatement, LowererContext } from "@prisma-next/sql-relational-core/ast";
|
package/dist/control.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as SqlPlannerResult, C as SqlMigrationRunnerResult, D as SqlPlannerConflictKind, E as SqlPlannerConflict, F as SchemaVerifyOptions, I as SqlControlFamilyInstance, M as StorageTypePlanResult, N as collectInitDependencies, O as SqlPlannerConflictLocation, P as isDatabaseDependencyProvider, S as SqlMigrationRunnerFailure, T as SqlPlanTargetDetails, _ as SqlMigrationPlannerPlanOptions, a as CreateSqlMigrationPlanOptions, b as SqlMigrationRunnerExecuteCallbacks, c as SqlControlAdapterDescriptor, d as SqlMigrationPlan, f as SqlMigrationPlanContractInfo, g as SqlMigrationPlanner, h as SqlMigrationPlanOperationTarget, i as ComponentDatabaseDependency, j as SqlPlannerSuccessResult, k as SqlPlannerFailureResult, l as SqlControlExtensionDescriptor, m as SqlMigrationPlanOperationStep, n as CodecControlHooks, o as ExpandNativeTypeInput, p as SqlMigrationPlanOperation, r as ComponentDatabaseDependencies, s as ResolveIdentityValueInput, t as AnyRecord, u as SqlControlTargetDescriptor, v as SqlMigrationRunner, w as SqlMigrationRunnerSuccessValue, x as SqlMigrationRunnerExecuteOptions, y as SqlMigrationRunnerErrorCode } from "./types-
|
|
2
|
-
import { ControlFamilyDescriptor, ControlStack, MigrationOperationClass, MigrationOperationPolicy, MigrationOperationPolicy as MigrationOperationPolicy$1, MigrationPlan, MigrationPlanOperation, MigrationPlanner, MigrationPlannerConflict, MigrationPlannerConflict as MigrationPlannerConflict$1, MigrationPlannerResult, TargetMigrationsCapability, assembleAuthoringContributions } from "@prisma-next/framework-components/control";
|
|
1
|
+
import { A as SqlPlannerResult, C as SqlMigrationRunnerResult, D as SqlPlannerConflictKind, E as SqlPlannerConflict, F as SchemaVerifyOptions, I as SqlControlFamilyInstance, M as StorageTypePlanResult, N as collectInitDependencies, O as SqlPlannerConflictLocation, P as isDatabaseDependencyProvider, S as SqlMigrationRunnerFailure, T as SqlPlanTargetDetails, _ as SqlMigrationPlannerPlanOptions, a as CreateSqlMigrationPlanOptions, b as SqlMigrationRunnerExecuteCallbacks, c as SqlControlAdapterDescriptor, d as SqlMigrationPlan, f as SqlMigrationPlanContractInfo, g as SqlMigrationPlanner, h as SqlMigrationPlanOperationTarget, i as ComponentDatabaseDependency, j as SqlPlannerSuccessResult, k as SqlPlannerFailureResult, l as SqlControlExtensionDescriptor, m as SqlMigrationPlanOperationStep, n as CodecControlHooks, o as ExpandNativeTypeInput, p as SqlMigrationPlanOperation, r as ComponentDatabaseDependencies, s as ResolveIdentityValueInput, t as AnyRecord, u as SqlControlTargetDescriptor, v as SqlMigrationRunner, w as SqlMigrationRunnerSuccessValue, x as SqlMigrationRunnerExecuteOptions, y as SqlMigrationRunnerErrorCode } from "./types-DiBtjG6M.mjs";
|
|
2
|
+
import { ControlFamilyDescriptor, ControlStack, MigrationOperationClass, MigrationOperationPolicy, MigrationOperationPolicy as MigrationOperationPolicy$1, MigrationPlan, MigrationPlanOperation, MigrationPlanner, MigrationPlannerConflict, MigrationPlannerConflict as MigrationPlannerConflict$1, MigrationPlannerResult, MutationDefaultGeneratorDescriptor, TargetMigrationsCapability, assembleAuthoringContributions } from "@prisma-next/framework-components/control";
|
|
3
3
|
import { NotOk, Ok } from "@prisma-next/utils/result";
|
|
4
4
|
import * as _prisma_next_contract_types0 from "@prisma-next/contract/types";
|
|
5
5
|
import { ColumnDefault, Contract } from "@prisma-next/contract/types";
|
|
@@ -105,9 +105,11 @@ declare class SqlFamilyDescriptor implements ControlFamilyDescriptor<'sql', SqlC
|
|
|
105
105
|
readonly typeParams: {
|
|
106
106
|
readonly length: 36;
|
|
107
107
|
};
|
|
108
|
-
readonly
|
|
109
|
-
readonly
|
|
110
|
-
|
|
108
|
+
readonly executionDefaults: {
|
|
109
|
+
readonly onCreate: {
|
|
110
|
+
readonly kind: "generator";
|
|
111
|
+
readonly id: "uuidv4";
|
|
112
|
+
};
|
|
111
113
|
};
|
|
112
114
|
readonly id: true;
|
|
113
115
|
};
|
|
@@ -120,9 +122,11 @@ declare class SqlFamilyDescriptor implements ControlFamilyDescriptor<'sql', SqlC
|
|
|
120
122
|
readonly typeParams: {
|
|
121
123
|
readonly length: 36;
|
|
122
124
|
};
|
|
123
|
-
readonly
|
|
124
|
-
readonly
|
|
125
|
-
|
|
125
|
+
readonly executionDefaults: {
|
|
126
|
+
readonly onCreate: {
|
|
127
|
+
readonly kind: "generator";
|
|
128
|
+
readonly id: "uuidv7";
|
|
129
|
+
};
|
|
126
130
|
};
|
|
127
131
|
readonly id: true;
|
|
128
132
|
};
|
|
@@ -135,9 +139,11 @@ declare class SqlFamilyDescriptor implements ControlFamilyDescriptor<'sql', SqlC
|
|
|
135
139
|
readonly typeParams: {
|
|
136
140
|
readonly length: 26;
|
|
137
141
|
};
|
|
138
|
-
readonly
|
|
139
|
-
readonly
|
|
140
|
-
|
|
142
|
+
readonly executionDefaults: {
|
|
143
|
+
readonly onCreate: {
|
|
144
|
+
readonly kind: "generator";
|
|
145
|
+
readonly id: "ulid";
|
|
146
|
+
};
|
|
141
147
|
};
|
|
142
148
|
readonly id: true;
|
|
143
149
|
};
|
|
@@ -168,14 +174,16 @@ declare class SqlFamilyDescriptor implements ControlFamilyDescriptor<'sql', SqlC
|
|
|
168
174
|
readonly default: 21;
|
|
169
175
|
};
|
|
170
176
|
};
|
|
171
|
-
readonly
|
|
172
|
-
readonly
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
readonly
|
|
176
|
-
readonly
|
|
177
|
-
|
|
178
|
-
|
|
177
|
+
readonly executionDefaults: {
|
|
178
|
+
readonly onCreate: {
|
|
179
|
+
readonly kind: "generator";
|
|
180
|
+
readonly id: "nanoid";
|
|
181
|
+
readonly params: {
|
|
182
|
+
readonly size: {
|
|
183
|
+
readonly kind: "arg";
|
|
184
|
+
readonly index: 0;
|
|
185
|
+
readonly path: readonly ["size"];
|
|
186
|
+
};
|
|
179
187
|
};
|
|
180
188
|
};
|
|
181
189
|
};
|
|
@@ -190,9 +198,11 @@ declare class SqlFamilyDescriptor implements ControlFamilyDescriptor<'sql', SqlC
|
|
|
190
198
|
readonly typeParams: {
|
|
191
199
|
readonly length: 24;
|
|
192
200
|
};
|
|
193
|
-
readonly
|
|
194
|
-
readonly
|
|
195
|
-
|
|
201
|
+
readonly executionDefaults: {
|
|
202
|
+
readonly onCreate: {
|
|
203
|
+
readonly kind: "generator";
|
|
204
|
+
readonly id: "cuid2";
|
|
205
|
+
};
|
|
196
206
|
};
|
|
197
207
|
readonly id: true;
|
|
198
208
|
};
|
|
@@ -205,9 +215,11 @@ declare class SqlFamilyDescriptor implements ControlFamilyDescriptor<'sql', SqlC
|
|
|
205
215
|
readonly typeParams: {
|
|
206
216
|
readonly length: 27;
|
|
207
217
|
};
|
|
208
|
-
readonly
|
|
209
|
-
readonly
|
|
210
|
-
|
|
218
|
+
readonly executionDefaults: {
|
|
219
|
+
readonly onCreate: {
|
|
220
|
+
readonly kind: "generator";
|
|
221
|
+
readonly id: "ksuid";
|
|
222
|
+
};
|
|
211
223
|
};
|
|
212
224
|
readonly id: true;
|
|
213
225
|
};
|
|
@@ -329,8 +341,65 @@ declare function runnerFailure(code: SqlMigrationRunnerErrorCode, summary: strin
|
|
|
329
341
|
*/
|
|
330
342
|
declare const INIT_ADDITIVE_POLICY: MigrationOperationPolicy$1;
|
|
331
343
|
//#endregion
|
|
344
|
+
//#region src/core/timestamp-now-generator.d.ts
|
|
345
|
+
/**
|
|
346
|
+
* Builds the canonical control-plane descriptor for the wall-clock-now
|
|
347
|
+
* mutation default generator. The descriptor's `id` and `buildPhases`
|
|
348
|
+
* are target-agnostic so PSL `temporal.updatedAt()` and TS
|
|
349
|
+
* `field.temporal.updatedAt()` lower to byte-identical contracts.
|
|
350
|
+
*
|
|
351
|
+
* `applicableCodecIds` is omitted: `timestampNow` is preset-only (not
|
|
352
|
+
* reachable via `@default(timestampNow())` lowering), and the codec is
|
|
353
|
+
* co-registered by the preset descriptor itself, so the
|
|
354
|
+
* `@default(...)` compatibility check has no role to play here.
|
|
355
|
+
*/
|
|
356
|
+
declare function timestampNowControlDescriptor(): MutationDefaultGeneratorDescriptor;
|
|
357
|
+
/**
|
|
358
|
+
* Builds the canonical `temporal.{createdAt,updatedAt}` field-preset pair
|
|
359
|
+
* for a SQL target. `createdAt` lowers to a `now()` storage default;
|
|
360
|
+
* `updatedAt` lowers to the `timestampNow` execution generator on both
|
|
361
|
+
* `onCreate` and `onUpdate` (RD: "last modified time", non-null). Targets
|
|
362
|
+
* supply the codec/native-type pair that matches their timestamp column;
|
|
363
|
+
* everything else is shared so PSL `temporal.updatedAt()` and TS
|
|
364
|
+
* `field.temporal.updatedAt()` lower to byte-identical contracts across
|
|
365
|
+
* targets by construction.
|
|
366
|
+
*/
|
|
367
|
+
declare function temporalAuthoringPresets<const CodecId extends string, const NativeType extends string>(input: {
|
|
368
|
+
readonly codecId: CodecId;
|
|
369
|
+
readonly nativeType: NativeType;
|
|
370
|
+
}): {
|
|
371
|
+
readonly createdAt: {
|
|
372
|
+
readonly kind: "fieldPreset";
|
|
373
|
+
readonly output: {
|
|
374
|
+
readonly codecId: CodecId;
|
|
375
|
+
readonly nativeType: NativeType;
|
|
376
|
+
readonly default: {
|
|
377
|
+
readonly kind: "function";
|
|
378
|
+
readonly expression: "now()";
|
|
379
|
+
};
|
|
380
|
+
};
|
|
381
|
+
};
|
|
382
|
+
readonly updatedAt: {
|
|
383
|
+
readonly kind: "fieldPreset";
|
|
384
|
+
readonly output: {
|
|
385
|
+
readonly codecId: CodecId;
|
|
386
|
+
readonly nativeType: NativeType;
|
|
387
|
+
readonly executionDefaults: {
|
|
388
|
+
readonly onCreate: {
|
|
389
|
+
readonly kind: "generator";
|
|
390
|
+
readonly id: "timestampNow";
|
|
391
|
+
};
|
|
392
|
+
readonly onUpdate: {
|
|
393
|
+
readonly kind: "generator";
|
|
394
|
+
readonly id: "timestampNow";
|
|
395
|
+
};
|
|
396
|
+
};
|
|
397
|
+
};
|
|
398
|
+
};
|
|
399
|
+
};
|
|
400
|
+
//#endregion
|
|
332
401
|
//#region src/exports/control.d.ts
|
|
333
402
|
declare const _default: SqlFamilyDescriptor;
|
|
334
403
|
//#endregion
|
|
335
|
-
export { type CodecControlHooks, type ComponentDatabaseDependencies, type ComponentDatabaseDependency, type ContractToSchemaIROptions, type CreateSqlMigrationPlanOptions, type DefaultRenderer, type ExpandNativeTypeInput, INIT_ADDITIVE_POLICY, type MigrationOperationClass, type MigrationOperationPolicy, type MigrationPlan, type MigrationPlanOperation, type MigrationPlanner, type MigrationPlannerConflict, type MigrationPlannerResult, type NativeTypeExpander, type ResolveIdentityValueInput, type SchemaVerifyOptions, type SqlControlAdapterDescriptor, type SqlControlExtensionDescriptor, type SqlControlFamilyInstance, type SqlControlTargetDescriptor, type SqlMigrationPlan, type SqlMigrationPlanContractInfo, type SqlMigrationPlanOperation, type SqlMigrationPlanOperationStep, type SqlMigrationPlanOperationTarget, type SqlMigrationPlanner, type SqlMigrationPlannerPlanOptions, type SqlMigrationRunner, type SqlMigrationRunnerErrorCode, type SqlMigrationRunnerExecuteCallbacks, type SqlMigrationRunnerExecuteOptions, type SqlMigrationRunnerFailure, type SqlMigrationRunnerResult, type SqlMigrationRunnerSuccessValue, type SqlPlanTargetDetails, type SqlPlannerConflict, type SqlPlannerConflictKind, type SqlPlannerConflictLocation, type SqlPlannerFailureResult, type SqlPlannerResult, type SqlPlannerSuccessResult, type StorageTypePlanResult, type TargetMigrationsCapability, assembleAuthoringContributions, collectInitDependencies, contractToSchemaIR, createMigrationPlan, _default as default, detectDestructiveChanges, extractCodecControlHooks, isDatabaseDependencyProvider, plannerFailure, plannerSuccess, runnerFailure, runnerSuccess };
|
|
404
|
+
export { type CodecControlHooks, type ComponentDatabaseDependencies, type ComponentDatabaseDependency, type ContractToSchemaIROptions, type CreateSqlMigrationPlanOptions, type DefaultRenderer, type ExpandNativeTypeInput, INIT_ADDITIVE_POLICY, type MigrationOperationClass, type MigrationOperationPolicy, type MigrationPlan, type MigrationPlanOperation, type MigrationPlanner, type MigrationPlannerConflict, type MigrationPlannerResult, type NativeTypeExpander, type ResolveIdentityValueInput, type SchemaVerifyOptions, type SqlControlAdapterDescriptor, type SqlControlExtensionDescriptor, type SqlControlFamilyInstance, type SqlControlTargetDescriptor, type SqlMigrationPlan, type SqlMigrationPlanContractInfo, type SqlMigrationPlanOperation, type SqlMigrationPlanOperationStep, type SqlMigrationPlanOperationTarget, type SqlMigrationPlanner, type SqlMigrationPlannerPlanOptions, type SqlMigrationRunner, type SqlMigrationRunnerErrorCode, type SqlMigrationRunnerExecuteCallbacks, type SqlMigrationRunnerExecuteOptions, type SqlMigrationRunnerFailure, type SqlMigrationRunnerResult, type SqlMigrationRunnerSuccessValue, type SqlPlanTargetDetails, type SqlPlannerConflict, type SqlPlannerConflictKind, type SqlPlannerConflictLocation, type SqlPlannerFailureResult, type SqlPlannerResult, type SqlPlannerSuccessResult, type StorageTypePlanResult, type TargetMigrationsCapability, assembleAuthoringContributions, collectInitDependencies, contractToSchemaIR, createMigrationPlan, _default as default, detectDestructiveChanges, extractCodecControlHooks, isDatabaseDependencyProvider, plannerFailure, plannerSuccess, runnerFailure, runnerSuccess, temporalAuthoringPresets, timestampNowControlDescriptor };
|
|
336
405
|
//# sourceMappingURL=control.d.mts.map
|
package/dist/control.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control.d.mts","names":[],"sources":["../src/core/control-descriptor.ts","../src/core/assembly.ts","../src/core/migrations/contract-to-schema-ir.ts","../src/core/migrations/plan-helpers.ts","../src/core/migrations/policies.ts","../src/exports/control.ts"],"sourcesContent":[],"mapp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ACM,SAAA,KAAA,EAAA,CAAA;cAA9B,SAAA,IAAA,EAAA,SAAA,CAAA,MAAA,CAAA;cACS,SAAA,OAAA,EAAA,EAAA;YAAjB,CAAA;UAAgB,CAAA;QAaH,CAAA;MACS,CAAA;MAAjB,SAAA,KAAA,EAAA;QACmB,SAAA,IAAA,EAAA,aAAA;QAAxB,SAAA,MAAA,EAAA;UAAuB,SAAA,OAAA,EAAA,YAAA;UAOV,SAAc,UAAqB,EAAA,WAAA;UAoBtB,SAAA,UAGtB,EAAA;YAYsB,SAAA,MAAA,EAAA,EAAA;UACrB,CAAA;QAE2B,CAAA;MAC1B,CAAA;MAAN,SAAA,KAAA,EAAA;QAAK,SAAA,IAAA,EAAA,aAAA;;;;UCzJK,SAEX,UAFiC,EAAA;;;;
|
|
1
|
+
{"version":3,"file":"control.d.mts","names":[],"sources":["../src/core/control-descriptor.ts","../src/core/assembly.ts","../src/core/migrations/contract-to-schema-ir.ts","../src/core/migrations/plan-helpers.ts","../src/core/migrations/policies.ts","../src/core/timestamp-now-generator.ts","../src/exports/control.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;cASa,mBAAA,YACA,+BAA+B;;;;;;;uCAAwB,4BAAA,CAAA;;IADvD,SAAA,mBACX,EAAA,CAAA,QAAA,uCAAA,EAAA,mBAAA,EAAA,MAAA,EAAA,GAAA,MAAA;IAA0C,SAAA,wBAAA,EAAA,CAAA,UAAA,EAAA,MAAA,EAAA,KAAA,4CAAA,EAAA,GAAA,MAAA;IAAwB,SAAA,sBAAA,EAAA,CAAA,UAAA,EAAA,MAAA,EAAA,SAAA,EAAA,MAAA,EAAA,KAAA,4CAAA,EAAA,QAAA,uCAAA,EAAA,SAAA,CAAA,MAAA,EAAA,OAAA,CAAA,GAAA,SAAA;;0FAY5C;;;;;;;QACO,SAAA,IAAA,EAAA,aAAA;QAApB,SAAA,MAAA,EAAA;UACN,SAAA,OAAA,EAAA,YAAA;UAdQ,SAAA,UAAA,EAAA,WAAA;UAAuB,S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,6BAAA,CAAA,CLHX,EKG4C,kCLH5C;;;;;;ACFL;;;;;AAEM,iBIuBU,wBJvBV,CAAA,sBAAA,MAAA,EAAA,yBAAA,MAAA,CAAA,CAAA,KAAA,EAAA;oBI0BuB;uBAA8B;;EHd/C,SAAA,SAAA,EAAA;IAeA,SAAA,IAAA,EAAe,aAAS;IAuIpB,SAAA,MAAA,EAAA;MACR,SAAA,OAAA,SAAA;MACF,SAAA,UAAA,YAAA;MACM,SAAA,OAAA,EAAA;QAAwB,SAAA,IAAA,EAAA,UAAA;QAiCnB,SAAA,UAAyB,EAAA,OAAA;MAEZ,CAAA;IACH,CAAA;EACoB,CAAA;EAAd,SAAA,SAAA,EAAA;IAAa,SAAA,IAAA,EAAA,aAAA;IAkB9B,SAAA,MAAA,EAAkB;MACb,SAAA,OAAA,SAAA;MAAT,SAAA,UAAA,YAAA;MACD,SAAA,iBAAA,EAAA;QACR,SAAA,QAAA,EAAA;UAAW,SAAA,IAAA,EAAA,WAAA;;;;UCxJE,SAAmB,IAAA,EAAA,WAAA;UACM,SAAA,EAAA,EAAA,cAAA;QAA9B,CAAA;MACS,CAAA;IAAjB,CAAA;EAAgB,CAAA;AAanB,CAAA;;;cGvCyC,QN7DG,EM6DH,mBN7DG"}
|
package/dist/control.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { n as sqlFamilyAuthoringFieldPresets, t as sqlFamilyAuthoringTypes } from "./authoring-type-constructors-
|
|
1
|
+
import { n as sqlFamilyAuthoringFieldPresets, t as sqlFamilyAuthoringTypes } from "./authoring-type-constructors-D9b8AG6y.mjs";
|
|
2
2
|
import { c as extractCodecControlHooks, o as collectInitDependencies, s as isDatabaseDependencyProvider, t as verifySqlSchema } from "./verify-sql-schema-Ovz7RXR5.mjs";
|
|
3
3
|
import { t as collectSupportedCodecTypeIds } from "./verify-BdES8wgQ.mjs";
|
|
4
|
+
import { n as temporalAuthoringPresets, r as timestampNowControlDescriptor } from "./timestamp-now-generator-Bt4L3cfM.mjs";
|
|
4
5
|
import { sqlEmission } from "@prisma-next/sql-contract-emitter";
|
|
5
6
|
import { emptyCodecLookup } from "@prisma-next/framework-components/codec";
|
|
6
7
|
import { SchemaTreeNode, VERIFY_CODE_HASH_MISMATCH, VERIFY_CODE_MARKER_MISSING, VERIFY_CODE_TARGET_MISMATCH, assembleAuthoringContributions } from "@prisma-next/framework-components/control";
|
|
@@ -1667,5 +1668,5 @@ const INIT_ADDITIVE_POLICY = Object.freeze({ allowedOperationClasses: Object.fre
|
|
|
1667
1668
|
var control_default = new SqlFamilyDescriptor();
|
|
1668
1669
|
|
|
1669
1670
|
//#endregion
|
|
1670
|
-
export { INIT_ADDITIVE_POLICY, assembleAuthoringContributions, collectInitDependencies, contractToSchemaIR, createMigrationPlan, control_default as default, detectDestructiveChanges, extractCodecControlHooks, isDatabaseDependencyProvider, plannerFailure, plannerSuccess, runnerFailure, runnerSuccess };
|
|
1671
|
+
export { INIT_ADDITIVE_POLICY, assembleAuthoringContributions, collectInitDependencies, contractToSchemaIR, createMigrationPlan, control_default as default, detectDestructiveChanges, extractCodecControlHooks, isDatabaseDependencyProvider, plannerFailure, plannerSuccess, runnerFailure, runnerSuccess, temporalAuthoringPresets, timestampNowControlDescriptor };
|
|
1671
1672
|
//# sourceMappingURL=control.mjs.map
|