@prisma/orm-target-postgres 8.0.0-rc.11-dev.26 → 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.
Files changed (40) hide show
  1. package/dist/adapter__control.mjs +28 -1
  2. package/dist/adapter__control.mjs.map +1 -1
  3. package/dist/adapter__runtime.mjs +1 -1
  4. package/dist/{authoring-C3hGtD3B-DPpnMHfT.mjs → authoring-DhCDnK1T-CGirVrrH.mjs} +17 -4
  5. package/dist/authoring-DhCDnK1T-CGirVrrH.mjs.map +1 -0
  6. package/dist/{control-BQHKNZ5z.mjs → control-DDfLaDsG.mjs} +4 -4
  7. package/dist/{control-BQHKNZ5z.mjs.map → control-DDfLaDsG.mjs.map} +1 -1
  8. package/dist/{descriptor-meta-CQBdvIPG-CN3m2xcT.mjs → descriptor-meta-CQMRNeLX-CF4MvmN_.mjs} +3 -3
  9. package/dist/{descriptor-meta-CQBdvIPG-CN3m2xcT.mjs.map → descriptor-meta-CQMRNeLX-CF4MvmN_.mjs.map} +1 -1
  10. package/dist/migration-PTHAY9Cv.mjs.map +1 -1
  11. package/dist/{pack-CRA_2QjF.d.mts → pack-5TvJBjeX.d.mts} +47 -10
  12. package/dist/pack-5TvJBjeX.d.mts.map +1 -0
  13. package/dist/{planner-CeYeEGDy-UmNDGNc2.mjs → planner-C_TrM6kn-Dj1rgql2.mjs} +3 -3
  14. package/dist/{planner-CeYeEGDy-UmNDGNc2.mjs.map → planner-C_TrM6kn-Dj1rgql2.mjs.map} +1 -1
  15. package/dist/{planner-produced-postgres-migration-CjuBrC8Z-Cv4wCASG.mjs → planner-produced-postgres-migration-CNmh50cN-qepqYtvL.mjs} +3 -3
  16. package/dist/{planner-produced-postgres-migration-CjuBrC8Z-Cv4wCASG.mjs.map → planner-produced-postgres-migration-CNmh50cN-qepqYtvL.mjs.map} +1 -1
  17. package/dist/{postgres-contract-view-CmLEo6wf-DYBBFFMK.mjs → postgres-contract-view-BPe8r8jN-DrorQoWW.mjs} +3 -3
  18. package/dist/{postgres-contract-view-CmLEo6wf-DYBBFFMK.mjs.map → postgres-contract-view-BPe8r8jN-DrorQoWW.mjs.map} +1 -1
  19. package/dist/{postgres-migration-Bw29VY-O-Bglowo1Y.mjs → postgres-migration-CydbiBd3-BRXOU7KP.mjs} +3 -3
  20. package/dist/{postgres-migration-Bw29VY-O-Bglowo1Y.mjs.map → postgres-migration-CydbiBd3-BRXOU7KP.mjs.map} +1 -1
  21. package/dist/{prisma7-binding-C38o_ABR.d.mts → prisma7-binding-BlGmTeNp.d.mts} +47 -10
  22. package/dist/prisma7-binding-BlGmTeNp.d.mts.map +1 -0
  23. package/dist/{prisma7-binding-BoFnbd5w.mjs → prisma7-binding-Db1xpliZ.mjs} +3 -3
  24. package/dist/{prisma7-binding-BoFnbd5w.mjs.map → prisma7-binding-Db1xpliZ.mjs.map} +1 -1
  25. package/dist/target.d.mts +2 -2
  26. package/dist/target.mjs +7 -7
  27. package/dist/target__control.mjs +2 -2
  28. package/dist/target__migration.mjs +1 -1
  29. package/dist/target__pack.d.mts +1 -1
  30. package/dist/target__pack.mjs +1 -1
  31. package/dist/target__planner-produced-postgres-migration.mjs +1 -1
  32. package/dist/target__planner.mjs +1 -1
  33. package/dist/target__prisma7-binding.d.mts +1 -1
  34. package/dist/target__prisma7-binding.mjs +1 -1
  35. package/dist/target__runtime.mjs +2 -2
  36. package/dist/target__runtime.mjs.map +1 -1
  37. package/package.json +9 -9
  38. package/dist/authoring-C3hGtD3B-DPpnMHfT.mjs.map +0 -1
  39. package/dist/pack-CRA_2QjF.d.mts.map +0 -1
  40. package/dist/prisma7-binding-C38o_ABR.d.mts.map +0 -1
@@ -1,7 +1,7 @@
1
1
  import { C as PG_TIMESTAMPTZ_DATE_CODEC_ID } from "./codec-ids-BYhNGq22-B6yIezG2.mjs";
2
2
  import { n as qualifyName, r as quoteIdentifier, t as escapeLiteral } from "./sql-utils-6j9YTLpr-BCyCBPBg.mjs";
3
3
  import { t as parsePostgresDefault } from "./default-normalizer-Bjtm2F4f-uV5vvkVt.mjs";
4
- import { i as instantNowControlDescriptor, o as plainDateTimeNowControlDescriptor } from "./authoring-C3hGtD3B-DPpnMHfT.mjs";
4
+ import { i as instantNowControlDescriptor, o as plainDateTimeNowControlDescriptor } from "./authoring-DhCDnK1T-CGirVrrH.mjs";
5
5
  import { t as normalizeSchemaNativeType } from "./native-type-normalizer-yvd3tqv-.mjs";
6
6
  import { i as createPostgresCodecRegistryWithBuiltins, n as assemblePostgresCodecRegistry, r as createPostgresBuiltinCodecLookup, t as PostgresControlAdapter } from "./control-adapter-Bdz-Xa1p-rKiOVhsh.mjs";
7
7
  import { t as postgresAdapterDescriptorMeta } from "./descriptor-meta-TrRobK4g-CQJJoHqf.mjs";
@@ -178,6 +178,7 @@ const postgresDefaultFunctionRegistryEntries = [
178
178
  const postgresScalarAuthoringTypes = {
179
179
  String: {
180
180
  kind: "typeConstructor",
181
+ documentation: "Variable-length text stored as PostgreSQL text.",
181
182
  output: {
182
183
  codecId: "pg/text@1",
183
184
  nativeType: "text"
@@ -185,6 +186,7 @@ const postgresScalarAuthoringTypes = {
185
186
  },
186
187
  Boolean: {
187
188
  kind: "typeConstructor",
189
+ documentation: "A true or false value stored as PostgreSQL boolean.",
188
190
  output: {
189
191
  codecId: "pg/bool@1",
190
192
  nativeType: "bool"
@@ -192,6 +194,7 @@ const postgresScalarAuthoringTypes = {
192
194
  },
193
195
  Int: {
194
196
  kind: "typeConstructor",
197
+ documentation: "A signed 32-bit integer represented as a JavaScript number.",
195
198
  output: {
196
199
  codecId: "pg/int4@1",
197
200
  nativeType: "int4"
@@ -199,6 +202,7 @@ const postgresScalarAuthoringTypes = {
199
202
  },
200
203
  BigInt: {
201
204
  kind: "typeConstructor",
205
+ documentation: "A signed 64-bit integer represented as a JavaScript bigint.",
202
206
  output: {
203
207
  codecId: "pg/int8@1",
204
208
  nativeType: "int8"
@@ -206,6 +210,7 @@ const postgresScalarAuthoringTypes = {
206
210
  },
207
211
  Float: {
208
212
  kind: "typeConstructor",
213
+ documentation: "A double-precision floating-point number.",
209
214
  output: {
210
215
  codecId: "pg/float8@1",
211
216
  nativeType: "float8"
@@ -213,6 +218,7 @@ const postgresScalarAuthoringTypes = {
213
218
  },
214
219
  Decimal: {
215
220
  kind: "typeConstructor",
221
+ documentation: "An exact decimal value stored as PostgreSQL numeric.",
216
222
  output: {
217
223
  codecId: "pg/numeric@1",
218
224
  nativeType: "numeric"
@@ -220,6 +226,7 @@ const postgresScalarAuthoringTypes = {
220
226
  },
221
227
  DateTime: {
222
228
  kind: "typeConstructor",
229
+ documentation: "An instant stored as PostgreSQL timestamptz and represented as Temporal.Instant.",
223
230
  output: {
224
231
  codecId: "pg/timestamptz-temporal@1",
225
232
  nativeType: "timestamptz"
@@ -227,6 +234,7 @@ const postgresScalarAuthoringTypes = {
227
234
  },
228
235
  Json: {
229
236
  kind: "typeConstructor",
237
+ documentation: "A JSON value stored as PostgreSQL json.",
230
238
  output: {
231
239
  codecId: "pg/json@1",
232
240
  nativeType: "json"
@@ -234,6 +242,7 @@ const postgresScalarAuthoringTypes = {
234
242
  },
235
243
  Jsonb: {
236
244
  kind: "typeConstructor",
245
+ documentation: "A JSON value stored in PostgreSQL binary jsonb format.",
237
246
  output: {
238
247
  codecId: "pg/jsonb@1",
239
248
  nativeType: "jsonb"
@@ -241,6 +250,7 @@ const postgresScalarAuthoringTypes = {
241
250
  },
242
251
  Bytes: {
243
252
  kind: "typeConstructor",
253
+ documentation: "Binary data stored as PostgreSQL bytea.",
244
254
  output: {
245
255
  codecId: "pg/bytea@1",
246
256
  nativeType: "bytea"
@@ -250,6 +260,7 @@ const postgresScalarAuthoringTypes = {
250
260
  const postgresNativeAuthoringTypes = {
251
261
  VarChar: {
252
262
  kind: "typeConstructor",
263
+ documentation: "Variable-length text with an optional maximum character length.",
253
264
  args: [{
254
265
  kind: "number",
255
266
  name: "length",
@@ -268,6 +279,7 @@ const postgresNativeAuthoringTypes = {
268
279
  },
269
280
  Char: {
270
281
  kind: "typeConstructor",
282
+ documentation: "Fixed-length, blank-padded text with an optional character length.",
271
283
  args: [{
272
284
  kind: "number",
273
285
  name: "length",
@@ -286,6 +298,7 @@ const postgresNativeAuthoringTypes = {
286
298
  },
287
299
  Numeric: {
288
300
  kind: "typeConstructor",
301
+ documentation: "An exact decimal value with optional precision and scale.",
289
302
  args: [{
290
303
  kind: "number",
291
304
  name: "precision",
@@ -316,6 +329,7 @@ const postgresNativeAuthoringTypes = {
316
329
  },
317
330
  Timestamp: {
318
331
  kind: "typeConstructor",
332
+ documentation: "A date and time without a time zone, represented as Temporal.PlainDateTime.",
319
333
  args: [{
320
334
  kind: "number",
321
335
  name: "precision",
@@ -334,6 +348,7 @@ const postgresNativeAuthoringTypes = {
334
348
  },
335
349
  Timestamptz: {
336
350
  kind: "typeConstructor",
351
+ documentation: "An instant represented as Temporal.Instant, with optional fractional-second precision.",
337
352
  args: [{
338
353
  kind: "number",
339
354
  name: "precision",
@@ -352,6 +367,7 @@ const postgresNativeAuthoringTypes = {
352
367
  },
353
368
  Time: {
354
369
  kind: "typeConstructor",
370
+ documentation: "A time of day without a time zone, represented as Temporal.PlainTime.",
355
371
  args: [{
356
372
  kind: "number",
357
373
  name: "precision",
@@ -370,6 +386,7 @@ const postgresNativeAuthoringTypes = {
370
386
  },
371
387
  Timetz: {
372
388
  kind: "typeConstructor",
389
+ documentation: "A time of day with a UTC offset stored as PostgreSQL timetz.",
373
390
  args: [{
374
391
  kind: "number",
375
392
  name: "precision",
@@ -388,6 +405,7 @@ const postgresNativeAuthoringTypes = {
388
405
  },
389
406
  Uuid: {
390
407
  kind: "typeConstructor",
408
+ documentation: "A universally unique identifier stored as PostgreSQL uuid.",
391
409
  output: {
392
410
  codecId: "pg/uuid@1",
393
411
  nativeType: "uuid"
@@ -395,6 +413,7 @@ const postgresNativeAuthoringTypes = {
395
413
  },
396
414
  Inet: {
397
415
  kind: "typeConstructor",
416
+ documentation: "An IPv4 or IPv6 address with an optional subnet mask.",
398
417
  output: {
399
418
  codecId: "pg/inet@1",
400
419
  nativeType: "inet"
@@ -402,6 +421,7 @@ const postgresNativeAuthoringTypes = {
402
421
  },
403
422
  SmallInt: {
404
423
  kind: "typeConstructor",
424
+ documentation: "A signed 16-bit integer represented as a JavaScript number.",
405
425
  output: {
406
426
  codecId: "pg/int2@1",
407
427
  nativeType: "int2"
@@ -409,6 +429,7 @@ const postgresNativeAuthoringTypes = {
409
429
  },
410
430
  Real: {
411
431
  kind: "typeConstructor",
432
+ documentation: "A single-precision floating-point number.",
412
433
  output: {
413
434
  codecId: "pg/float4@1",
414
435
  nativeType: "float4"
@@ -416,6 +437,7 @@ const postgresNativeAuthoringTypes = {
416
437
  },
417
438
  Date: {
418
439
  kind: "typeConstructor",
440
+ documentation: "A calendar date represented as Temporal.PlainDate.",
419
441
  output: {
420
442
  codecId: "pg/date-temporal@1",
421
443
  nativeType: "date"
@@ -423,6 +445,7 @@ const postgresNativeAuthoringTypes = {
423
445
  },
424
446
  DateString: {
425
447
  kind: "typeConstructor",
448
+ documentation: "A PostgreSQL date represented as database text rather than Temporal.PlainDate.",
426
449
  output: {
427
450
  codecId: "pg/date-string@1",
428
451
  nativeType: "date"
@@ -430,6 +453,7 @@ const postgresNativeAuthoringTypes = {
430
453
  },
431
454
  TimestampString: {
432
455
  kind: "typeConstructor",
456
+ documentation: "A timestamp without a time zone represented as PostgreSQL text.",
433
457
  args: [{
434
458
  kind: "number",
435
459
  name: "precision",
@@ -448,6 +472,7 @@ const postgresNativeAuthoringTypes = {
448
472
  },
449
473
  TimestamptzJsDate: {
450
474
  kind: "typeConstructor",
475
+ documentation: "An instant stored as PostgreSQL timestamptz and represented as a JavaScript Date.",
451
476
  args: [{
452
477
  kind: "number",
453
478
  name: "precision",
@@ -466,6 +491,7 @@ const postgresNativeAuthoringTypes = {
466
491
  },
467
492
  TimestamptzString: {
468
493
  kind: "typeConstructor",
494
+ documentation: "A timestamp with time zone represented as PostgreSQL text.",
469
495
  args: [{
470
496
  kind: "number",
471
497
  name: "precision",
@@ -484,6 +510,7 @@ const postgresNativeAuthoringTypes = {
484
510
  },
485
511
  TimeString: {
486
512
  kind: "typeConstructor",
513
+ documentation: "A time of day without a time zone represented as PostgreSQL text.",
487
514
  args: [{
488
515
  kind: "number",
489
516
  name: "precision",
@@ -1 +1 @@
1
- {"version":3,"file":"adapter__control.mjs","names":[],"sources":["../../../../3-targets/6-adapters/postgres/dist/control.mjs"],"sourcesContent":["import { i as createPostgresCodecRegistryWithBuiltins, n as assemblePostgresCodecRegistry, r as createPostgresBuiltinCodecLookup, t as PostgresControlAdapter } from \"./control-adapter-Bdz-Xa1p.mjs\";\nimport { t as postgresAdapterDescriptorMeta } from \"./descriptor-meta-TrRobK4g.mjs\";\nimport { instantNowControlDescriptor, plainDateTimeNowControlDescriptor } from \"@internal/target-postgres/control\";\nimport { parsePostgresDefault } from \"@internal/target-postgres/default-normalizer\";\nimport { normalizeSchemaNativeType } from \"@internal/target-postgres/native-type-normalizer\";\nimport { escapeLiteral, qualifyName, quoteIdentifier } from \"@internal/target-postgres/sql-utils\";\nimport { PG_TIMESTAMPTZ_DATE_CODEC_ID } from \"@internal/target-postgres/codec-ids\";\nimport { timestampNowControlDescriptor } from \"@internal/family-sql/control\";\nimport { builtinGeneratorRegistryMetadata } from \"@internal/ids\";\nimport { int, num, oneOf, optional, str } from \"@internal/psl-parser\";\n//#region src/core/control-mutation-defaults.ts\nfunction invalidArgumentDiagnostic(input) {\n\treturn {\n\t\tok: false,\n\t\tdiagnostic: {\n\t\t\tcode: \"PSL_INVALID_DEFAULT_FUNCTION_ARGUMENT\",\n\t\t\tmessage: input.message,\n\t\t\tsourceId: input.context.sourceId,\n\t\t\tspan: input.span\n\t\t}\n\t};\n}\nfunction executionGenerator(id, params) {\n\treturn {\n\t\tok: true,\n\t\tvalue: {\n\t\t\tkind: \"execution\",\n\t\t\tgenerated: {\n\t\t\t\tkind: \"generator\",\n\t\t\t\tid,\n\t\t\t\t...params ? { params } : {}\n\t\t\t}\n\t\t}\n\t};\n}\nfunction lowerAutoincrement() {\n\treturn {\n\t\tok: true,\n\t\tvalue: {\n\t\t\tkind: \"storage\",\n\t\t\tdefaultValue: {\n\t\t\t\tkind: \"function\",\n\t\t\t\texpression: \"autoincrement()\"\n\t\t\t}\n\t\t}\n\t};\n}\nfunction lowerNow() {\n\treturn {\n\t\tok: true,\n\t\tvalue: {\n\t\t\tkind: \"storage\",\n\t\t\tdefaultValue: {\n\t\t\t\tkind: \"function\",\n\t\t\t\texpression: \"now()\"\n\t\t\t}\n\t\t}\n\t};\n}\nfunction lowerUlid() {\n\treturn executionGenerator(\"ulid\");\n}\nfunction lowerUuid(input) {\n\treturn input.call.args[\"version\"] === 7 ? executionGenerator(\"uuidv7\") : executionGenerator(\"uuidv4\");\n}\nfunction lowerCuid() {\n\treturn executionGenerator(\"cuid2\");\n}\nfunction lowerNanoid(input) {\n\tconst size = input.call.args[\"size\"];\n\treturn typeof size === \"number\" ? executionGenerator(\"nanoid\", { size }) : executionGenerator(\"nanoid\");\n}\nfunction lowerDbgenerated(input) {\n\tconst expression = input.call.args[\"expression\"];\n\tif (typeof expression !== \"string\" || expression.trim().length === 0) return invalidArgumentDiagnostic({\n\t\tcontext: input.context,\n\t\tspan: input.call.span,\n\t\tmessage: \"Default function \\\"dbgenerated\\\" argument cannot be empty.\"\n\t});\n\treturn {\n\t\tok: true,\n\t\tvalue: {\n\t\t\tkind: \"storage\",\n\t\t\tdefaultValue: {\n\t\t\t\tkind: \"function\",\n\t\t\t\texpression\n\t\t\t}\n\t\t}\n\t};\n}\nconst nowSig = { documentation: \"Uses the current database timestamp as the default value.\" };\nconst autoincrementSig = { documentation: \"Generates an increasing integer value in the database.\" };\nconst ulidSig = { documentation: \"Generates a ULID when a value is not supplied.\" };\nconst uuidSig = {\n\tdocumentation: \"Generates a UUID when a value is not supplied.\",\n\tpositional: [{\n\t\tkey: \"version\",\n\t\ttype: optional(oneOf(num(4), num(7))),\n\t\tdocumentation: \"The UUID version: `4` or `7`. Defaults to `4`.\"\n\t}]\n};\nconst cuidSig = {\n\tdocumentation: \"Generates a CUID2 identifier when a value is not supplied.\",\n\tpositional: [{\n\t\tkey: \"version\",\n\t\ttype: num(2),\n\t\tdocumentation: \"The CUID version. Only `2` is supported.\"\n\t}]\n};\nconst nanoidSig = {\n\tdocumentation: \"Generates a Nano ID when a value is not supplied.\",\n\tpositional: [{\n\t\tkey: \"size\",\n\t\ttype: optional(int({\n\t\t\tmin: 2,\n\t\t\tmax: 255\n\t\t})),\n\t\tdocumentation: \"The identifier length, from `2` through `255`. Omit to use the generator default.\"\n\t}]\n};\nconst dbgeneratedSig = {\n\tdocumentation: \"Uses a database SQL expression as the default value.\",\n\tpositional: [{\n\t\tkey: \"expression\",\n\t\ttype: str(),\n\t\tdocumentation: \"The nonempty SQL expression evaluated by the database.\"\n\t}]\n};\nconst postgresDefaultFunctionRegistryEntries = [\n\t[\"autoincrement\", {\n\t\tsignature: autoincrementSig,\n\t\tlower: lowerAutoincrement,\n\t\tusageSignatures: [\"autoincrement()\"]\n\t}],\n\t[\"now\", {\n\t\tsignature: nowSig,\n\t\tlower: lowerNow,\n\t\tusageSignatures: [\"now()\"]\n\t}],\n\t[\"uuid\", {\n\t\tsignature: uuidSig,\n\t\tlower: lowerUuid,\n\t\tusageSignatures: [\n\t\t\t\"uuid()\",\n\t\t\t\"uuid(4)\",\n\t\t\t\"uuid(7)\"\n\t\t]\n\t}],\n\t[\"cuid\", {\n\t\tsignature: cuidSig,\n\t\tlower: lowerCuid,\n\t\tusageSignatures: [\"cuid(2)\"]\n\t}],\n\t[\"ulid\", {\n\t\tsignature: ulidSig,\n\t\tlower: lowerUlid,\n\t\tusageSignatures: [\"ulid()\"]\n\t}],\n\t[\"nanoid\", {\n\t\tsignature: nanoidSig,\n\t\tlower: lowerNanoid,\n\t\tusageSignatures: [\"nanoid()\", \"nanoid(<2-255>)\"]\n\t}],\n\t[\"dbgenerated\", {\n\t\tsignature: dbgeneratedSig,\n\t\tlower: lowerDbgenerated,\n\t\tusageSignatures: [\"dbgenerated(\\\"...\\\")\"]\n\t}]\n];\n/**\n* The base PSL scalars as zero-arg type constructors in the unified authoring\n* channel, with explicit `nativeType` values pinned to the codec manifests\n* (`codecLookup.targetTypesFor(codecId)[0]`).\n*\n* The type position is the only storage decider: a mutation-default generator\n* (`@default(uuid())`) never re-picks a column's storage.\n*/\nconst postgresScalarAuthoringTypes = {\n\tString: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/text@1\",\n\t\t\tnativeType: \"text\"\n\t\t}\n\t},\n\tBoolean: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/bool@1\",\n\t\t\tnativeType: \"bool\"\n\t\t}\n\t},\n\tInt: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/int4@1\",\n\t\t\tnativeType: \"int4\"\n\t\t}\n\t},\n\tBigInt: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/int8@1\",\n\t\t\tnativeType: \"int8\"\n\t\t}\n\t},\n\tFloat: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/float8@1\",\n\t\t\tnativeType: \"float8\"\n\t\t}\n\t},\n\tDecimal: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/numeric@1\",\n\t\t\tnativeType: \"numeric\"\n\t\t}\n\t},\n\tDateTime: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/timestamptz-temporal@1\",\n\t\t\tnativeType: \"timestamptz\"\n\t\t}\n\t},\n\tJson: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/json@1\",\n\t\t\tnativeType: \"json\"\n\t\t}\n\t},\n\tJsonb: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/jsonb@1\",\n\t\t\tnativeType: \"jsonb\"\n\t\t}\n\t},\n\tBytes: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/bytea@1\",\n\t\t\tnativeType: \"bytea\"\n\t\t}\n\t}\n};\nconst postgresNativeAuthoringTypes = {\n\tVarChar: {\n\t\tkind: \"typeConstructor\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"length\",\n\t\t\tinteger: true,\n\t\t\tminimum: 1,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"sql/varchar@1\",\n\t\t\tnativeType: \"character varying\",\n\t\t\ttypeParams: { length: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t},\n\tChar: {\n\t\tkind: \"typeConstructor\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"length\",\n\t\t\tinteger: true,\n\t\t\tminimum: 1,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"sql/char@1\",\n\t\t\tnativeType: \"character\",\n\t\t\ttypeParams: { length: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t},\n\tNumeric: {\n\t\tkind: \"typeConstructor\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"precision\",\n\t\t\tinteger: true,\n\t\t\tminimum: 1,\n\t\t\toptional: true\n\t\t}, {\n\t\t\tkind: \"number\",\n\t\t\tname: \"scale\",\n\t\t\tinteger: true,\n\t\t\tminimum: 0,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"pg/numeric@1\",\n\t\t\tnativeType: \"numeric\",\n\t\t\ttypeParams: {\n\t\t\t\tprecision: {\n\t\t\t\t\tkind: \"arg\",\n\t\t\t\t\tindex: 0\n\t\t\t\t},\n\t\t\t\tscale: {\n\t\t\t\t\tkind: \"arg\",\n\t\t\t\t\tindex: 1\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\tTimestamp: {\n\t\tkind: \"typeConstructor\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"precision\",\n\t\t\tinteger: true,\n\t\t\tminimum: 0,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"pg/timestamp-temporal@1\",\n\t\t\tnativeType: \"timestamp\",\n\t\t\ttypeParams: { precision: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t},\n\tTimestamptz: {\n\t\tkind: \"typeConstructor\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"precision\",\n\t\t\tinteger: true,\n\t\t\tminimum: 0,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"pg/timestamptz-temporal@1\",\n\t\t\tnativeType: \"timestamptz\",\n\t\t\ttypeParams: { precision: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t},\n\tTime: {\n\t\tkind: \"typeConstructor\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"precision\",\n\t\t\tinteger: true,\n\t\t\tminimum: 0,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"pg/time-temporal@1\",\n\t\t\tnativeType: \"time\",\n\t\t\ttypeParams: { precision: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t},\n\tTimetz: {\n\t\tkind: \"typeConstructor\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"precision\",\n\t\t\tinteger: true,\n\t\t\tminimum: 0,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"pg/timetz@1\",\n\t\t\tnativeType: \"timetz\",\n\t\t\ttypeParams: { precision: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t},\n\tUuid: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/uuid@1\",\n\t\t\tnativeType: \"uuid\"\n\t\t}\n\t},\n\tInet: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/inet@1\",\n\t\t\tnativeType: \"inet\"\n\t\t}\n\t},\n\tSmallInt: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/int2@1\",\n\t\t\tnativeType: \"int2\"\n\t\t}\n\t},\n\tReal: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/float4@1\",\n\t\t\tnativeType: \"float4\"\n\t\t}\n\t},\n\tDate: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/date-temporal@1\",\n\t\t\tnativeType: \"date\"\n\t\t}\n\t},\n\tDateString: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/date-string@1\",\n\t\t\tnativeType: \"date\"\n\t\t}\n\t},\n\tTimestampString: {\n\t\tkind: \"typeConstructor\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"precision\",\n\t\t\tinteger: true,\n\t\t\tminimum: 0,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"pg/timestamp-string@1\",\n\t\t\tnativeType: \"timestamp\",\n\t\t\ttypeParams: { precision: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t},\n\tTimestamptzJsDate: {\n\t\tkind: \"typeConstructor\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"precision\",\n\t\t\tinteger: true,\n\t\t\tminimum: 0,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: PG_TIMESTAMPTZ_DATE_CODEC_ID,\n\t\t\tnativeType: \"timestamptz\",\n\t\t\ttypeParams: { precision: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t},\n\tTimestamptzString: {\n\t\tkind: \"typeConstructor\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"precision\",\n\t\t\tinteger: true,\n\t\t\tminimum: 0,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"pg/timestamptz-string@1\",\n\t\t\tnativeType: \"timestamptz\",\n\t\t\ttypeParams: { precision: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t},\n\tTimeString: {\n\t\tkind: \"typeConstructor\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"precision\",\n\t\t\tinteger: true,\n\t\t\tminimum: 0,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"pg/time-string@1\",\n\t\t\tnativeType: \"time\",\n\t\t\ttypeParams: { precision: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t}\n};\nconst postgresAuthoringTypes = {\n\t...postgresScalarAuthoringTypes,\n\t...postgresNativeAuthoringTypes\n};\nfunction createPostgresDefaultFunctionRegistry() {\n\treturn new Map(postgresDefaultFunctionRegistryEntries);\n}\nfunction createPostgresMutationDefaultGeneratorDescriptors() {\n\treturn [\n\t\t...builtinGeneratorRegistryMetadata.map(({ id, applicableCodecIds }) => ({\n\t\t\tid,\n\t\t\tapplicableCodecIds\n\t\t})),\n\t\ttimestampNowControlDescriptor(),\n\t\tinstantNowControlDescriptor(),\n\t\tplainDateTimeNowControlDescriptor()\n\t];\n}\n//#endregion\n//#region src/exports/control.ts\nconst postgresAdapterDescriptor = {\n\t...postgresAdapterDescriptorMeta,\n\tauthoring: {\n\t\ttype: postgresAuthoringTypes,\n\t\tvalueObjectStorageType: \"Jsonb\"\n\t},\n\tcontrolMutationDefaults: {\n\t\tdefaultFunctionRegistry: createPostgresDefaultFunctionRegistry(),\n\t\tgeneratorDescriptors: createPostgresMutationDefaultGeneratorDescriptors()\n\t},\n\tcreate(stack) {\n\t\treturn new PostgresControlAdapter(assemblePostgresCodecRegistry([\n\t\t\tstack.target,\n\t\t\t...stack.adapter === void 0 ? [] : [stack.adapter],\n\t\t\t...stack.extensions\n\t\t]));\n\t}\n};\n//#endregion\nexport { PostgresControlAdapter, createPostgresBuiltinCodecLookup, createPostgresCodecRegistryWithBuiltins, postgresAdapterDescriptor as default, escapeLiteral, normalizeSchemaNativeType, parsePostgresDefault, qualifyName, quoteIdentifier };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;;;;;;;AAWA,SAAS,0BAA0B,OAAO;CACzC,OAAO;EACN,IAAI;EACJ,YAAY;GACX,MAAM;GACN,SAAS,MAAM;GACf,UAAU,MAAM,QAAQ;GACxB,MAAM,MAAM;EACb;CACD;AACD;AACA,SAAS,mBAAmB,IAAI,QAAQ;CACvC,OAAO;EACN,IAAI;EACJ,OAAO;GACN,MAAM;GACN,WAAW;IACV,MAAM;IACN;IACA,GAAG,SAAS,EAAE,OAAO,IAAI,CAAC;GAC3B;EACD;CACD;AACD;AACA,SAAS,qBAAqB;CAC7B,OAAO;EACN,IAAI;EACJ,OAAO;GACN,MAAM;GACN,cAAc;IACb,MAAM;IACN,YAAY;GACb;EACD;CACD;AACD;AACA,SAAS,WAAW;CACnB,OAAO;EACN,IAAI;EACJ,OAAO;GACN,MAAM;GACN,cAAc;IACb,MAAM;IACN,YAAY;GACb;EACD;CACD;AACD;AACA,SAAS,YAAY;CACpB,OAAO,mBAAmB,MAAM;AACjC;AACA,SAAS,UAAU,OAAO;CACzB,OAAO,MAAM,KAAK,KAAK,eAAe,IAAI,mBAAmB,QAAQ,IAAI,mBAAmB,QAAQ;AACrG;AACA,S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B,MAAM;IACN,OAAO;GACR,EAAE;EACH;CACD;CACA,YAAY;EACX,MAAM;EACN,MAAM,CAAC;GACN,MAAM;GACN,MAAM;GACN,SAAS;GACT,SAAS;GACT,UAAU;EACX,CAAC;EACD,QAAQ;GACP,SAAS;GACT,YAAY;GACZ,YAAY,EAAE,WAAW;IACxB,MAAM;IACN,OAAO;GACR,EAAE;EACH;CACD;AACD;AACA,MAAM,yBAAyB;CAC9B,GAAG;CACH,GAAG;AACJ;AACA,SAAS,wCAAwC;CAChD,OAAO,IAAI,IAAI,sCAAsC;AACtD;AACA,SAAS,oDAAoD;CAC5D,OAAO;EACN,GAAG,iCAAiC,KAAK,EAAE,IAAI,0BAA0B;GACxE;GACA;EACD,EAAE;EACF,8BAA8B;EAC9B,4BAA4B;EAC5B,kCAAkC;CACnC;AACD;AAGA,MAAM,4BAA4B;CACjC,GAAG;CACH,WAAW;EACV,MAAM;EACN,wBAAwB;CACzB;CACA,yBAAyB;EACxB,yBAAyB,sCAAsC;EAC/D,sBAAsB,kDAAkD;CACzE;CACA,OAAO,OAAO;EACb,OAAO,IAAI,uBAAuB,8BAA8B;GAC/D,MAAM;GACN,GAAG,MAAM,YAAY,KAAK,IAAI,CAAC,IAAI,CAAC,MAAM,OAAO;GACjD,GAAG,MAAM;EACV,CAAC,CAAC;CACH;AACD"}
1
+ {"version":3,"file":"adapter__control.mjs","names":[],"sources":["../../../../3-targets/6-adapters/postgres/dist/control.mjs"],"sourcesContent":["import { i as createPostgresCodecRegistryWithBuiltins, n as assemblePostgresCodecRegistry, r as createPostgresBuiltinCodecLookup, t as PostgresControlAdapter } from \"./control-adapter-Bdz-Xa1p.mjs\";\nimport { t as postgresAdapterDescriptorMeta } from \"./descriptor-meta-TrRobK4g.mjs\";\nimport { instantNowControlDescriptor, plainDateTimeNowControlDescriptor } from \"@internal/target-postgres/control\";\nimport { parsePostgresDefault } from \"@internal/target-postgres/default-normalizer\";\nimport { normalizeSchemaNativeType } from \"@internal/target-postgres/native-type-normalizer\";\nimport { escapeLiteral, qualifyName, quoteIdentifier } from \"@internal/target-postgres/sql-utils\";\nimport { PG_TIMESTAMPTZ_DATE_CODEC_ID } from \"@internal/target-postgres/codec-ids\";\nimport { timestampNowControlDescriptor } from \"@internal/family-sql/control\";\nimport { builtinGeneratorRegistryMetadata } from \"@internal/ids\";\nimport { int, num, oneOf, optional, str } from \"@internal/psl-parser\";\n//#region src/core/control-mutation-defaults.ts\nfunction invalidArgumentDiagnostic(input) {\n\treturn {\n\t\tok: false,\n\t\tdiagnostic: {\n\t\t\tcode: \"PSL_INVALID_DEFAULT_FUNCTION_ARGUMENT\",\n\t\t\tmessage: input.message,\n\t\t\tsourceId: input.context.sourceId,\n\t\t\tspan: input.span\n\t\t}\n\t};\n}\nfunction executionGenerator(id, params) {\n\treturn {\n\t\tok: true,\n\t\tvalue: {\n\t\t\tkind: \"execution\",\n\t\t\tgenerated: {\n\t\t\t\tkind: \"generator\",\n\t\t\t\tid,\n\t\t\t\t...params ? { params } : {}\n\t\t\t}\n\t\t}\n\t};\n}\nfunction lowerAutoincrement() {\n\treturn {\n\t\tok: true,\n\t\tvalue: {\n\t\t\tkind: \"storage\",\n\t\t\tdefaultValue: {\n\t\t\t\tkind: \"function\",\n\t\t\t\texpression: \"autoincrement()\"\n\t\t\t}\n\t\t}\n\t};\n}\nfunction lowerNow() {\n\treturn {\n\t\tok: true,\n\t\tvalue: {\n\t\t\tkind: \"storage\",\n\t\t\tdefaultValue: {\n\t\t\t\tkind: \"function\",\n\t\t\t\texpression: \"now()\"\n\t\t\t}\n\t\t}\n\t};\n}\nfunction lowerUlid() {\n\treturn executionGenerator(\"ulid\");\n}\nfunction lowerUuid(input) {\n\treturn input.call.args[\"version\"] === 7 ? executionGenerator(\"uuidv7\") : executionGenerator(\"uuidv4\");\n}\nfunction lowerCuid() {\n\treturn executionGenerator(\"cuid2\");\n}\nfunction lowerNanoid(input) {\n\tconst size = input.call.args[\"size\"];\n\treturn typeof size === \"number\" ? executionGenerator(\"nanoid\", { size }) : executionGenerator(\"nanoid\");\n}\nfunction lowerDbgenerated(input) {\n\tconst expression = input.call.args[\"expression\"];\n\tif (typeof expression !== \"string\" || expression.trim().length === 0) return invalidArgumentDiagnostic({\n\t\tcontext: input.context,\n\t\tspan: input.call.span,\n\t\tmessage: \"Default function \\\"dbgenerated\\\" argument cannot be empty.\"\n\t});\n\treturn {\n\t\tok: true,\n\t\tvalue: {\n\t\t\tkind: \"storage\",\n\t\t\tdefaultValue: {\n\t\t\t\tkind: \"function\",\n\t\t\t\texpression\n\t\t\t}\n\t\t}\n\t};\n}\nconst nowSig = { documentation: \"Uses the current database timestamp as the default value.\" };\nconst autoincrementSig = { documentation: \"Generates an increasing integer value in the database.\" };\nconst ulidSig = { documentation: \"Generates a ULID when a value is not supplied.\" };\nconst uuidSig = {\n\tdocumentation: \"Generates a UUID when a value is not supplied.\",\n\tpositional: [{\n\t\tkey: \"version\",\n\t\ttype: optional(oneOf(num(4), num(7))),\n\t\tdocumentation: \"The UUID version: `4` or `7`. Defaults to `4`.\"\n\t}]\n};\nconst cuidSig = {\n\tdocumentation: \"Generates a CUID2 identifier when a value is not supplied.\",\n\tpositional: [{\n\t\tkey: \"version\",\n\t\ttype: num(2),\n\t\tdocumentation: \"The CUID version. Only `2` is supported.\"\n\t}]\n};\nconst nanoidSig = {\n\tdocumentation: \"Generates a Nano ID when a value is not supplied.\",\n\tpositional: [{\n\t\tkey: \"size\",\n\t\ttype: optional(int({\n\t\t\tmin: 2,\n\t\t\tmax: 255\n\t\t})),\n\t\tdocumentation: \"The identifier length, from `2` through `255`. Omit to use the generator default.\"\n\t}]\n};\nconst dbgeneratedSig = {\n\tdocumentation: \"Uses a database SQL expression as the default value.\",\n\tpositional: [{\n\t\tkey: \"expression\",\n\t\ttype: str(),\n\t\tdocumentation: \"The nonempty SQL expression evaluated by the database.\"\n\t}]\n};\nconst postgresDefaultFunctionRegistryEntries = [\n\t[\"autoincrement\", {\n\t\tsignature: autoincrementSig,\n\t\tlower: lowerAutoincrement,\n\t\tusageSignatures: [\"autoincrement()\"]\n\t}],\n\t[\"now\", {\n\t\tsignature: nowSig,\n\t\tlower: lowerNow,\n\t\tusageSignatures: [\"now()\"]\n\t}],\n\t[\"uuid\", {\n\t\tsignature: uuidSig,\n\t\tlower: lowerUuid,\n\t\tusageSignatures: [\n\t\t\t\"uuid()\",\n\t\t\t\"uuid(4)\",\n\t\t\t\"uuid(7)\"\n\t\t]\n\t}],\n\t[\"cuid\", {\n\t\tsignature: cuidSig,\n\t\tlower: lowerCuid,\n\t\tusageSignatures: [\"cuid(2)\"]\n\t}],\n\t[\"ulid\", {\n\t\tsignature: ulidSig,\n\t\tlower: lowerUlid,\n\t\tusageSignatures: [\"ulid()\"]\n\t}],\n\t[\"nanoid\", {\n\t\tsignature: nanoidSig,\n\t\tlower: lowerNanoid,\n\t\tusageSignatures: [\"nanoid()\", \"nanoid(<2-255>)\"]\n\t}],\n\t[\"dbgenerated\", {\n\t\tsignature: dbgeneratedSig,\n\t\tlower: lowerDbgenerated,\n\t\tusageSignatures: [\"dbgenerated(\\\"...\\\")\"]\n\t}]\n];\n/**\n* The base PSL scalars as zero-arg type constructors in the unified authoring\n* channel, with explicit `nativeType` values pinned to the codec manifests\n* (`codecLookup.targetTypesFor(codecId)[0]`).\n*\n* The type position is the only storage decider: a mutation-default generator\n* (`@default(uuid())`) never re-picks a column's storage.\n*/\nconst postgresScalarAuthoringTypes = {\n\tString: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"Variable-length text stored as PostgreSQL text.\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/text@1\",\n\t\t\tnativeType: \"text\"\n\t\t}\n\t},\n\tBoolean: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A true or false value stored as PostgreSQL boolean.\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/bool@1\",\n\t\t\tnativeType: \"bool\"\n\t\t}\n\t},\n\tInt: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A signed 32-bit integer represented as a JavaScript number.\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/int4@1\",\n\t\t\tnativeType: \"int4\"\n\t\t}\n\t},\n\tBigInt: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A signed 64-bit integer represented as a JavaScript bigint.\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/int8@1\",\n\t\t\tnativeType: \"int8\"\n\t\t}\n\t},\n\tFloat: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A double-precision floating-point number.\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/float8@1\",\n\t\t\tnativeType: \"float8\"\n\t\t}\n\t},\n\tDecimal: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"An exact decimal value stored as PostgreSQL numeric.\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/numeric@1\",\n\t\t\tnativeType: \"numeric\"\n\t\t}\n\t},\n\tDateTime: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"An instant stored as PostgreSQL timestamptz and represented as Temporal.Instant.\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/timestamptz-temporal@1\",\n\t\t\tnativeType: \"timestamptz\"\n\t\t}\n\t},\n\tJson: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A JSON value stored as PostgreSQL json.\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/json@1\",\n\t\t\tnativeType: \"json\"\n\t\t}\n\t},\n\tJsonb: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A JSON value stored in PostgreSQL binary jsonb format.\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/jsonb@1\",\n\t\t\tnativeType: \"jsonb\"\n\t\t}\n\t},\n\tBytes: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"Binary data stored as PostgreSQL bytea.\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/bytea@1\",\n\t\t\tnativeType: \"bytea\"\n\t\t}\n\t}\n};\nconst postgresNativeAuthoringTypes = {\n\tVarChar: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"Variable-length text with an optional maximum character length.\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"length\",\n\t\t\tinteger: true,\n\t\t\tminimum: 1,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"sql/varchar@1\",\n\t\t\tnativeType: \"character varying\",\n\t\t\ttypeParams: { length: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t},\n\tChar: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"Fixed-length, blank-padded text with an optional character length.\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"length\",\n\t\t\tinteger: true,\n\t\t\tminimum: 1,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"sql/char@1\",\n\t\t\tnativeType: \"character\",\n\t\t\ttypeParams: { length: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t},\n\tNumeric: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"An exact decimal value with optional precision and scale.\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"precision\",\n\t\t\tinteger: true,\n\t\t\tminimum: 1,\n\t\t\toptional: true\n\t\t}, {\n\t\t\tkind: \"number\",\n\t\t\tname: \"scale\",\n\t\t\tinteger: true,\n\t\t\tminimum: 0,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"pg/numeric@1\",\n\t\t\tnativeType: \"numeric\",\n\t\t\ttypeParams: {\n\t\t\t\tprecision: {\n\t\t\t\t\tkind: \"arg\",\n\t\t\t\t\tindex: 0\n\t\t\t\t},\n\t\t\t\tscale: {\n\t\t\t\t\tkind: \"arg\",\n\t\t\t\t\tindex: 1\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\tTimestamp: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A date and time without a time zone, represented as Temporal.PlainDateTime.\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"precision\",\n\t\t\tinteger: true,\n\t\t\tminimum: 0,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"pg/timestamp-temporal@1\",\n\t\t\tnativeType: \"timestamp\",\n\t\t\ttypeParams: { precision: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t},\n\tTimestamptz: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"An instant represented as Temporal.Instant, with optional fractional-second precision.\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"precision\",\n\t\t\tinteger: true,\n\t\t\tminimum: 0,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"pg/timestamptz-temporal@1\",\n\t\t\tnativeType: \"timestamptz\",\n\t\t\ttypeParams: { precision: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t},\n\tTime: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A time of day without a time zone, represented as Temporal.PlainTime.\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"precision\",\n\t\t\tinteger: true,\n\t\t\tminimum: 0,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"pg/time-temporal@1\",\n\t\t\tnativeType: \"time\",\n\t\t\ttypeParams: { precision: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t},\n\tTimetz: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A time of day with a UTC offset stored as PostgreSQL timetz.\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"precision\",\n\t\t\tinteger: true,\n\t\t\tminimum: 0,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"pg/timetz@1\",\n\t\t\tnativeType: \"timetz\",\n\t\t\ttypeParams: { precision: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t},\n\tUuid: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A universally unique identifier stored as PostgreSQL uuid.\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/uuid@1\",\n\t\t\tnativeType: \"uuid\"\n\t\t}\n\t},\n\tInet: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"An IPv4 or IPv6 address with an optional subnet mask.\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/inet@1\",\n\t\t\tnativeType: \"inet\"\n\t\t}\n\t},\n\tSmallInt: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A signed 16-bit integer represented as a JavaScript number.\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/int2@1\",\n\t\t\tnativeType: \"int2\"\n\t\t}\n\t},\n\tReal: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A single-precision floating-point number.\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/float4@1\",\n\t\t\tnativeType: \"float4\"\n\t\t}\n\t},\n\tDate: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A calendar date represented as Temporal.PlainDate.\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/date-temporal@1\",\n\t\t\tnativeType: \"date\"\n\t\t}\n\t},\n\tDateString: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A PostgreSQL date represented as database text rather than Temporal.PlainDate.\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/date-string@1\",\n\t\t\tnativeType: \"date\"\n\t\t}\n\t},\n\tTimestampString: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A timestamp without a time zone represented as PostgreSQL text.\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"precision\",\n\t\t\tinteger: true,\n\t\t\tminimum: 0,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"pg/timestamp-string@1\",\n\t\t\tnativeType: \"timestamp\",\n\t\t\ttypeParams: { precision: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t},\n\tTimestamptzJsDate: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"An instant stored as PostgreSQL timestamptz and represented as a JavaScript Date.\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"precision\",\n\t\t\tinteger: true,\n\t\t\tminimum: 0,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: PG_TIMESTAMPTZ_DATE_CODEC_ID,\n\t\t\tnativeType: \"timestamptz\",\n\t\t\ttypeParams: { precision: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t},\n\tTimestamptzString: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A timestamp with time zone represented as PostgreSQL text.\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"precision\",\n\t\t\tinteger: true,\n\t\t\tminimum: 0,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"pg/timestamptz-string@1\",\n\t\t\tnativeType: \"timestamptz\",\n\t\t\ttypeParams: { precision: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t},\n\tTimeString: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A time of day without a time zone represented as PostgreSQL text.\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"precision\",\n\t\t\tinteger: true,\n\t\t\tminimum: 0,\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"pg/time-string@1\",\n\t\t\tnativeType: \"time\",\n\t\t\ttypeParams: { precision: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t}\n};\nconst postgresAuthoringTypes = {\n\t...postgresScalarAuthoringTypes,\n\t...postgresNativeAuthoringTypes\n};\nfunction createPostgresDefaultFunctionRegistry() {\n\treturn new Map(postgresDefaultFunctionRegistryEntries);\n}\nfunction createPostgresMutationDefaultGeneratorDescriptors() {\n\treturn [\n\t\t...builtinGeneratorRegistryMetadata.map(({ id, applicableCodecIds }) => ({\n\t\t\tid,\n\t\t\tapplicableCodecIds\n\t\t})),\n\t\ttimestampNowControlDescriptor(),\n\t\tinstantNowControlDescriptor(),\n\t\tplainDateTimeNowControlDescriptor()\n\t];\n}\n//#endregion\n//#region src/exports/control.ts\nconst postgresAdapterDescriptor = {\n\t...postgresAdapterDescriptorMeta,\n\tauthoring: {\n\t\ttype: postgresAuthoringTypes,\n\t\tvalueObjectStorageType: \"Jsonb\"\n\t},\n\tcontrolMutationDefaults: {\n\t\tdefaultFunctionRegistry: createPostgresDefaultFunctionRegistry(),\n\t\tgeneratorDescriptors: createPostgresMutationDefaultGeneratorDescriptors()\n\t},\n\tcreate(stack) {\n\t\treturn new PostgresControlAdapter(assemblePostgresCodecRegistry([\n\t\t\tstack.target,\n\t\t\t...stack.adapter === void 0 ? [] : [stack.adapter],\n\t\t\t...stack.extensions\n\t\t]));\n\t}\n};\n//#endregion\nexport { PostgresControlAdapter, createPostgresBuiltinCodecLookup, createPostgresCodecRegistryWithBuiltins, postgresAdapterDescriptor as default, escapeLiteral, normalizeSchemaNativeType, parsePostgresDefault, qualifyName, quoteIdentifier };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;;;;;;;AAWA,SAAS,0BAA0B,OAAO;CACzC,OAAO;EACN,IAAI;EACJ,YAAY;GACX,MAAM;GACN,SAAS,MAAM;GACf,UAAU,MAAM,QAAQ;GACxB,MAAM,MAAM;EACb;CAC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ACA,KAAK;EACJ,MAAM;EACN,eAAe;EACf,QAAQ;GACP,SAAS;GACT,YAAY;EACb;CACD;CACA,QAAQ;EACP,MAAM;EACN,eAAe;EACf,QAAQ;GACP,SAAS;GACT,YAAY;EACb;CACD;CACA,OAAO;EACN,MAAM;EACN,eAAe;EACf,QAAQ;GACP,SAAS;GACT,YAAY;EACb;CACD;CACA,SAAS;EACR,MAAM;EACN,eAAe;EACf,QAAQ;GACP,SAAS;GACT,YAAY;EACb;CACD;CACA,UAAU;EACT,MAAM;EACN,eAAe;EACf,QAAQ;GACP,SAAS;GACT,YAAY;EACb;CACD;CACA,MAAM;EACL,MAAM;EACN,eAAe;EACf,QAAQ;GACP,SAAS;GACT,YAAY;EACb;CACD;CACA,OAAO;EACN,MAAM;EACN,eAAe;EACf,QAAQ;GACP,SAAS;GACT,YAAY;EACb;CACD;CACA,OAAO;EACN,MAAM;EACN,eAAe;EACf,QAAQ;GACP,SAAS;GACT,YAAY;EACb;CACD;AACD;AACA,MAAM,+BAA+B;CACpC,SAAS;EACR,MAAM;EACN,eAAe;EACf,MAAM,CAAC;GACN,MAAM;GACN,MAAM;GACN,SAAS;GACT,SAAS;GACT,UAAU;EACX,CAAC;EACD,QAAQ;GACP,SAAS;GACT,YAAY;GACZ,YAAY,EAAE,QAAQ;IACrB,MAAM;IACN,OAAO;GACR,EAAE;EACH;CACD;CACA,MAAM;EACL,MAAM;EACN,eAAe;EACf,MAAM,CAAC;GACN,MAAM;GACN,MAAM;GACN,SAAS;GACT,SAAS;GACT,UAAU;EACX,CAAC;EACD,QAAQ;GACP,SAAS;GACT,YAAY;GACZ,YAAY,EAAE,QAAQ;IACrB,MAAM;IACN,OAAO;GACR,EAAE;EACH;CACD;CACA,SAAS;EACR,MAAM;EACN,eAAe;EACf,MAAM,CAAC;GACN,MAAM;GACN,MAAM;GACN,SAAS;GACT,SAAS;GACT,UAAU;EACX,GAAG;GACF,MAAM;GACN,MAAM;GACN,SAAS;GACT,SAAS;GACT,UAA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AAoD;CAC5D,OAAO;EACN,GAAG,iCAAiC,KAAK,EAAE,IAAI,0BAA0B;GACxE;GACA;EACD,EAAE;EACF,8BAA8B;EAC9B,4BAA4B;EAC5B,kCAAkC;CACnC;AACD;AAGA,MAAM,4BAA4B;CACjC,GAAG;CACH,WAAW;EACV,MAAM;EACN,wBAAwB;CACzB;CACA,yBAAyB;EACxB,yBAAyB,sCAAsC;EAC/D,sBAAsB,kDAAkD;CACzE;CACA,OAAO,OAAO;EACb,OAAO,IAAI,uBAAuB,8BAA8B;GAC/D,MAAM;GACN,GAAG,MAAM,YAAY,KAAK,IAAI,CAAC,IAAI,CAAC,MAAM,OAAO;GACjD,GAAG,MAAM;EACV,CAAC,CAAC;CACH;AACD"}
@@ -1,5 +1,5 @@
1
1
  import { n as postgresCodecRegistry } from "./codecs-BrJWpXPJ.mjs";
2
- import { a as plainDateTimeNow, n as PLAIN_DATE_TIME_NOW_GENERATOR_ID, r as instantNow, t as INSTANT_NOW_GENERATOR_ID } from "./authoring-C3hGtD3B-DPpnMHfT.mjs";
2
+ import { a as plainDateTimeNow, n as PLAIN_DATE_TIME_NOW_GENERATOR_ID, r as instantNow, t as INSTANT_NOW_GENERATOR_ID } from "./authoring-DhCDnK1T-CGirVrrH.mjs";
3
3
  import { n as assemblePostgresCodecRegistry } from "./control-adapter-Bdz-Xa1p-rKiOVhsh.mjs";
4
4
  import { n as createPostgresAdapterWithCodecRegistry, r as postgresRawCodecInferer } from "./adapter-bTD1EPrl-DQ66tQwz.mjs";
5
5
  import { n as postgresQueryOperations, t as postgresAdapterDescriptorMeta } from "./descriptor-meta-TrRobK4g-CQJJoHqf.mjs";
@@ -11,7 +11,7 @@ import { assertDefined, invariant } from "@prisma/orm-framework/utils/assertions
11
11
  import { TIMESTAMP_NOW_GENERATOR_ID, temporalAuthoringPresets, temporalCodecPresetWithPrecision, temporalStringAuthoringPresets } from "@prisma/orm-family-sql/family/control";
12
12
  import { blockAttribute, leafDiagnostic, modelAttribute, str } from "@prisma/orm-framework/psl-parser";
13
13
  import { exactNameBodyWarning } from "@prisma/orm-family-sql/contract/index-naming";
14
- //#region ../../../3-targets/3-targets/postgres/dist/authoring-C3hGtD3B.mjs
14
+ //#region ../../../3-targets/3-targets/postgres/dist/authoring-DhCDnK1T.mjs
15
15
  const INSTANT_NOW_GENERATOR_ID = "instantNow";
16
16
  function instantNowControlDescriptor() {
17
17
  return {
@@ -87,6 +87,7 @@ const PSL_ROLE_BLOCK_OUTSIDE_UNBOUND_NAMESPACE = "PSL_ROLE_BLOCK_OUTSIDE_UNBOUND
87
87
  const postgresAuthoringTypes = {
88
88
  BigIntNumber: {
89
89
  kind: "typeConstructor",
90
+ documentation: "A PostgreSQL 64-bit integer represented as a JavaScript number within its safe integer range.",
90
91
  output: {
91
92
  codecId: "pg/int8number@1",
92
93
  nativeType: "int8"
@@ -94,6 +95,7 @@ const postgresAuthoringTypes = {
94
95
  },
95
96
  UnboundedInt: {
96
97
  kind: "typeConstructor",
98
+ documentation: "An arbitrary-precision integer stored as PostgreSQL numeric and represented as bigint.",
97
99
  output: {
98
100
  codecId: "pg/unboundedint@1",
99
101
  nativeType: "numeric"
@@ -427,12 +429,14 @@ const postgresAuthoringEntityTypes = {
427
429
  */
428
430
  const policyTargetParam = {
429
431
  kind: "ref",
432
+ documentation: "The model protected by this policy; it must declare @@rls.",
430
433
  refKind: "model",
431
434
  scope: "same-namespace",
432
435
  required: true
433
436
  };
434
437
  const policyRolesParam = {
435
438
  kind: "list",
439
+ documentation: "The database roles to which this policy applies.",
436
440
  of: {
437
441
  kind: "ref",
438
442
  refKind: "role",
@@ -442,11 +446,13 @@ const policyRolesParam = {
442
446
  const policyPredicateParam = {
443
447
  kind: "value",
444
448
  codecId: "pg/text@1",
445
- required: true
449
+ required: true,
450
+ documentation: "A SQL predicate controlling which rows this policy permits."
446
451
  };
447
452
  const policyPermissiveParam = {
448
453
  kind: "value",
449
- codecId: "pg/bool@1"
454
+ codecId: "pg/bool@1",
455
+ documentation: "Whether the policy is permissive (combined with OR) rather than restrictive (combined with AND)."
450
456
  };
451
457
  const policyRequiresRls = {
452
458
  parameter: "target",
@@ -474,6 +480,7 @@ const postgresAuthoringPslBlockDescriptors = {
474
480
  policy_select: {
475
481
  kind: "pslBlock",
476
482
  keyword: "policy_select",
483
+ documentation: "Defines a row-level security policy controlling which rows can be selected.",
477
484
  discriminator: "policy",
478
485
  name: { required: true },
479
486
  parameters: {
@@ -488,6 +495,7 @@ const postgresAuthoringPslBlockDescriptors = {
488
495
  policy_delete: {
489
496
  kind: "pslBlock",
490
497
  keyword: "policy_delete",
498
+ documentation: "Defines a row-level security policy controlling which rows can be deleted.",
491
499
  discriminator: "policy",
492
500
  name: { required: true },
493
501
  parameters: {
@@ -502,6 +510,7 @@ const postgresAuthoringPslBlockDescriptors = {
502
510
  policy_insert: {
503
511
  kind: "pslBlock",
504
512
  keyword: "policy_insert",
513
+ documentation: "Defines a row-level security policy checking rows being inserted.",
505
514
  discriminator: "policy",
506
515
  name: { required: true },
507
516
  parameters: {
@@ -516,6 +525,7 @@ const postgresAuthoringPslBlockDescriptors = {
516
525
  policy_update: {
517
526
  kind: "pslBlock",
518
527
  keyword: "policy_update",
528
+ documentation: "Defines a row-level security policy controlling row visibility and checks for updates.",
519
529
  discriminator: "policy",
520
530
  name: { required: true },
521
531
  parameters: {
@@ -531,6 +541,7 @@ const postgresAuthoringPslBlockDescriptors = {
531
541
  policy_all: {
532
542
  kind: "pslBlock",
533
543
  keyword: "policy_all",
544
+ documentation: "Defines a row-level security policy applying to all operations.",
534
545
  discriminator: "policy",
535
546
  name: { required: true },
536
547
  parameters: {
@@ -556,6 +567,7 @@ const postgresAuthoringPslBlockDescriptors = {
556
567
  native_enum: {
557
568
  kind: "pslBlock",
558
569
  keyword: "native_enum",
570
+ documentation: "Defines a PostgreSQL enum type with named string-valued members.",
559
571
  discriminator: "native_enum",
560
572
  name: { required: true },
561
573
  parameters: {},
@@ -571,6 +583,7 @@ const postgresAuthoringPslBlockDescriptors = {
571
583
  role: {
572
584
  kind: "pslBlock",
573
585
  keyword: "role",
586
+ documentation: "Declares an existing database role in namespace unbound for use in security policies.",
574
587
  discriminator: "role",
575
588
  name: { required: true },
576
589
  parameters: {}
@@ -867,4 +880,4 @@ function postgresLowerEntityHandles(input) {
867
880
  //#endregion
868
881
  export { plainDateTimeNow as a, postgresAuthoringFieldPresets as c, postgresAuthoringTypes as d, postgresLowerEntityHandles as f, instantNowControlDescriptor as i, postgresAuthoringModelAttributes as l, PLAIN_DATE_TIME_NOW_GENERATOR_ID as n, plainDateTimeNowControlDescriptor as o, postgresNowGeneratorIdFor as p, instantNow as r, postgresAuthoringEntityTypes as s, INSTANT_NOW_GENERATOR_ID as t, postgresAuthoringPslBlockDescriptors as u };
869
882
 
870
- //# sourceMappingURL=authoring-C3hGtD3B-DPpnMHfT.mjs.map
883
+ //# sourceMappingURL=authoring-DhCDnK1T-CGirVrrH.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authoring-DhCDnK1T-CGirVrrH.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/authoring-DhCDnK1T.mjs"],"sourcesContent":["import { C as PG_TIMESTAMPTZ_DATE_CODEC_ID, D as PG_TIMESTAMP_TEMPORAL_CODEC_ID, E as PG_TIMESTAMP_STRING_CODEC_ID, T as PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID, s as PG_ENUM_CODEC_ID, w as PG_TIMESTAMPTZ_STRING_CODEC_ID } from \"./codec-ids-BYhNGq22.mjs\";\nimport { i as errorTemporalUnavailableForDefault, s as postgresError } from \"./errors-DYyzTYzE.mjs\";\nimport { t as PostgresNativeEnum } from \"./postgres-native-enum-CdP3b_-R.mjs\";\nimport { _ as PostgresRlsPolicy, d as PostgresNativeEnumSchema, f as PostgresRlsEnablementSchema, h as PostgresRole, m as PostgresRoleSchema, p as PostgresRlsPolicySchema, v as PostgresRlsEnablement } from \"./postgres-schema-PFL-fpel.mjs\";\nimport { n as computeContentHash, t as POLICY_OPERATION_PREDICATES } from \"./canonicalize-CrN3u_xM.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { TIMESTAMP_NOW_GENERATOR_ID, temporalAuthoringPresets, temporalCodecPresetWithPrecision, temporalStringAuthoringPresets } from \"@internal/family-sql/control\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { blockAttribute, leafDiagnostic, modelAttribute, str } from \"@internal/psl-parser\";\nimport { exactNameBodyWarning } from \"@internal/sql-contract/index-naming\";\nimport { assertWireNamePrefixLength, normalizeSqlBody } from \"@internal/sql-schema-ir/naming\";\nimport { assertDefined, invariant } from \"@internal/utils/assertions\";\n//#region src/core/instant-now-generator.ts\nconst INSTANT_NOW_GENERATOR_ID = \"instantNow\";\nfunction instantNowControlDescriptor() {\n\treturn {\n\t\tid: INSTANT_NOW_GENERATOR_ID,\n\t\tbuildPhases: () => ({\n\t\t\tonCreate: {\n\t\t\t\tkind: \"generator\",\n\t\t\t\tid: INSTANT_NOW_GENERATOR_ID\n\t\t\t},\n\t\t\tonUpdate: {\n\t\t\t\tkind: \"generator\",\n\t\t\t\tid: INSTANT_NOW_GENERATOR_ID\n\t\t\t}\n\t\t})\n\t};\n}\nfunction instantNow() {\n\tif (typeof Temporal === \"undefined\") throw errorTemporalUnavailableForDefault(INSTANT_NOW_GENERATOR_ID);\n\treturn Temporal.Now.instant();\n}\n//#endregion\n//#region src/core/plain-date-time-now-generator.ts\n/**\n* The \"now\" generator for `timestamp` (without time zone) columns: the current\n* moment as a UTC wall-clock `Temporal.PlainDateTime`, the representation\n* `pg/timestamp-temporal@1` encodes. `timestamptz` columns use `instantNow`.\n*/\nconst PLAIN_DATE_TIME_NOW_GENERATOR_ID = \"plainDateTimeNow\";\nfunction plainDateTimeNowControlDescriptor() {\n\treturn {\n\t\tid: PLAIN_DATE_TIME_NOW_GENERATOR_ID,\n\t\tbuildPhases: () => ({\n\t\t\tonCreate: {\n\t\t\t\tkind: \"generator\",\n\t\t\t\tid: PLAIN_DATE_TIME_NOW_GENERATOR_ID\n\t\t\t},\n\t\t\tonUpdate: {\n\t\t\t\tkind: \"generator\",\n\t\t\t\tid: PLAIN_DATE_TIME_NOW_GENERATOR_ID\n\t\t\t}\n\t\t})\n\t};\n}\nfunction plainDateTimeNow() {\n\tif (typeof Temporal === \"undefined\") throw errorTemporalUnavailableForDefault(PLAIN_DATE_TIME_NOW_GENERATOR_ID);\n\treturn Temporal.Now.plainDateTimeISO(\"UTC\");\n}\n//#endregion\n//#region src/core/now-generators.ts\n/** The \"now\" generator for each codec that has one. The `temporal` field presets read it. */\nconst postgresNowGeneratorIds = {\n\t[PG_TIMESTAMP_TEMPORAL_CODEC_ID]: PLAIN_DATE_TIME_NOW_GENERATOR_ID,\n\t[PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID]: INSTANT_NOW_GENERATOR_ID,\n\t[PG_TIMESTAMPTZ_DATE_CODEC_ID]: TIMESTAMP_NOW_GENERATOR_ID,\n\t[PG_TIMESTAMP_STRING_CODEC_ID]: TIMESTAMP_NOW_GENERATOR_ID,\n\t[PG_TIMESTAMPTZ_STRING_CODEC_ID]: TIMESTAMP_NOW_GENERATOR_ID\n};\nconst nowGeneratorIdByCodecId = new Map(Object.entries(postgresNowGeneratorIds));\nfunction postgresNowGeneratorIdFor(codecId) {\n\treturn nowGeneratorIdByCodecId.get(codecId);\n}\n//#endregion\n//#region src/core/authoring.ts\nconst PSL_RLS_PREDICATE_NOT_FOR_OPERATION = \"PSL_RLS_PREDICATE_NOT_FOR_OPERATION\";\nconst PSL_POLICY_INVALID_MAP = \"PSL_POLICY_INVALID_MAP\";\nconst PSL_NATIVE_ENUM_BARE_MEMBER = \"PSL_NATIVE_ENUM_BARE_MEMBER\";\nconst PSL_EXTENSION_INVALID_VALUE = \"PSL_EXTENSION_INVALID_VALUE\";\nconst PSL_NATIVE_ENUM_DUPLICATE_MEMBER_VALUE = \"PSL_NATIVE_ENUM_DUPLICATE_MEMBER_VALUE\";\nconst PSL_NATIVE_ENUM_MISSING_MEMBERS = \"PSL_NATIVE_ENUM_MISSING_MEMBERS\";\nconst PSL_ROLE_BLOCK_OUTSIDE_UNBOUND_NAMESPACE = \"PSL_ROLE_BLOCK_OUTSIDE_UNBOUND_NAMESPACE\";\n/**\n* `pg.enum(<ref>)` registers as an ordinary type constructor whose sole\n* positional argument names a `native_enum` entity instead of carrying a\n* literal value. The interpreter resolves the ref to the `native_enum`\n* entity generically (driven by `entityRefArg`); the `pg/enum@1` codec\n* descriptor's `columnFromEntity` hook (see `codecs.ts`) converts that\n* entity into the column's `typeParams` and native type.\n*/\nconst postgresAuthoringTypes = {\n\tBigIntNumber: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A PostgreSQL 64-bit integer represented as a JavaScript number within its safe integer range.\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/int8number@1\",\n\t\t\tnativeType: \"int8\"\n\t\t}\n\t},\n\tUnboundedInt: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"An arbitrary-precision integer stored as PostgreSQL numeric and represented as bigint.\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/unboundedint@1\",\n\t\t\tnativeType: \"numeric\"\n\t\t}\n\t},\n\tpg: { enum: {\n\t\tkind: \"typeConstructor\",\n\t\tentityRefArg: {\n\t\t\tindex: 0,\n\t\t\tentityKind: \"native_enum\"\n\t\t},\n\t\toutput: { codecId: PG_ENUM_CODEC_ID }\n\t} }\n};\n/**\n* Maps a `policy_<op>` keyword to the RLS operation it authors. The keyword\n* IS the operation (per the project's rejection of a `policy { operation = … }`\n* conditional block).\n*/\nconst POLICY_KEYWORD_OPERATION = {\n\tpolicy_select: \"select\",\n\tpolicy_insert: \"insert\",\n\tpolicy_update: \"update\",\n\tpolicy_delete: \"delete\",\n\tpolicy_all: \"all\"\n};\nfunction readValueParam(block, key) {\n\tconst param = block.parameters[key];\n\treturn param?.kind === \"value\" ? param.raw : void 0;\n}\nfunction readListRefParams(block, key) {\n\tconst param = block.parameters[key];\n\tif (param?.kind !== \"list\") return [];\n\treturn param.items.flatMap((item) => item.kind === \"ref\" ? [item.identifier] : []);\n}\n/**\n* Unwraps a quoted PSL string argument, inverting the printer's\n* `escapePslString` escapes (`\\\\`, `\\\"`, `\\n`, `\\r`). An unknown escape\n* sequence is kept verbatim, matching the printer-side `unescapePslString`\n* convention.\n*/\nfunction unwrapQuotedString(raw) {\n\tif (!(raw.startsWith(\"\\\"\") && raw.endsWith(\"\\\"\") && raw.length >= 2)) return raw;\n\tconst inner = raw.slice(1, -1);\n\tlet result = \"\";\n\tfor (let i = 0; i < inner.length; i++) {\n\t\tif (inner[i] !== \"\\\\\" || i + 1 >= inner.length) {\n\t\t\tresult += inner[i];\n\t\t\tcontinue;\n\t\t}\n\t\tconst next = inner[i + 1];\n\t\tif (next === \"\\\\\" || next === \"\\\"\") result += next;\n\t\telse if (next === \"n\") result += \"\\n\";\n\t\telse if (next === \"r\") result += \"\\r\";\n\t\telse {\n\t\t\tresult += \"\\\\\";\n\t\t\tresult += next;\n\t\t}\n\t\ti++;\n\t}\n\treturn result;\n}\n/**\n* Assembles a {@link PostgresRlsPolicy} from lowered inputs: normalizes the\n* predicates, computes the content-hash wire name, and constructs the frozen\n* entity. The single hash-assembly body shared by the PSL block lowering\n* ({@link lowerRlsPolicyFromBlock}) and the TS entity-handle lowering\n* ({@link postgresLowerEntityHandles}) so the two surfaces cannot drift.\n*/\nfunction buildRlsPolicyEntity(input) {\n\tconst permissive = input.permissive ?? true;\n\tconst wireHash = computeContentHash({\n\t\t...ifDefined(\"using\", input.using !== void 0 ? normalizeSqlBody(input.using) : void 0),\n\t\t...ifDefined(\"withCheck\", input.withCheck !== void 0 ? normalizeSqlBody(input.withCheck) : void 0),\n\t\troles: input.roles,\n\t\toperation: input.operation,\n\t\tpermissive\n\t});\n\treturn new PostgresRlsPolicy({\n\t\tnaming: {\n\t\t\tkind: \"wire\",\n\t\t\tprefix: input.prefix,\n\t\t\thash: wireHash\n\t\t},\n\t\ttableName: input.tableName,\n\t\tnamespaceId: input.namespaceId,\n\t\toperation: input.operation,\n\t\troles: input.roles,\n\t\tusing: input.using,\n\t\twithCheck: input.withCheck,\n\t\tpermissive\n\t});\n}\nfunction lowerRlsPolicyFromBlock(block, ctx) {\n\tconst prefix = block.name;\n\tconst operation = POLICY_KEYWORD_OPERATION[block.keyword] ?? \"select\";\n\tconst tableName = block.resolvedModelRefs?.[\"target\"]?.tableName;\n\tassertDefined(tableName, `lowerRlsPolicyFromBlock: policy \"${block.name}\" reached the factory without a resolved \\`target\\` ref; the interpreter resolves same-namespace model refs before invoking entity factories.`);\n\tconst roles = [...readListRefParams(block, \"roles\")].sort();\n\tconst usingRaw = readValueParam(block, \"using\");\n\tconst withCheckRaw = readValueParam(block, \"withCheck\");\n\tconst support = POLICY_OPERATION_PREDICATES[operation];\n\tconst rejectPredicate = (predicate) => {\n\t\tctx.diagnostics?.push({\n\t\t\tcode: PSL_RLS_PREDICATE_NOT_FOR_OPERATION,\n\t\t\tmessage: `\\`${block.keyword}\\` policy \"${block.name}\" does not take a \\`${predicate}\\` predicate; the ${operation.toUpperCase()} operation uses ${support.using ? \"`using`\" : \"`withCheck`\"}${support.using && support.withCheck ? \" and `withCheck`\" : \" only\"}.`,\n\t\t\tsourceId: ctx.sourceId ?? \"unknown\",\n\t\t\tspan: block.parameters[predicate]?.span ?? block.span\n\t\t});\n\t};\n\tif (usingRaw !== void 0 && !support.using) return rejectPredicate(\"using\");\n\tif (withCheckRaw !== void 0 && !support.withCheck) return rejectPredicate(\"withCheck\");\n\tconst using = usingRaw !== void 0 ? unwrapQuotedString(usingRaw) : void 0;\n\tconst withCheck = withCheckRaw !== void 0 ? unwrapQuotedString(withCheckRaw) : void 0;\n\tconst permissiveRaw = readValueParam(block, \"permissive\");\n\tif (permissiveRaw !== void 0 && permissiveRaw !== \"true\" && permissiveRaw !== \"false\") {\n\t\tctx.diagnostics?.push({\n\t\t\tcode: PSL_EXTENSION_INVALID_VALUE,\n\t\t\tmessage: `\\`${block.keyword}\\` policy \"${block.name}\" \\`permissive\\` must be \\`true\\` or \\`false\\`, got ${permissiveRaw}.`,\n\t\t\tsourceId: ctx.sourceId ?? \"unknown\",\n\t\t\tspan: block.parameters[\"permissive\"]?.span ?? block.span\n\t\t});\n\t\treturn;\n\t}\n\tconst permissive = permissiveRaw !== \"false\";\n\tconst mapAttr = block.attributes[\"map\"];\n\tif (mapAttr !== void 0) {\n\t\tconst exactName = mapAttr.args[\"name\"];\n\t\tinvariant(typeof exactName === \"string\", \"@@map on a policy block parses one string argument\");\n\t\tctx.warnings?.push(exactNameBodyWarning(\"policy\", exactName));\n\t\treturn new PostgresRlsPolicy({\n\t\t\tnaming: {\n\t\t\t\tkind: \"exact\",\n\t\t\t\tname: exactName\n\t\t\t},\n\t\t\ttableName,\n\t\t\tnamespaceId: block.namespaceId,\n\t\t\toperation,\n\t\t\troles,\n\t\t\tusing,\n\t\t\twithCheck,\n\t\t\tpermissive\n\t\t});\n\t}\n\treturn buildRlsPolicyEntity({\n\t\tprefix,\n\t\ttableName,\n\t\tnamespaceId: block.namespaceId,\n\t\toperation,\n\t\troles,\n\t\t...ifDefined(\"using\", using),\n\t\t...ifDefined(\"withCheck\", withCheck),\n\t\tpermissive\n\t});\n}\n/**\n* Lowers a `native_enum { memberName = \"value\" … @@map(\"type_name\") }` block\n* into a {@link PostgresNativeEnum}. Members must be authored as explicit\n* `key = \"value\"` pairs — a bare (value-less) member is a diagnostic, not\n* accepted (authoring-design.md §2.1). The parsed `memberName` is only used\n* to duplicate-check and report diagnostics; the lowered entity carries just\n* the member values (a native enum is value-only — the member \"name\" isn't\n* a separate authoring concept from the value). `typeName` comes from\n* `@@map` or defaults to the block name verbatim.\n*/\nfunction lowerNativeEnumFromBlock(block, ctx) {\n\tconst sourceId = ctx.sourceId ?? \"unknown\";\n\tconst diagnostics = ctx.diagnostics;\n\tconst mapAttr = block.attributes[\"map\"];\n\tlet typeName = block.name;\n\tif (mapAttr !== void 0) {\n\t\tconst mapped = mapAttr.args[\"name\"];\n\t\tinvariant(typeof mapped === \"string\", \"@@map on a native_enum block parses one string argument\");\n\t\ttypeName = mapped;\n\t}\n\tlet memberError = false;\n\tconst seenValues = /* @__PURE__ */ new Set();\n\tconst members = [];\n\tfor (const [memberName, paramValue] of Object.entries(block.parameters)) {\n\t\tif (paramValue.kind === \"bare\") {\n\t\t\tdiagnostics?.push({\n\t\t\t\tcode: PSL_NATIVE_ENUM_BARE_MEMBER,\n\t\t\t\tmessage: `native_enum \"${block.name}\" member \"${memberName}\" has no value; members must be authored as \"${memberName} = \\\\\"value\\\\\"\"`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: paramValue.span\n\t\t\t});\n\t\t\tmemberError = true;\n\t\t\tcontinue;\n\t\t}\n\t\tif (paramValue.kind !== \"value\") continue;\n\t\tlet jsonValue;\n\t\ttry {\n\t\t\tjsonValue = JSON.parse(paramValue.raw);\n\t\t} catch {\n\t\t\tdiagnostics?.push({\n\t\t\t\tcode: PSL_EXTENSION_INVALID_VALUE,\n\t\t\t\tmessage: `native_enum \"${block.name}\" member \"${memberName}\" value \"${paramValue.raw}\" is not valid JSON`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: paramValue.span\n\t\t\t});\n\t\t\tmemberError = true;\n\t\t\tcontinue;\n\t\t}\n\t\tif (typeof jsonValue !== \"string\") {\n\t\t\tdiagnostics?.push({\n\t\t\t\tcode: PSL_EXTENSION_INVALID_VALUE,\n\t\t\t\tmessage: `native_enum \"${block.name}\" member \"${memberName}\" value must be a string`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: paramValue.span\n\t\t\t});\n\t\t\tmemberError = true;\n\t\t\tcontinue;\n\t\t}\n\t\tif (seenValues.has(jsonValue)) {\n\t\t\tdiagnostics?.push({\n\t\t\t\tcode: PSL_NATIVE_ENUM_DUPLICATE_MEMBER_VALUE,\n\t\t\t\tmessage: `native_enum \"${block.name}\": duplicate member value \"${jsonValue}\"`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: paramValue.span\n\t\t\t});\n\t\t\tmemberError = true;\n\t\t\tcontinue;\n\t\t}\n\t\tseenValues.add(jsonValue);\n\t\tmembers.push(jsonValue);\n\t}\n\tif (memberError) return void 0;\n\tif (members.length === 0) {\n\t\tdiagnostics?.push({\n\t\t\tcode: PSL_NATIVE_ENUM_MISSING_MEMBERS,\n\t\t\tmessage: `native_enum \"${block.name}\" must have at least one member`,\n\t\t\tsourceId,\n\t\t\tspan: block.span\n\t\t});\n\t\treturn;\n\t}\n\treturn new PostgresNativeEnum({\n\t\ttypeName,\n\t\tmembers\n\t});\n}\n/**\n* `native_enum`'s entity-type factory output, checked separately from the assembled\n* `postgresAuthoringEntityTypes` map below: `deriveValueSet` is SQL-family surface\n* ({@link SqlValueSetDerivingEntityTypeOutput}), not part of the framework\n* `AuthoringEntityTypeFactoryOutput` shape, so folding it directly into the map's single\n* `satisfies AuthoringEntityTypeNamespace` check would trip an excess-property error. Checking it\n* here against the intersection of both shapes keeps it structurally valid against each without\n* widening the map's own check.\n*/\nconst nativeEnumEntityTypeOutput = {\n\tfactory: lowerNativeEnumFromBlock,\n\tderiveValueSet: (entity) => ({\n\t\tkind: \"valueSet\",\n\t\tvalues: [...entity.members]\n\t})\n};\n/**\n* Lowers a `role <name> {}` block into a {@link PostgresRole}. Roles are\n* cluster-scoped in Postgres, so the block must be declared inside\n* `namespace unbound { … }` — any other lexical namespace (a named schema,\n* or the default bucket top-level declarations resolve to) is a load-time\n* diagnostic. The lowered entity carries the unbound coordinate.\n*/\nfunction lowerRoleFromBlock(block, ctx) {\n\tif (block.namespaceId !== UNBOUND_NAMESPACE_ID) {\n\t\tctx.diagnostics?.push({\n\t\t\tcode: PSL_ROLE_BLOCK_OUTSIDE_UNBOUND_NAMESPACE,\n\t\t\tmessage: `\\`role\\` block \"${block.name}\" must be declared inside \\`namespace unbound { }\\`, not in namespace \"${block.namespaceId}\"`,\n\t\t\tsourceId: ctx.sourceId ?? \"unknown\",\n\t\t\tspan: block.span\n\t\t});\n\t\treturn;\n\t}\n\treturn new PostgresRole({\n\t\tname: block.name,\n\t\tnamespaceId: UNBOUND_NAMESPACE_ID\n\t});\n}\nconst postgresAuthoringEntityTypes = {\n\trole: {\n\t\tkind: \"entity\",\n\t\tdiscriminator: \"role\",\n\t\tvalidatorSchema: PostgresRoleSchema,\n\t\toutput: { factory: lowerRoleFromBlock }\n\t},\n\trls: {\n\t\tkind: \"entity\",\n\t\tdiscriminator: \"rls\",\n\t\tvalidatorSchema: PostgresRlsEnablementSchema,\n\t\toutput: { factory: (input) => new PostgresRlsEnablement(input) }\n\t},\n\tpolicy: {\n\t\tkind: \"entity\",\n\t\tdiscriminator: \"policy\",\n\t\tvalidatorSchema: PostgresRlsPolicySchema,\n\t\toutput: { factory: lowerRlsPolicyFromBlock }\n\t},\n\tnative_enum: {\n\t\tkind: \"entity\",\n\t\tdiscriminator: \"native_enum\",\n\t\tvalidatorSchema: PostgresNativeEnumSchema,\n\t\toutput: nativeEnumEntityTypeOutput\n\t}\n};\n/**\n* Field presets contributed by the Postgres target pack.\n*\n* These mirror the PSL scalar-to-codec mapping used by the Postgres adapter\n* (see `createPostgresPslScalarTypeDescriptors`), so that authoring a field\n* via the TS callback surface (e.g. `field.int()`) and via the PSL scalar\n* surface (e.g. `Int`) lowers to byte-identical contracts.\n*\n* The `uuidNative` / `id.uuidv4Native` / `id.uuidv7Native` presets use the\n* native Postgres `uuid` type (codecId `pg/uuid@1`). For cross-target\n* portability use `uuidString` / `id.uuidv4String` / `id.uuidv7String` from\n* the family pack instead.\n*/\n/**\n* Shared parameter descriptors for the five `policy_<op>` PSL block\n* keywords. All five share the `policy` discriminator — the parser\n* dispatches by keyword (see the framework's PSL-block SPI), and every\n* keyword's factory lowers to `PostgresRlsPolicy` via `lowerRlsPolicyFromBlock`.\n*\n* The `roles` list uses `scope:'cross-space'` because same-namespace\n* role ref resolution requires PSL namespace entries keyed by `refKind`\n* (i.e. `'role'`), which in turn requires the role block discriminator to\n* equal `'role'`. Aligning discriminator with refKind is tracked for\n* slice 4 (cross-space roles). Until then cross-space passes validation\n* unconditionally and the authored role names flow through unchanged.\n*/\nconst policyTargetParam = {\n\tkind: \"ref\",\n\tdocumentation: \"The model protected by this policy; it must declare @@rls.\",\n\trefKind: \"model\",\n\tscope: \"same-namespace\",\n\trequired: true\n};\nconst policyRolesParam = {\n\tkind: \"list\",\n\tdocumentation: \"The database roles to which this policy applies.\",\n\tof: {\n\t\tkind: \"ref\",\n\t\trefKind: \"role\",\n\t\tscope: \"cross-space\"\n\t}\n};\nconst policyPredicateParam = {\n\tkind: \"value\",\n\tcodecId: \"pg/text@1\",\n\trequired: true,\n\tdocumentation: \"A SQL predicate controlling which rows this policy permits.\"\n};\nconst policyPermissiveParam = {\n\tkind: \"value\",\n\tcodecId: \"pg/bool@1\",\n\tdocumentation: \"Whether the policy is permissive (combined with OR) rather than restrictive (combined with AND).\"\n};\nconst policyRequiresRls = {\n\tparameter: \"target\",\n\tattribute: \"rls\"\n};\nconst policyMapAttribute = blockAttribute(\"map\", {\n\tdocumentation: \"Maps this row-level security policy to its PostgreSQL policy name.\",\n\tpositional: [{\n\t\tkey: \"name\",\n\t\ttype: str(),\n\t\tdocumentation: \"The nonempty PostgreSQL policy name.\"\n\t}],\n\trefine: (parsed, ctx, attributeNode) => parsed.name === \"\" ? [leafDiagnostic(ctx, attributeNode, \"@@map policy name must be a non-empty string\", PSL_POLICY_INVALID_MAP)] : []\n});\nconst policyBlockAttributes = { map: () => policyMapAttribute };\nconst nativeEnumMapAttribute = blockAttribute(\"map\", {\n\tdocumentation: \"Maps this native enum to its PostgreSQL type name.\",\n\tpositional: [{\n\t\tkey: \"name\",\n\t\ttype: str(),\n\t\tdocumentation: \"The PostgreSQL enum type name.\"\n\t}]\n});\nconst postgresAuthoringPslBlockDescriptors = {\n\tpolicy_select: {\n\t\tkind: \"pslBlock\",\n\t\tkeyword: \"policy_select\",\n\t\tdocumentation: \"Defines a row-level security policy controlling which rows can be selected.\",\n\t\tdiscriminator: \"policy\",\n\t\tname: { required: true },\n\t\tparameters: {\n\t\t\ttarget: policyTargetParam,\n\t\t\troles: policyRolesParam,\n\t\t\tusing: policyPredicateParam,\n\t\t\tpermissive: policyPermissiveParam\n\t\t},\n\t\trequiresModelAttribute: policyRequiresRls,\n\t\tattributes: policyBlockAttributes\n\t},\n\tpolicy_delete: {\n\t\tkind: \"pslBlock\",\n\t\tkeyword: \"policy_delete\",\n\t\tdocumentation: \"Defines a row-level security policy controlling which rows can be deleted.\",\n\t\tdiscriminator: \"policy\",\n\t\tname: { required: true },\n\t\tparameters: {\n\t\t\ttarget: policyTargetParam,\n\t\t\troles: policyRolesParam,\n\t\t\tusing: policyPredicateParam,\n\t\t\tpermissive: policyPermissiveParam\n\t\t},\n\t\trequiresModelAttribute: policyRequiresRls,\n\t\tattributes: policyBlockAttributes\n\t},\n\tpolicy_insert: {\n\t\tkind: \"pslBlock\",\n\t\tkeyword: \"policy_insert\",\n\t\tdocumentation: \"Defines a row-level security policy checking rows being inserted.\",\n\t\tdiscriminator: \"policy\",\n\t\tname: { required: true },\n\t\tparameters: {\n\t\t\ttarget: policyTargetParam,\n\t\t\troles: policyRolesParam,\n\t\t\twithCheck: policyPredicateParam,\n\t\t\tpermissive: policyPermissiveParam\n\t\t},\n\t\trequiresModelAttribute: policyRequiresRls,\n\t\tattributes: policyBlockAttributes\n\t},\n\tpolicy_update: {\n\t\tkind: \"pslBlock\",\n\t\tkeyword: \"policy_update\",\n\t\tdocumentation: \"Defines a row-level security policy controlling row visibility and checks for updates.\",\n\t\tdiscriminator: \"policy\",\n\t\tname: { required: true },\n\t\tparameters: {\n\t\t\ttarget: policyTargetParam,\n\t\t\troles: policyRolesParam,\n\t\t\tusing: policyPredicateParam,\n\t\t\twithCheck: policyPredicateParam,\n\t\t\tpermissive: policyPermissiveParam\n\t\t},\n\t\trequiresModelAttribute: policyRequiresRls,\n\t\tattributes: policyBlockAttributes\n\t},\n\tpolicy_all: {\n\t\tkind: \"pslBlock\",\n\t\tkeyword: \"policy_all\",\n\t\tdocumentation: \"Defines a row-level security policy applying to all operations.\",\n\t\tdiscriminator: \"policy\",\n\t\tname: { required: true },\n\t\tparameters: {\n\t\t\ttarget: policyTargetParam,\n\t\t\troles: policyRolesParam,\n\t\t\tusing: policyPredicateParam,\n\t\t\twithCheck: policyPredicateParam,\n\t\t\tpermissive: policyPermissiveParam\n\t\t},\n\t\trequiresModelAttribute: policyRequiresRls,\n\t\tattributes: policyBlockAttributes\n\t},\n\t/**\n\t* PSL block descriptor for `native_enum`.\n\t*\n\t* Reuses the existing variadic-block mechanism (the same shape the SQL\n\t* family's `enum` block ships): the body is an open `memberName = \"value\"`\n\t* list. `variadicParameters: true` opens the block to arbitrary keys\n\t* beyond the declared (empty) `parameters` set — the lowering factory\n\t* (`lowerNativeEnumFromBlock`) turns the variadic entries into ordered\n\t* members and rejects a bare (value-less) member.\n\t*/\n\tnative_enum: {\n\t\tkind: \"pslBlock\",\n\t\tkeyword: \"native_enum\",\n\t\tdocumentation: \"Defines a PostgreSQL enum type with named string-valued members.\",\n\t\tdiscriminator: \"native_enum\",\n\t\tname: { required: true },\n\t\tparameters: {},\n\t\tvariadicParameters: true,\n\t\tattributes: { map: () => nativeEnumMapAttribute }\n\t},\n\t/**\n\t* PSL block descriptor for `role` (e.g. `role anon {}`). Name-only, no\n\t* parameters and no body content. Declared inside `namespace unbound { }`\n\t* — see {@link lowerRoleFromBlock} for the placement check and the\n\t* coordinate the lowered entity carries.\n\t*/\n\trole: {\n\t\tkind: \"pslBlock\",\n\t\tkeyword: \"role\",\n\t\tdocumentation: \"Declares an existing database role in namespace unbound for use in security policies.\",\n\t\tdiscriminator: \"role\",\n\t\tname: { required: true },\n\t\tparameters: {}\n\t}\n};\nconst postgresRlsSpec = modelAttribute(\"rls\", { documentation: \"Enables PostgreSQL row-level security on this model’s table.\" });\nconst postgresRlsSpecFactory = () => postgresRlsSpec;\n/**\n* `@@` model attributes contributed by the Postgres target pack.\n*\n* `@@rls` is argument-less: presence marks the model's table\n* RLS-controlled. It lowers to a {@link PostgresRlsEnablement} marker in\n* the namespace's `entries.rls`, keyed by the model's table name — the\n* marker (never the policy set) is what drives\n* `ENABLE`/`DISABLE ROW LEVEL SECURITY` planning.\n*/\nconst postgresAuthoringModelAttributes = { rls: {\n\tkind: \"modelAttribute\",\n\tattribute: \"rls\",\n\tspec: postgresRlsSpecFactory,\n\tlower: (_parsed, ctx) => ({\n\t\tkey: ctx.storageName,\n\t\tentity: new PostgresRlsEnablement({\n\t\t\ttableName: ctx.storageName,\n\t\t\tnamespaceId: ctx.namespaceId\n\t\t})\n\t})\n} };\nconst postgresAuthoringFieldPresets = {\n\ttext: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/text@1\",\n\t\t\tnativeType: \"text\"\n\t\t}\n\t},\n\tint: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/int4@1\",\n\t\t\tnativeType: \"int4\"\n\t\t}\n\t},\n\tbigint: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/int8@1\",\n\t\t\tnativeType: \"int8\"\n\t\t}\n\t},\n\tfloat: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/float8@1\",\n\t\t\tnativeType: \"float8\"\n\t\t}\n\t},\n\tdecimal: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/numeric@1\",\n\t\t\tnativeType: \"numeric\"\n\t\t}\n\t},\n\tboolean: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/bool@1\",\n\t\t\tnativeType: \"bool\"\n\t\t}\n\t},\n\tjson: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/jsonb@1\",\n\t\t\tnativeType: \"jsonb\"\n\t\t}\n\t},\n\tbytes: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/bytea@1\",\n\t\t\tnativeType: \"bytea\"\n\t\t}\n\t},\n\tdateTime: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/timestamptz-temporal@1\",\n\t\t\tnativeType: \"timestamptz\"\n\t\t}\n\t},\n\ttemporal: {\n\t\tcreatedAtJsDate: (/* @__PURE__ */ temporalAuthoringPresets({\n\t\t\tcodecId: PG_TIMESTAMPTZ_DATE_CODEC_ID,\n\t\t\tnativeType: \"timestamptz\",\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIMESTAMPTZ_DATE_CODEC_ID]\n\t\t})).createdAt,\n\t\tupdatedAtJsDate: (/* @__PURE__ */ temporalAuthoringPresets({\n\t\t\tcodecId: PG_TIMESTAMPTZ_DATE_CODEC_ID,\n\t\t\tnativeType: \"timestamptz\",\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIMESTAMPTZ_DATE_CODEC_ID]\n\t\t})).updatedAt,\n\t\ttimestamptzJsDate: /* @__PURE__ */ temporalCodecPresetWithPrecision({\n\t\t\tcodecId: PG_TIMESTAMPTZ_DATE_CODEC_ID,\n\t\t\tnativeType: \"timestamptz\",\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIMESTAMPTZ_DATE_CODEC_ID]\n\t\t}),\n\t\t.../* @__PURE__ */ temporalAuthoringPresets({\n\t\t\tcodecId: PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID,\n\t\t\tnativeType: \"timestamptz\",\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID]\n\t\t}),\n\t\t.../* @__PURE__ */ temporalStringAuthoringPresets({\n\t\t\tcodecId: PG_TIMESTAMPTZ_STRING_CODEC_ID,\n\t\t\tnativeType: \"timestamptz\",\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIMESTAMPTZ_STRING_CODEC_ID]\n\t\t}),\n\t\ttimestamp: /* @__PURE__ */ temporalCodecPresetWithPrecision({\n\t\t\tcodecId: PG_TIMESTAMP_TEMPORAL_CODEC_ID,\n\t\t\tnativeType: \"timestamp\",\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIMESTAMP_TEMPORAL_CODEC_ID]\n\t\t}),\n\t\ttimestamptz: /* @__PURE__ */ temporalCodecPresetWithPrecision({\n\t\t\tcodecId: PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID,\n\t\t\tnativeType: \"timestamptz\",\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID]\n\t\t}),\n\t\ttimestampString: /* @__PURE__ */ temporalCodecPresetWithPrecision({\n\t\t\tcodecId: PG_TIMESTAMP_STRING_CODEC_ID,\n\t\t\tnativeType: \"timestamp\",\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIMESTAMP_STRING_CODEC_ID]\n\t\t}),\n\t\ttimestamptzString: /* @__PURE__ */ temporalCodecPresetWithPrecision({\n\t\t\tcodecId: PG_TIMESTAMPTZ_STRING_CODEC_ID,\n\t\t\tnativeType: \"timestamptz\",\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIMESTAMPTZ_STRING_CODEC_ID]\n\t\t})\n\t},\n\tuuidNative: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/uuid@1\",\n\t\t\tnativeType: \"uuid\"\n\t\t}\n\t},\n\tid: {\n\t\tuuidv4Native: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId: \"pg/uuid@1\",\n\t\t\t\tnativeType: \"uuid\",\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\tuuidv7Native: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId: \"pg/uuid@1\",\n\t\t\t\tnativeType: \"uuid\",\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}\n};\n/**\n* Resolves an entity handle's `target` ref to a table coordinate of this\n* contract, or throws the load-time diagnostic naming the handle: a\n* cross-space target is rejected (you cannot CREATE POLICY on a table\n* another space owns) and an unresolved target names the model.\n*/\nfunction requireLocalTarget(refs, subject) {\n\tconst target = refs[\"target\"];\n\tif (target !== void 0 && target.kind === \"resolved\") return {\n\t\tnamespaceId: target.namespaceId,\n\t\ttableName: target.tableName\n\t};\n\tif (target !== void 0 && target.kind === \"cross-space\") throw postgresError(\"CONTRACT.POLICY_INVALID\", `defineContract: ${subject} targets model \"${target.modelName ?? target.tableName}\", which lives in another contract space. Policies and rlsEnabled entries must target a model declared in this contract.`, { meta: {\n\t\tmodel: target.modelName ?? target.tableName,\n\t\treason: \"cross-space-target\"\n\t} });\n\tthrow postgresError(\"CONTRACT.MODEL_UNKNOWN\", `defineContract: ${subject} targets model \"${target?.modelName ?? \"<anonymous>\"}\", which is not in the contract's models. Add the model to \\`models\\`.`, { meta: { model: target?.modelName ?? \"<anonymous>\" } });\n}\n/**\n* The SQL-family entity-handle batch lowering hook for the Postgres pack\n* (`SqlEntityHandleLoweringContribution`). Receives every `entities` handle\n* whose kind this pack registered — batch, so the cross-entity diagnostics\n* (duplicate prefix, policy without rlsEnabled, duplicate role) can see\n* sibling handles — and lowers them with the same keying and hash assembly\n* as the PSL path: `policy` keyed by prefix (wire name via\n* {@link buildRlsPolicyEntity}), `rls` keyed by table name, `role` keyed by\n* name and filed under the default namespace (roles are declared\n* contract-wide; PSL has no role block to set a precedent).\n*/\nfunction postgresLowerEntityHandles(input) {\n\tconst enablements = /* @__PURE__ */ new Map();\n\tconst roles = /* @__PURE__ */ new Map();\n\tconst policies = [];\n\tconst coordinateKey = (coordinate) => `${coordinate.namespaceId} ${coordinate.tableName}`;\n\tfor (const { handle, refs } of input.handles) switch (handle.entityKind) {\n\t\tcase \"rls\": {\n\t\t\tconst coordinate = requireLocalTarget(refs, \"an rlsEnabled entry\");\n\t\t\tconst key = coordinateKey(coordinate);\n\t\t\tif (!enablements.has(key)) enablements.set(key, {\n\t\t\t\tcoordinate,\n\t\t\t\tentity: new PostgresRlsEnablement({\n\t\t\t\t\ttableName: coordinate.tableName,\n\t\t\t\t\tnamespaceId: coordinate.namespaceId\n\t\t\t\t})\n\t\t\t});\n\t\t\tbreak;\n\t\t}\n\t\tcase \"role\": {\n\t\t\tconst roleHandle = blindCast(handle);\n\t\t\tif (roles.has(roleHandle.name)) throw postgresError(\"CONTRACT.ROLE_INVALID\", `defineContract: role \"${roleHandle.name}\" is declared more than once in the entities list.`, { meta: {\n\t\t\t\trole: roleHandle.name,\n\t\t\t\treason: \"duplicate\"\n\t\t\t} });\n\t\t\troles.set(roleHandle.name, new PostgresRole({\n\t\t\t\tname: roleHandle.name,\n\t\t\t\tnamespaceId: UNBOUND_NAMESPACE_ID\n\t\t\t}));\n\t\t\tbreak;\n\t\t}\n\t\tcase \"policy\": {\n\t\t\tconst policyHandle = blindCast(handle);\n\t\t\tpolicies.push({\n\t\t\t\thandle: policyHandle,\n\t\t\t\trefs\n\t\t\t});\n\t\t\tbreak;\n\t\t}\n\t\tdefault: throw postgresError(\"CONTRACT.ENTITY_KIND_INVALID\", `defineContract: the postgres pack does not lower \"${handle.entityKind}\" handles from the entities list.`, { meta: { entityKind: handle.entityKind } });\n\t}\n\tconst rows = [];\n\tconst seenPrefixes = /* @__PURE__ */ new Set();\n\tfor (const { handle: policy, refs } of policies) {\n\t\tconst prefix = policy.name;\n\t\tassertWireNamePrefixLength(prefix, \"defineContract: policy prefix\");\n\t\tconst coordinate = requireLocalTarget(refs, `policy \"${prefix}\"`);\n\t\tif (!enablements.has(coordinateKey(coordinate))) {\n\t\t\tconst target = refs[\"target\"];\n\t\t\tthrow postgresError(\"CONTRACT.POLICY_INVALID\", `defineContract: policy \"${prefix}\" targets model \"${target?.modelName ?? coordinate.tableName}\", whose table is not RLS-enabled. Add rlsEnabled(<model>) to the entities list.`, { meta: {\n\t\t\t\tprefix,\n\t\t\t\tmodel: target?.modelName ?? coordinate.tableName,\n\t\t\t\treason: \"target-not-rls-enabled\"\n\t\t\t} });\n\t\t}\n\t\tconst prefixKey = `${coordinate.namespaceId} ${prefix}`;\n\t\tif (seenPrefixes.has(prefixKey)) throw postgresError(\"CONTRACT.POLICY_INVALID\", `defineContract: policy prefix \"${prefix}\" is declared more than once in namespace \"${coordinate.namespaceId}\". Policy prefixes must be unique per namespace.`, { meta: {\n\t\t\tprefix,\n\t\t\tnamespaceId: coordinate.namespaceId,\n\t\t\treason: \"duplicate-prefix\"\n\t\t} });\n\t\tseenPrefixes.add(prefixKey);\n\t\tconst roleNames = [...new Set(policy.roles.map((roleHandle) => roleHandle.name))].sort();\n\t\trows.push({\n\t\t\tnamespaceId: coordinate.namespaceId,\n\t\t\tentityKind: \"policy\",\n\t\t\tkey: prefix,\n\t\t\tentity: buildRlsPolicyEntity({\n\t\t\t\tprefix,\n\t\t\t\ttableName: coordinate.tableName,\n\t\t\t\tnamespaceId: coordinate.namespaceId,\n\t\t\t\toperation: policy.operation,\n\t\t\t\troles: roleNames,\n\t\t\t\t...ifDefined(\"using\", policy.using),\n\t\t\t\t...ifDefined(\"withCheck\", policy.withCheck)\n\t\t\t})\n\t\t});\n\t}\n\tfor (const { coordinate, entity } of enablements.values()) rows.push({\n\t\tnamespaceId: coordinate.namespaceId,\n\t\tentityKind: \"rls\",\n\t\tkey: coordinate.tableName,\n\t\tentity\n\t});\n\tfor (const [name, entity] of roles) rows.push({\n\t\tnamespaceId: UNBOUND_NAMESPACE_ID,\n\t\tentityKind: \"role\",\n\t\tkey: name,\n\t\tentity\n\t});\n\treturn rows;\n}\n//#endregion\nexport { postgresAuthoringTypes as a, PLAIN_DATE_TIME_NOW_GENERATOR_ID as c, INSTANT_NOW_GENERATOR_ID as d, instantNow as f, postgresAuthoringPslBlockDescriptors as i, plainDateTimeNow as l, postgresAuthoringFieldPresets as n, postgresLowerEntityHandles as o, instantNowControlDescriptor as p, postgresAuthoringModelAttributes as r, postgresNowGeneratorIdFor as s, postgresAuthoringEntityTypes as t, plainDateTimeNowControlDescriptor as u };\n\n//# sourceMappingURL=authoring-DhCDnK1T.mjs.map"],"mappings":";;;;;;;;;;;;;;AAcA,MAAM,2BAA2B;AACjC,SAAS,8BAA8B;CACtC,OAAO;EACN,IAAI;EACJ,oBAAoB;GACnB,UAAU;IACT,MAAM;IACN,IAAI;GACL;GACA,UAAU;IACT,MAAM;IACN,IAAI;GACL;EACD;CACD;AACD;AACA,SAAS,aAAa;CACrB,IAAI,OAAO,aAAa,aAAa,MAAM,mCAAmC,wBAAwB;CACtG,OAAO,SAAS,IAAI,QAAQ;AAC7B;;;;;;AAQA,MAAM,mCAAmC;AACzC,SAAS,oCAAoC;CAC5C,OAAO;EACN,IAAI;EACJ,oBAAoB;GACnB,UAAU;IACT,MAAM;IACN,IAAI;GACL;GACA,UAAU;IACT,MAAM;IACN,IAAI;GACL;EACD;CACD;AACD;AACA,SAAS,mBAAmB;CAC3B,IAAI,OAAO,aAAa,aAAa,MAAM,mCAAmC,gCAAgC;CAC9G,OAAO,SAAS,IAAI,iBAAiB,KAAK;AAC3C;;AAIA,MAAM,0BAA0B;EAC9B,iCAAiC;EACjC,mCAAmC;EACnC,+BAA+B;EAC/B,+BAA+B;EAC/B,iCAAiC;AACnC;AACA,MAAM,0BAA0B,IAAI,IAAI,OAAO,QAAQ,uBAAuB,CAAC;AAC/E,SAAS,0BAA0B,SAAS;CAC3C,OAAO,wBAAwB,IAAI,OAAO;AAC3C;AAGA,MAAM,sCAAsC;AAC5C,MAAM,yBAAyB;AAC/B,MAA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,UAAU,aAAa,OAAO,SAAS;GAC3C,CAAC;EACF,CAAC;CACF;CACA,KAAK,MAAM,EAAE,YAAY,YAAY,YAAY,OAAO,GAAG,KAAK,KAAK;EACpE,aAAa,WAAW;EACxB,YAAY;EACZ,KAAK,WAAW;EAChB;CACD,CAAC;CACD,KAAK,MAAM,CAAC,MAAM,WAAW,OAAO,KAAK,KAAK;EAC7C,aAAa;EACb,YAAY;EACZ,KAAK;EACL;CACD,CAAC;CACD,OAAO;AACR"}
@@ -1,12 +1,12 @@
1
1
  import { s as postgresError } from "./errors-DYyzTYzE-39CV_aMo.mjs";
2
2
  import { n as postgresResolveDefault } from "./default-normalizer-Bjtm2F4f-uV5vvkVt.mjs";
3
- import { t as postgresTargetDescriptorMeta } from "./descriptor-meta-CQBdvIPG-CN3m2xcT.mjs";
3
+ import { t as postgresTargetDescriptorMeta } from "./descriptor-meta-CQMRNeLX-CF4MvmN_.mjs";
4
4
  import { a as postgresDiffSubjectGranularity, i as postgresDiffSubjectEntityKind } from "./postgres-table-schema-node-BBkitBQh-DT1T5VWU.mjs";
5
5
  import { t as PostgresDatabaseSchemaNode } from "./postgres-role-schema-node-B8Z5i5D--PObwlU2Z.mjs";
6
6
  import { r as renderDefaultLiteral } from "./planner-ddl-builders-CpXQ-J0X-CL5gNUSG.mjs";
7
7
  import { n as contractToPostgresDatabaseSchemaNode, r as diffPostgresSchema } from "./diff-database-schema-BFX0ZWWK-KVfAPOLF.mjs";
8
- import { t as PostgresContractSerializer } from "./postgres-contract-view-CmLEo6wf-DYBBFFMK.mjs";
9
- import { t as createPostgresMigrationPlanner } from "./planner-CeYeEGDy-UmNDGNc2.mjs";
8
+ import { t as PostgresContractSerializer } from "./postgres-contract-view-BPe8r8jN-DrorQoWW.mjs";
9
+ import { t as createPostgresMigrationPlanner } from "./planner-C_TrM6kn-Dj1rgql2.mjs";
10
10
  import { i as inferPostgresPslContract } from "./infer-psl-contract-BaZaJAD9-DTVu5Zab.mjs";
11
11
  import { blindCast } from "@prisma/orm-framework/utils/casts";
12
12
  import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
@@ -467,4 +467,4 @@ const postgresTargetDescriptor = {
467
467
  //#endregion
468
468
  export { postgresTargetDescriptor as n, postgresRenderDefault as t };
469
469
 
470
- //# sourceMappingURL=control-BQHKNZ5z.mjs.map
470
+ //# sourceMappingURL=control-DDfLaDsG.mjs.map