@prisma-next/family-sql 0.4.0-dev.7 → 0.4.0-dev.9

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.
@@ -1,4 +1,19 @@
1
1
  //#region src/core/authoring-field-presets.ts
2
+ /**
3
+ * Family-level SQL authoring field presets.
4
+ *
5
+ * Only presets whose codec IDs align with the ID generator metadata live here
6
+ * (see `@prisma-next/ids`). These presets are target-agnostic because the
7
+ * generator metadata fixes their codec/native-type to `sql/char@1`
8
+ * (`character`) regardless of target, and the PSL interpreter lets the
9
+ * generator override the scalar descriptor.
10
+ *
11
+ * Scalar presets that map to target-specific codecs (e.g. `text`, `int`,
12
+ * `boolean`, `dateTime`) are contributed by the target pack (see
13
+ * `postgresAuthoringFieldPresets` in `@prisma-next/target-postgres`) so the
14
+ * TS callback surface and the PSL scalar surface lower to byte-identical
15
+ * contracts for the active target.
16
+ */
2
17
  const CHARACTER_CODEC_ID = "sql/char@1";
3
18
  const CHARACTER_NATIVE_TYPE = "character";
4
19
  const nanoidOptionsArgument = {
@@ -13,31 +28,6 @@ const nanoidOptionsArgument = {
13
28
  } }
14
29
  };
15
30
  const sqlFamilyAuthoringFieldPresets = {
16
- text: {
17
- kind: "fieldPreset",
18
- output: {
19
- codecId: "sql/text@1",
20
- nativeType: "text"
21
- }
22
- },
23
- timestamp: {
24
- kind: "fieldPreset",
25
- output: {
26
- codecId: "sql/timestamp@1",
27
- nativeType: "timestamp"
28
- }
29
- },
30
- createdAt: {
31
- kind: "fieldPreset",
32
- output: {
33
- codecId: "sql/timestamp@1",
34
- nativeType: "timestamp",
35
- default: {
36
- kind: "function",
37
- expression: "CURRENT_TIMESTAMP"
38
- }
39
- }
40
- },
41
31
  uuid: {
42
32
  kind: "fieldPreset",
43
33
  output: {
@@ -200,4 +190,4 @@ const sqlFamilyAuthoringTypes = { sql: { String: {
200
190
 
201
191
  //#endregion
202
192
  export { sqlFamilyAuthoringFieldPresets as n, sqlFamilyAuthoringTypes as t };
203
- //# sourceMappingURL=authoring-type-constructors-DgU-RFaP.mjs.map
193
+ //# sourceMappingURL=authoring-type-constructors-BAR65pSK.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authoring-type-constructors-BAR65pSK.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 executionDefault: {\n kind: 'generator',\n id: 'uuidv4',\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 executionDefault: {\n kind: 'generator',\n id: 'uuidv7',\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 executionDefault: {\n kind: 'generator',\n id: 'ulid',\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 executionDefault: {\n kind: 'generator',\n id: 'nanoid',\n params: {\n size: {\n kind: 'arg',\n index: 0,\n path: ['size'],\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 executionDefault: {\n kind: 'generator',\n id: 'cuid2',\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 executionDefault: {\n kind: 'generator',\n id: 'ksuid',\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,QA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EACZ,YAAY,EACV,QAAQ;GAAE,MAAM;GAAO,OAAO;GAAG,EAClC;EACF;CACF,EACF,EACF"}
@@ -27,31 +27,6 @@ declare class SqlFamilyDescriptor implements ControlFamilyDescriptor<'sql', SqlC
27
27
  };
28
28
  readonly authoring: {
29
29
  readonly field: {
30
- readonly text: {
31
- readonly kind: "fieldPreset";
32
- readonly output: {
33
- readonly codecId: "sql/text@1";
34
- readonly nativeType: "text";
35
- };
36
- };
37
- readonly timestamp: {
38
- readonly kind: "fieldPreset";
39
- readonly output: {
40
- readonly codecId: "sql/timestamp@1";
41
- readonly nativeType: "timestamp";
42
- };
43
- };
44
- readonly createdAt: {
45
- readonly kind: "fieldPreset";
46
- readonly output: {
47
- readonly codecId: "sql/timestamp@1";
48
- readonly nativeType: "timestamp";
49
- readonly default: {
50
- readonly kind: "function";
51
- readonly expression: "CURRENT_TIMESTAMP";
52
- };
53
- };
54
- };
55
30
  readonly uuid: {
56
31
  readonly kind: "fieldPreset";
57
32
  readonly output: {
@@ -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":[],"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,gBAAA,EAAA,GAAA,GAAA,MAAA,EAAA;0FAMhD;;;;;IAOW,SAAA,KAAA,EAAA;MAApB,SAAA,IAAA,EAAA;QACN,SAAA,IAAA,EAAA,aAAA;QAdQ,SAAA,MAAA,EAAA;UAAuB,SAAA,O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,sBAAsB;;;AJInC,cKyDiG,QLzDpF,EKyDoF,mBLxD/F"}
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":[],"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,gBAAA,EAAA,GAAA,GAAA,MAAA,EAAA;0FAMhD;;;;;IAOW,SAAA,KAAA,EAAA;MAApB,SAAA,IAAA,EAAA;QACN,SAAA,IAAA,EAAA,aAAA;QAdQ,SAAA,MAAA,EAAA;UAAuB,SAAA,OAAA,EAAA,YAAA;;;;UCYpB,CAAA;QACa,CAAA;MAAd,CAAA;MACA,SAAA,IAAA,EAAA;QAAZ,SAAA,IAAA,EAAA,aAAA;QAAG,SAAA,MAAA,EAAA;;;;YCWM,SAAkB,MAGN,EAAA,EAAA;UAYZ,CAAA;QAkGI,CAAA;MACR,CAAA;MACF,SAAA,MAAA,EAAA;QACM,SAAA,IAAA,EAAA,aAAA;QAAwB,SAAA,IAAA,EAAA,SAAA,CAAA;UAiCnB,SAAA,IAAyB,EAAA,QAAA;UAEZ,SAAA,QAAA,EAAA,IAAA;UACH,SAAA,UAAA,EAAA;YACoB,SAAA,IAAA,EAAA;cAAd,SAAA,IAAA,EAAA,QAAA;cAAa,SAAA,QAAA,EAAA,IAAA;cAkBZ,SAAA,OAAA,EAAA,IAAA;cACb,SAAA,OAAA,EAAA,CAAA;cAAT,SAAA,OAAA,EAAA,GAAA;YACD,CAAA;UACR,CAAA;QA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B,SAAA,aAAA,CAAA,EAGU,eAHe;EAEZ,SAAA,mBAAA,CAAA,EAEG,aAFH,CAEiB,8BAFjB,CAAA,KAAA,EAAA,MAAA,CAAA,CAAA;;;;;AAoB9B;;;;;;;;;ACjHA;;;AAEoB,iBD+GJ,kBAAA,CC/GI,QAAA,EDgHR,QChHQ,CDgHC,UChHD,CAAA,GAAA,IAAA,EAAA,OAAA,EDiHT,yBCjHS,CAAA,EDkHjB,WClHiB;;;iBAFJ,6CACL,8BAA8B,kBACtC,iBAAiB;iBAYJ,qCACR,iBAAiB,kBACtB,wBAAwB;iBAOX,cAAA,qBAAmC,uBAAuB;;;;iBAoB1D,aAAA;;;AH/HhB,CAAA,CAAA,EGkII,EHlIS,CGkIN,8BHjIL,CAAA;;;;iBG6Ic,aAAA,OACR;;SAE2B;IAChC,MAAM;;;;;;cCtJI,sBAAsB;;;AJInC,cKyDiG,QLzDpF,EKyDoF,mBLxD/F"}
package/dist/control.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { n as sqlFamilyAuthoringFieldPresets, t as sqlFamilyAuthoringTypes } from "./authoring-type-constructors-DgU-RFaP.mjs";
1
+ import { n as sqlFamilyAuthoringFieldPresets, t as sqlFamilyAuthoringTypes } from "./authoring-type-constructors-BAR65pSK.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 { r as readMarker, t as collectSupportedCodecTypeIds } from "./verify-DZHtfcmj.mjs";
4
4
  import { sqlEmission } from "@prisma-next/sql-contract-emitter";
package/dist/pack.d.mts CHANGED
@@ -6,31 +6,6 @@ declare const sqlFamilyPack: {
6
6
  readonly version: "0.0.1";
7
7
  readonly authoring: {
8
8
  readonly field: {
9
- readonly text: {
10
- readonly kind: "fieldPreset";
11
- readonly output: {
12
- readonly codecId: "sql/text@1";
13
- readonly nativeType: "text";
14
- };
15
- };
16
- readonly timestamp: {
17
- readonly kind: "fieldPreset";
18
- readonly output: {
19
- readonly codecId: "sql/timestamp@1";
20
- readonly nativeType: "timestamp";
21
- };
22
- };
23
- readonly createdAt: {
24
- readonly kind: "fieldPreset";
25
- readonly output: {
26
- readonly codecId: "sql/timestamp@1";
27
- readonly nativeType: "timestamp";
28
- readonly default: {
29
- readonly kind: "function";
30
- readonly expression: "CURRENT_TIMESTAMP";
31
- };
32
- };
33
- };
34
9
  readonly uuid: {
35
10
  readonly kind: "fieldPreset";
36
11
  readonly output: {
package/dist/pack.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { n as sqlFamilyAuthoringFieldPresets, t as sqlFamilyAuthoringTypes } from "./authoring-type-constructors-DgU-RFaP.mjs";
1
+ import { n as sqlFamilyAuthoringFieldPresets, t as sqlFamilyAuthoringTypes } from "./authoring-type-constructors-BAR65pSK.mjs";
2
2
 
3
3
  //#region src/exports/pack.ts
4
4
  const sqlFamilyPack = {
package/package.json CHANGED
@@ -1,35 +1,35 @@
1
1
  {
2
2
  "name": "@prisma-next/family-sql",
3
- "version": "0.4.0-dev.7",
3
+ "version": "0.4.0-dev.9",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "description": "SQL family descriptor for Prisma Next",
7
7
  "dependencies": {
8
8
  "arktype": "^2.0.0",
9
- "@prisma-next/contract": "0.4.0-dev.7",
10
- "@prisma-next/emitter": "0.4.0-dev.7",
11
- "@prisma-next/framework-components": "0.4.0-dev.7",
12
- "@prisma-next/operations": "0.4.0-dev.7",
13
- "@prisma-next/runtime-executor": "0.4.0-dev.7",
14
- "@prisma-next/sql-contract-ts": "0.4.0-dev.7",
15
- "@prisma-next/sql-contract": "0.4.0-dev.7",
16
- "@prisma-next/sql-contract-emitter": "0.4.0-dev.7",
17
- "@prisma-next/sql-operations": "0.4.0-dev.7",
18
- "@prisma-next/sql-relational-core": "0.4.0-dev.7",
19
- "@prisma-next/sql-schema-ir": "0.4.0-dev.7",
20
- "@prisma-next/sql-runtime": "0.4.0-dev.7",
21
- "@prisma-next/utils": "0.4.0-dev.7"
9
+ "@prisma-next/emitter": "0.4.0-dev.9",
10
+ "@prisma-next/framework-components": "0.4.0-dev.9",
11
+ "@prisma-next/contract": "0.4.0-dev.9",
12
+ "@prisma-next/operations": "0.4.0-dev.9",
13
+ "@prisma-next/runtime-executor": "0.4.0-dev.9",
14
+ "@prisma-next/sql-contract": "0.4.0-dev.9",
15
+ "@prisma-next/sql-contract-ts": "0.4.0-dev.9",
16
+ "@prisma-next/sql-contract-emitter": "0.4.0-dev.9",
17
+ "@prisma-next/sql-relational-core": "0.4.0-dev.9",
18
+ "@prisma-next/sql-runtime": "0.4.0-dev.9",
19
+ "@prisma-next/sql-schema-ir": "0.4.0-dev.9",
20
+ "@prisma-next/utils": "0.4.0-dev.9",
21
+ "@prisma-next/sql-operations": "0.4.0-dev.9"
22
22
  },
23
23
  "devDependencies": {
24
24
  "tsdown": "0.18.4",
25
25
  "typescript": "5.9.3",
26
26
  "vitest": "4.0.17",
27
- "@prisma-next/driver-postgres": "0.4.0-dev.7",
28
- "@prisma-next/psl-parser": "0.4.0-dev.7",
29
- "@prisma-next/sql-contract-psl": "0.4.0-dev.7",
30
- "@prisma-next/tsdown": "0.0.0",
27
+ "@prisma-next/driver-postgres": "0.4.0-dev.9",
28
+ "@prisma-next/psl-parser": "0.4.0-dev.9",
29
+ "@prisma-next/sql-contract-psl": "0.4.0-dev.9",
31
30
  "@prisma-next/test-utils": "0.0.1",
32
- "@prisma-next/tsconfig": "0.0.0"
31
+ "@prisma-next/tsconfig": "0.0.0",
32
+ "@prisma-next/tsdown": "0.0.0"
33
33
  },
34
34
  "files": [
35
35
  "dist",
@@ -1,5 +1,21 @@
1
1
  import type { AuthoringFieldNamespace } from '@prisma-next/framework-components/authoring';
2
2
 
3
+ /**
4
+ * Family-level SQL authoring field presets.
5
+ *
6
+ * Only presets whose codec IDs align with the ID generator metadata live here
7
+ * (see `@prisma-next/ids`). These presets are target-agnostic because the
8
+ * generator metadata fixes their codec/native-type to `sql/char@1`
9
+ * (`character`) regardless of target, and the PSL interpreter lets the
10
+ * generator override the scalar descriptor.
11
+ *
12
+ * Scalar presets that map to target-specific codecs (e.g. `text`, `int`,
13
+ * `boolean`, `dateTime`) are contributed by the target pack (see
14
+ * `postgresAuthoringFieldPresets` in `@prisma-next/target-postgres`) so the
15
+ * TS callback surface and the PSL scalar surface lower to byte-identical
16
+ * contracts for the active target.
17
+ */
18
+
3
19
  const CHARACTER_CODEC_ID = 'sql/char@1';
4
20
  const CHARACTER_NATIVE_TYPE = 'character';
5
21
 
@@ -18,31 +34,6 @@ const nanoidOptionsArgument = {
18
34
  } as const;
19
35
 
20
36
  export const sqlFamilyAuthoringFieldPresets = {
21
- text: {
22
- kind: 'fieldPreset',
23
- output: {
24
- codecId: 'sql/text@1',
25
- nativeType: 'text',
26
- },
27
- },
28
- timestamp: {
29
- kind: 'fieldPreset',
30
- output: {
31
- codecId: 'sql/timestamp@1',
32
- nativeType: 'timestamp',
33
- },
34
- },
35
- createdAt: {
36
- kind: 'fieldPreset',
37
- output: {
38
- codecId: 'sql/timestamp@1',
39
- nativeType: 'timestamp',
40
- default: {
41
- kind: 'function',
42
- expression: 'CURRENT_TIMESTAMP',
43
- },
44
- },
45
- },
46
37
  uuid: {
47
38
  kind: 'fieldPreset',
48
39
  output: {
@@ -1 +0,0 @@
1
- {"version":3,"file":"authoring-type-constructors-DgU-RFaP.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\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 text: {\n kind: 'fieldPreset',\n output: {\n codecId: 'sql/text@1',\n nativeType: 'text',\n },\n },\n timestamp: {\n kind: 'fieldPreset',\n output: {\n codecId: 'sql/timestamp@1',\n nativeType: 'timestamp',\n },\n },\n createdAt: {\n kind: 'fieldPreset',\n output: {\n codecId: 'sql/timestamp@1',\n nativeType: 'timestamp',\n default: {\n kind: 'function',\n expression: 'CURRENT_TIMESTAMP',\n },\n },\n },\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 executionDefault: {\n kind: 'generator',\n id: 'uuidv4',\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 executionDefault: {\n kind: 'generator',\n id: 'uuidv7',\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 executionDefault: {\n kind: 'generator',\n id: 'ulid',\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 executionDefault: {\n kind: 'generator',\n id: 'nanoid',\n params: {\n size: {\n kind: 'arg',\n index: 0,\n path: ['size'],\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 executionDefault: {\n kind: 'generator',\n id: 'cuid2',\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 executionDefault: {\n kind: 'generator',\n id: 'ksuid',\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":";AAEA,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,SA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