@prisma/orm-target-postgres 8.0.0-rc.18-dev.42 → 8.0.0-rc.18-dev.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{adapter-BLduF4bR-Bnd8oPWE.mjs → adapter-BLduF4bR-clgZ076o.mjs} +2 -2
- package/dist/{adapter-BLduF4bR-Bnd8oPWE.mjs.map → adapter-BLduF4bR-clgZ076o.mjs.map} +1 -1
- package/dist/{adapter-JqZEnHVH.d.mts → adapter-Cx1Ba9Lc.d.mts} +10 -10
- package/dist/{adapter-JqZEnHVH.d.mts.map → adapter-Cx1Ba9Lc.d.mts.map} +1 -1
- package/dist/adapter.d.mts +2 -2
- package/dist/adapter.mjs +3 -3
- package/dist/adapter__adapter.d.mts +1 -1
- package/dist/adapter__adapter.mjs +2 -2
- package/dist/adapter__column-types.d.mts +1 -1
- package/dist/adapter__column-types.mjs +1 -1
- package/dist/adapter__control.mjs +3 -3
- package/dist/adapter__runtime.mjs +3 -3
- package/dist/{aggregates-CqTCv6q_.d.mts → aggregates-B3lIBjGK.d.mts} +10 -10
- package/dist/{aggregates-CqTCv6q_.d.mts.map → aggregates-B3lIBjGK.d.mts.map} +1 -1
- package/dist/{authoring-BJs31CHI-CSs9fBRb.mjs → authoring-NKZZKf0m-aFhCcgbc.mjs} +385 -4
- package/dist/authoring-NKZZKf0m-aFhCcgbc.mjs.map +1 -0
- package/dist/{column-types-5nUQfQFq.mjs → column-types-CI9_dRcU.mjs} +6 -4
- package/dist/column-types-CI9_dRcU.mjs.map +1 -0
- package/dist/{column-types-D4U5xGjS.d.mts → column-types-KP17SDia.d.mts} +5 -4
- package/dist/column-types-KP17SDia.d.mts.map +1 -0
- package/dist/{contract-contributions-CRCEK7Dx-DCityp0q.mjs → contract-contributions-CRCEK7Dx-DQWxpLgr.mjs} +2 -2
- package/dist/{contract-contributions-CRCEK7Dx-DCityp0q.mjs.map → contract-contributions-CRCEK7Dx-DQWxpLgr.mjs.map} +1 -1
- package/dist/{control-BRE_BcLl.d.mts → control-C6XU7Guz.d.mts} +61 -61
- package/dist/{control-BRE_BcLl.d.mts.map → control-C6XU7Guz.d.mts.map} +1 -1
- package/dist/{control-policy-r-CuRLXc-VyOsI026.mjs → control-policy-XDdMfbBp-Bf5qOmWS.mjs} +4 -4
- package/dist/{control-policy-r-CuRLXc-VyOsI026.mjs.map → control-policy-XDdMfbBp-Bf5qOmWS.mjs.map} +1 -1
- package/dist/{data-transform-CtHnNYhF-r19375h3.mjs → data-transform-h9agBu_c-B5dsDs8G.mjs} +2 -2
- package/dist/{data-transform-CtHnNYhF-r19375h3.mjs.map → data-transform-h9agBu_c-B5dsDs8G.mjs.map} +1 -1
- package/dist/{descriptor-meta-Cb7RcgEQ-5-Uylp7o.mjs → descriptor-meta-Cb7RcgEQ-qfcXndlR.mjs} +2 -2
- package/dist/{descriptor-meta-Cb7RcgEQ-5-Uylp7o.mjs.map → descriptor-meta-Cb7RcgEQ-qfcXndlR.mjs.map} +1 -1
- package/dist/{descriptor-meta-CbgaTseq-Czx8dzXD.mjs → descriptor-meta-nvriPVgI-B-ZW5haL.mjs} +4 -4
- package/dist/{descriptor-meta-CbgaTseq-Czx8dzXD.mjs.map → descriptor-meta-nvriPVgI-B-ZW5haL.mjs.map} +1 -1
- package/dist/{diff-database-schema-Of2YGCSs-CZSHs0CL.mjs → diff-database-schema-BjbxFQr1-CxXB4GhI.mjs} +4 -4
- package/dist/{diff-database-schema-Of2YGCSs-CZSHs0CL.mjs.map → diff-database-schema-BjbxFQr1-CxXB4GhI.mjs.map} +1 -1
- package/dist/{diff-database-schema-Diw5m51r.d.mts → diff-database-schema-N-ftS4iF.d.mts} +2 -2
- package/dist/{diff-database-schema-Diw5m51r.d.mts.map → diff-database-schema-N-ftS4iF.d.mts.map} +1 -1
- package/dist/{type-constructors-DhJl2KPr-BlPrksrh.mjs → infer-psl-contract-CwtwKri_-Ccao-UmG.mjs} +11 -383
- package/dist/infer-psl-contract-CwtwKri_-Ccao-UmG.mjs.map +1 -0
- package/dist/{issue-planner-CAxHx3OH.d.mts → issue-planner-DYLByGrp.d.mts} +2 -2
- package/dist/{issue-planner-CAxHx3OH.d.mts.map → issue-planner-DYLByGrp.d.mts.map} +1 -1
- package/dist/migration-CbOh59ZJ.mjs.map +1 -1
- package/dist/{migration-DbAx8skF.d.mts → migration-CpHZV_Y6.d.mts} +2 -2
- package/dist/{migration-DbAx8skF.d.mts.map → migration-CpHZV_Y6.d.mts.map} +1 -1
- package/dist/{op-factory-call-DpZsI9p4-SIj8G08L.mjs → op-factory-call-B5_tnifS-BGaMVQ8g.mjs} +2 -2
- package/dist/{op-factory-call-DpZsI9p4-SIj8G08L.mjs.map → op-factory-call-B5_tnifS-BGaMVQ8g.mjs.map} +1 -1
- package/dist/{pack-CxW2-wE0.d.mts → pack-BycbuOFo.d.mts} +43 -17
- package/dist/pack-BycbuOFo.d.mts.map +1 -0
- package/dist/{planner-DVwj2GUS.d.mts → planner-BEAM0y_U.d.mts} +3 -3
- package/dist/{planner-DVwj2GUS.d.mts.map → planner-BEAM0y_U.d.mts.map} +1 -1
- package/dist/{planner-CuM-j1mN-DT5iHJie.mjs → planner-Dzp0sfa8-BQQk49Bc.mjs} +7 -7
- package/dist/{planner-CuM-j1mN-DT5iHJie.mjs.map → planner-Dzp0sfa8-BQQk49Bc.mjs.map} +1 -1
- package/dist/{planner-produced-postgres-migration-DNnxAU-R-CSPyb9D_.d.mts → planner-produced-postgres-migration-BO7M2Q-t-Dhyz9UMt.d.mts} +3 -3
- package/dist/planner-produced-postgres-migration-BO7M2Q-t-Dhyz9UMt.d.mts.map +1 -0
- package/dist/planner-produced-postgres-migration-C0Zs5NHu.d.mts +1 -0
- package/dist/{planner-produced-postgres-migration-BQOcmTK2-DKLecu3l.mjs → planner-produced-postgres-migration-HAdTAokB-mZ-CNMWW.mjs} +4 -4
- package/dist/{planner-produced-postgres-migration-BQOcmTK2-DKLecu3l.mjs.map → planner-produced-postgres-migration-HAdTAokB-mZ-CNMWW.mjs.map} +1 -1
- package/dist/{postgres-contract-view-DI-e8od--5KtL6Zcs.mjs → postgres-contract-view-BkuNbRzj-DXXkgI5Y.mjs} +3 -3
- package/dist/{postgres-contract-view-DI-e8od--5KtL6Zcs.mjs.map → postgres-contract-view-BkuNbRzj-DXXkgI5Y.mjs.map} +1 -1
- package/dist/{postgres-migration-CQ6Mbeh7-CfxjRDMT.mjs → postgres-migration-Bi7QKUYk-ed-QEmS1.mjs} +8 -8
- package/dist/{postgres-migration-CQ6Mbeh7-CfxjRDMT.mjs.map → postgres-migration-Bi7QKUYk-ed-QEmS1.mjs.map} +1 -1
- package/dist/{postgres-migration-8BDn8Wja-D9tHQGWg.d.mts → postgres-migration-CPUwTt8B-B2vE3E_r.d.mts} +2 -2
- package/dist/{postgres-migration-8BDn8Wja-D9tHQGWg.d.mts.map → postgres-migration-CPUwTt8B-B2vE3E_r.d.mts.map} +1 -1
- package/dist/{prisma7-binding-CLwKL7F1.mjs → prisma7-binding-l7PybwgY.mjs} +7 -5
- package/dist/prisma7-binding-l7PybwgY.mjs.map +1 -0
- package/dist/{prisma7-binding-nvkqr4mp.d.mts → prisma7-binding-ynOpJPog.d.mts} +45 -19
- package/dist/prisma7-binding-ynOpJPog.d.mts.map +1 -0
- package/dist/{render-ops-CT1mFD7Y-Bh7tPeTD.mjs → render-ops-DzfUHzbE-aSmN95s3.mjs} +3 -3
- package/dist/{render-ops-CT1mFD7Y-Bh7tPeTD.mjs.map → render-ops-DzfUHzbE-aSmN95s3.mjs.map} +1 -1
- package/dist/target.d.mts +11 -11
- package/dist/target.mjs +11 -12
- package/dist/target__aggregates.d.mts +1 -1
- package/dist/target__control.d.mts +1 -1
- package/dist/target__control.mjs +24 -23
- package/dist/target__control.mjs.map +1 -1
- package/dist/target__data-transform.mjs +1 -1
- package/dist/target__diff-database-schema.d.mts +1 -1
- package/dist/target__diff-database-schema.mjs +1 -1
- package/dist/target__issue-planner.d.mts +1 -1
- package/dist/target__issue-planner.mjs +1 -1
- package/dist/target__migration.d.mts +2 -2
- package/dist/target__migration.mjs +3 -3
- package/dist/target__op-factory-call.mjs +1 -1
- package/dist/target__pack.d.mts +1 -1
- package/dist/target__pack.mjs +1 -1
- package/dist/target__planner-produced-postgres-migration.d.mts +2 -2
- package/dist/target__planner-produced-postgres-migration.mjs +1 -1
- package/dist/target__planner.d.mts +1 -1
- package/dist/target__planner.mjs +2 -2
- package/dist/target__prisma7-binding.d.mts +1 -1
- package/dist/target__prisma7-binding.mjs +1 -1
- package/dist/target__render-ops.mjs +1 -1
- package/dist/target__runtime.mjs +2 -2
- package/dist/target__runtime.mjs.map +1 -1
- package/package.json +9 -9
- package/dist/authoring-BJs31CHI-CSs9fBRb.mjs.map +0 -1
- package/dist/column-types-5nUQfQFq.mjs.map +0 -1
- package/dist/column-types-D4U5xGjS.d.mts.map +0 -1
- package/dist/pack-CxW2-wE0.d.mts.map +0 -1
- package/dist/planner-produced-postgres-migration-BtS3h1R7.d.mts +0 -1
- package/dist/planner-produced-postgres-migration-DNnxAU-R-CSPyb9D_.d.mts.map +0 -1
- package/dist/prisma7-binding-CLwKL7F1.mjs.map +0 -1
- package/dist/prisma7-binding-nvkqr4mp.d.mts.map +0 -1
- package/dist/type-constructors-DhJl2KPr-BlPrksrh.mjs.map +0 -1
|
@@ -11,13 +11,13 @@ import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
|
|
|
11
11
|
import { assertDefined, invariant } from "@prisma/orm-framework/utils/assertions";
|
|
12
12
|
import { assertWireNamePrefixLength, normalizeSqlBody } from "@prisma/orm-family-sql/schema-ir/naming";
|
|
13
13
|
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
14
|
-
import { temporalCodecPresetWithPrecision, temporalStringAuthoringPresets } from "@prisma/orm-family-sql/family/
|
|
14
|
+
import { sqlTargetTypeConstructors, temporalCodecPresetWithPrecision, temporalStringAuthoringPresets } from "@prisma/orm-family-sql/family/pack";
|
|
15
15
|
import { TIMESTAMP_NOW_GENERATOR_ID, temporalAuthoringPresets, temporalCodecPreset } from "@prisma/orm-framework/components/authoring";
|
|
16
16
|
import { blockAttribute, bool, dataTypeValue, entityRef, fieldRef, identifier, leafDiagnostic, list, mapBlock, modelAttribute, oneOf, optional, str, structBlock } from "@prisma/orm-framework/psl-parser";
|
|
17
17
|
import { exactNameBodyWarning } from "@prisma/orm-family-sql/contract/index-naming";
|
|
18
18
|
import { SQL_EXPRESSION_DATA_TYPE_ID, requireSqlExpression, sqlTextFromStored } from "@prisma/orm-family-sql/contract/sql-expression";
|
|
19
19
|
import { singleGeneratorBinding } from "@prisma/orm-framework/components/components";
|
|
20
|
-
//#region ../../../3-targets/3-targets/postgres/dist/authoring-
|
|
20
|
+
//#region ../../../3-targets/3-targets/postgres/dist/authoring-NKZZKf0m.mjs
|
|
21
21
|
/**
|
|
22
22
|
* The Postgres "now" generators, one per date and time codec except `pg/timestamptz-date@1`, which uses the framework's `timestampNow`. All read the clock through `Date.now()` and write UTC. The time generators round down to their `precision` param. The string generators are named after the codec they serve and write the text PostgreSQL prints in a UTC session, with milliseconds and no trailing zeros in the fraction.
|
|
23
23
|
*/
|
|
@@ -163,6 +163,378 @@ const postgresNowGeneratorFunction = {
|
|
|
163
163
|
}
|
|
164
164
|
}))
|
|
165
165
|
};
|
|
166
|
+
/** The data type of every size argument on Postgres, such as a length or a precision: a typmod is an `int4`. */
|
|
167
|
+
const PG_SIZE_TYPE = "pg/int4";
|
|
168
|
+
/**
|
|
169
|
+
* The base PSL scalars as zero-arg type constructors in the unified authoring
|
|
170
|
+
* channel. Each names a codec; the column's database type is its data type's.
|
|
171
|
+
*
|
|
172
|
+
* The type position is the only storage decider: a mutation-default generator
|
|
173
|
+
* (`@onCreate(uuid())`) never re-picks a column's storage.
|
|
174
|
+
*/
|
|
175
|
+
const postgresScalarAuthoringTypes = {
|
|
176
|
+
String: {
|
|
177
|
+
kind: "typeConstructor",
|
|
178
|
+
inferred: true,
|
|
179
|
+
documentation: "Variable-length text stored as PostgreSQL text.",
|
|
180
|
+
output: { codecId: "pg/text@1" }
|
|
181
|
+
},
|
|
182
|
+
Boolean: {
|
|
183
|
+
kind: "typeConstructor",
|
|
184
|
+
inferred: true,
|
|
185
|
+
documentation: "A true or false value stored as PostgreSQL boolean.",
|
|
186
|
+
output: { codecId: "pg/bool@1" }
|
|
187
|
+
},
|
|
188
|
+
Int: {
|
|
189
|
+
kind: "typeConstructor",
|
|
190
|
+
inferred: true,
|
|
191
|
+
documentation: "A signed 32-bit integer represented as a JavaScript number.",
|
|
192
|
+
output: { codecId: "pg/int4@1" }
|
|
193
|
+
},
|
|
194
|
+
BigInt: {
|
|
195
|
+
kind: "typeConstructor",
|
|
196
|
+
inferred: true,
|
|
197
|
+
documentation: "A signed 64-bit integer represented as a JavaScript bigint.",
|
|
198
|
+
output: { codecId: "pg/int8@1" }
|
|
199
|
+
},
|
|
200
|
+
Float: {
|
|
201
|
+
kind: "typeConstructor",
|
|
202
|
+
inferred: true,
|
|
203
|
+
documentation: "A double-precision floating-point number.",
|
|
204
|
+
output: { codecId: "pg/float8@1" }
|
|
205
|
+
},
|
|
206
|
+
Decimal: {
|
|
207
|
+
kind: "typeConstructor",
|
|
208
|
+
documentation: "An exact decimal value stored as PostgreSQL numeric.",
|
|
209
|
+
output: { codecId: "pg/numeric@1" }
|
|
210
|
+
},
|
|
211
|
+
DateTime: {
|
|
212
|
+
kind: "typeConstructor",
|
|
213
|
+
documentation: "An instant stored as PostgreSQL timestamptz and represented as Temporal.Instant.",
|
|
214
|
+
output: { codecId: "pg/timestamptz-temporal@1" }
|
|
215
|
+
},
|
|
216
|
+
Json: {
|
|
217
|
+
kind: "typeConstructor",
|
|
218
|
+
inferred: true,
|
|
219
|
+
documentation: "A JSON value stored as PostgreSQL json.",
|
|
220
|
+
output: { codecId: "pg/json@1" }
|
|
221
|
+
},
|
|
222
|
+
Jsonb: {
|
|
223
|
+
kind: "typeConstructor",
|
|
224
|
+
inferred: true,
|
|
225
|
+
documentation: "A JSON value stored in PostgreSQL binary jsonb format.",
|
|
226
|
+
output: { codecId: "pg/jsonb@1" }
|
|
227
|
+
},
|
|
228
|
+
Bytes: {
|
|
229
|
+
kind: "typeConstructor",
|
|
230
|
+
inferred: true,
|
|
231
|
+
documentation: "Binary data stored as PostgreSQL bytea.",
|
|
232
|
+
output: { codecId: "pg/bytea@1" }
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
const postgresNativeAuthoringTypes = {
|
|
236
|
+
VarChar: {
|
|
237
|
+
kind: "typeConstructor",
|
|
238
|
+
inferred: true,
|
|
239
|
+
documentation: "Variable-length text with an optional maximum character length.",
|
|
240
|
+
args: [{
|
|
241
|
+
kind: "value",
|
|
242
|
+
dataType: PG_SIZE_TYPE,
|
|
243
|
+
name: "length",
|
|
244
|
+
optional: true
|
|
245
|
+
}],
|
|
246
|
+
output: {
|
|
247
|
+
codecId: "sql/varchar@1",
|
|
248
|
+
typeParams: { length: {
|
|
249
|
+
kind: "arg",
|
|
250
|
+
index: 0
|
|
251
|
+
} }
|
|
252
|
+
}
|
|
253
|
+
},
|
|
254
|
+
Char: {
|
|
255
|
+
kind: "typeConstructor",
|
|
256
|
+
inferred: true,
|
|
257
|
+
documentation: "Fixed-length, blank-padded text with an optional character length.",
|
|
258
|
+
args: [{
|
|
259
|
+
kind: "value",
|
|
260
|
+
dataType: PG_SIZE_TYPE,
|
|
261
|
+
name: "length",
|
|
262
|
+
optional: true
|
|
263
|
+
}],
|
|
264
|
+
output: {
|
|
265
|
+
codecId: "sql/char@1",
|
|
266
|
+
typeParams: { length: {
|
|
267
|
+
kind: "arg",
|
|
268
|
+
index: 0
|
|
269
|
+
} }
|
|
270
|
+
}
|
|
271
|
+
},
|
|
272
|
+
Numeric: {
|
|
273
|
+
kind: "typeConstructor",
|
|
274
|
+
inferred: true,
|
|
275
|
+
documentation: "An exact decimal value with optional precision and scale.",
|
|
276
|
+
args: [{
|
|
277
|
+
kind: "value",
|
|
278
|
+
dataType: PG_SIZE_TYPE,
|
|
279
|
+
name: "precision",
|
|
280
|
+
optional: true
|
|
281
|
+
}, {
|
|
282
|
+
kind: "value",
|
|
283
|
+
dataType: PG_SIZE_TYPE,
|
|
284
|
+
name: "scale",
|
|
285
|
+
optional: true
|
|
286
|
+
}],
|
|
287
|
+
output: {
|
|
288
|
+
codecId: "pg/numeric@1",
|
|
289
|
+
typeParams: {
|
|
290
|
+
precision: {
|
|
291
|
+
kind: "arg",
|
|
292
|
+
index: 0
|
|
293
|
+
},
|
|
294
|
+
scale: {
|
|
295
|
+
kind: "arg",
|
|
296
|
+
index: 1
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
},
|
|
301
|
+
Timestamp: {
|
|
302
|
+
kind: "typeConstructor",
|
|
303
|
+
documentation: "A date and time without a time zone, represented as Temporal.PlainDateTime.",
|
|
304
|
+
args: [{
|
|
305
|
+
kind: "value",
|
|
306
|
+
dataType: PG_SIZE_TYPE,
|
|
307
|
+
name: "precision",
|
|
308
|
+
optional: true
|
|
309
|
+
}],
|
|
310
|
+
output: {
|
|
311
|
+
codecId: "pg/timestamp-temporal@1",
|
|
312
|
+
typeParams: { precision: {
|
|
313
|
+
kind: "arg",
|
|
314
|
+
index: 0
|
|
315
|
+
} }
|
|
316
|
+
}
|
|
317
|
+
},
|
|
318
|
+
Timestamptz: {
|
|
319
|
+
kind: "typeConstructor",
|
|
320
|
+
documentation: "An instant represented as Temporal.Instant, with optional fractional-second precision.",
|
|
321
|
+
args: [{
|
|
322
|
+
kind: "value",
|
|
323
|
+
dataType: PG_SIZE_TYPE,
|
|
324
|
+
name: "precision",
|
|
325
|
+
optional: true
|
|
326
|
+
}],
|
|
327
|
+
output: {
|
|
328
|
+
codecId: "pg/timestamptz-temporal@1",
|
|
329
|
+
typeParams: { precision: {
|
|
330
|
+
kind: "arg",
|
|
331
|
+
index: 0
|
|
332
|
+
} }
|
|
333
|
+
}
|
|
334
|
+
},
|
|
335
|
+
Time: {
|
|
336
|
+
kind: "typeConstructor",
|
|
337
|
+
documentation: "A time of day without a time zone, represented as Temporal.PlainTime.",
|
|
338
|
+
args: [{
|
|
339
|
+
kind: "value",
|
|
340
|
+
dataType: PG_SIZE_TYPE,
|
|
341
|
+
name: "precision",
|
|
342
|
+
optional: true
|
|
343
|
+
}],
|
|
344
|
+
output: {
|
|
345
|
+
codecId: "pg/time-temporal@1",
|
|
346
|
+
typeParams: { precision: {
|
|
347
|
+
kind: "arg",
|
|
348
|
+
index: 0
|
|
349
|
+
} }
|
|
350
|
+
}
|
|
351
|
+
},
|
|
352
|
+
Timetz: {
|
|
353
|
+
kind: "typeConstructor",
|
|
354
|
+
inferred: true,
|
|
355
|
+
documentation: "A time of day with a UTC offset stored as PostgreSQL timetz.",
|
|
356
|
+
args: [{
|
|
357
|
+
kind: "value",
|
|
358
|
+
dataType: PG_SIZE_TYPE,
|
|
359
|
+
name: "precision",
|
|
360
|
+
optional: true
|
|
361
|
+
}],
|
|
362
|
+
output: {
|
|
363
|
+
codecId: "pg/timetz@1",
|
|
364
|
+
typeParams: { precision: {
|
|
365
|
+
kind: "arg",
|
|
366
|
+
index: 0
|
|
367
|
+
} }
|
|
368
|
+
}
|
|
369
|
+
},
|
|
370
|
+
Uuid: {
|
|
371
|
+
kind: "typeConstructor",
|
|
372
|
+
inferred: true,
|
|
373
|
+
documentation: "A universally unique identifier stored as PostgreSQL uuid.",
|
|
374
|
+
output: { codecId: "pg/uuid@1" }
|
|
375
|
+
},
|
|
376
|
+
Inet: {
|
|
377
|
+
kind: "typeConstructor",
|
|
378
|
+
inferred: true,
|
|
379
|
+
documentation: "An IPv4 or IPv6 address with an optional subnet mask.",
|
|
380
|
+
output: { codecId: "pg/inet@1" }
|
|
381
|
+
},
|
|
382
|
+
SmallInt: {
|
|
383
|
+
kind: "typeConstructor",
|
|
384
|
+
inferred: true,
|
|
385
|
+
documentation: "A signed 16-bit integer represented as a JavaScript number.",
|
|
386
|
+
output: { codecId: "pg/int2@1" }
|
|
387
|
+
},
|
|
388
|
+
Real: {
|
|
389
|
+
kind: "typeConstructor",
|
|
390
|
+
inferred: true,
|
|
391
|
+
documentation: "A single-precision floating-point number.",
|
|
392
|
+
output: { codecId: "pg/float4@1" }
|
|
393
|
+
},
|
|
394
|
+
Date: {
|
|
395
|
+
kind: "typeConstructor",
|
|
396
|
+
documentation: "A calendar date represented as Temporal.PlainDate.",
|
|
397
|
+
output: { codecId: "pg/date-temporal@1" }
|
|
398
|
+
},
|
|
399
|
+
DateString: {
|
|
400
|
+
kind: "typeConstructor",
|
|
401
|
+
inferred: true,
|
|
402
|
+
documentation: "A PostgreSQL date represented as database text rather than Temporal.PlainDate.",
|
|
403
|
+
output: { codecId: "pg/date-string@1" }
|
|
404
|
+
},
|
|
405
|
+
TimestampString: {
|
|
406
|
+
kind: "typeConstructor",
|
|
407
|
+
inferred: true,
|
|
408
|
+
documentation: "A timestamp without a time zone represented as PostgreSQL text.",
|
|
409
|
+
args: [{
|
|
410
|
+
kind: "value",
|
|
411
|
+
dataType: PG_SIZE_TYPE,
|
|
412
|
+
name: "precision",
|
|
413
|
+
optional: true
|
|
414
|
+
}],
|
|
415
|
+
output: {
|
|
416
|
+
codecId: "pg/timestamp-string@1",
|
|
417
|
+
typeParams: { precision: {
|
|
418
|
+
kind: "arg",
|
|
419
|
+
index: 0
|
|
420
|
+
} }
|
|
421
|
+
}
|
|
422
|
+
},
|
|
423
|
+
TimestamptzJsDate: {
|
|
424
|
+
kind: "typeConstructor",
|
|
425
|
+
documentation: "An instant stored as PostgreSQL timestamptz and represented as a JavaScript Date.",
|
|
426
|
+
args: [{
|
|
427
|
+
kind: "value",
|
|
428
|
+
dataType: PG_SIZE_TYPE,
|
|
429
|
+
name: "precision",
|
|
430
|
+
optional: true
|
|
431
|
+
}],
|
|
432
|
+
output: {
|
|
433
|
+
codecId: PG_TIMESTAMPTZ_DATE_CODEC_ID,
|
|
434
|
+
typeParams: { precision: {
|
|
435
|
+
kind: "arg",
|
|
436
|
+
index: 0
|
|
437
|
+
} }
|
|
438
|
+
}
|
|
439
|
+
},
|
|
440
|
+
TimestamptzString: {
|
|
441
|
+
kind: "typeConstructor",
|
|
442
|
+
inferred: true,
|
|
443
|
+
documentation: "A timestamp with time zone represented as PostgreSQL text.",
|
|
444
|
+
args: [{
|
|
445
|
+
kind: "value",
|
|
446
|
+
dataType: PG_SIZE_TYPE,
|
|
447
|
+
name: "precision",
|
|
448
|
+
optional: true
|
|
449
|
+
}],
|
|
450
|
+
output: {
|
|
451
|
+
codecId: "pg/timestamptz-string@1",
|
|
452
|
+
typeParams: { precision: {
|
|
453
|
+
kind: "arg",
|
|
454
|
+
index: 0
|
|
455
|
+
} }
|
|
456
|
+
}
|
|
457
|
+
},
|
|
458
|
+
TimeString: {
|
|
459
|
+
kind: "typeConstructor",
|
|
460
|
+
inferred: true,
|
|
461
|
+
documentation: "A time of day without a time zone represented as PostgreSQL text.",
|
|
462
|
+
args: [{
|
|
463
|
+
kind: "value",
|
|
464
|
+
dataType: PG_SIZE_TYPE,
|
|
465
|
+
name: "precision",
|
|
466
|
+
optional: true
|
|
467
|
+
}],
|
|
468
|
+
output: {
|
|
469
|
+
codecId: "pg/time-string@1",
|
|
470
|
+
typeParams: { precision: {
|
|
471
|
+
kind: "arg",
|
|
472
|
+
index: 0
|
|
473
|
+
} }
|
|
474
|
+
}
|
|
475
|
+
},
|
|
476
|
+
Bit: {
|
|
477
|
+
kind: "typeConstructor",
|
|
478
|
+
inferred: true,
|
|
479
|
+
documentation: "A fixed-length bit string with an optional length in bits.",
|
|
480
|
+
args: [{
|
|
481
|
+
kind: "value",
|
|
482
|
+
dataType: PG_SIZE_TYPE,
|
|
483
|
+
name: "length",
|
|
484
|
+
optional: true
|
|
485
|
+
}],
|
|
486
|
+
output: {
|
|
487
|
+
codecId: "pg/bit@1",
|
|
488
|
+
typeParams: { length: {
|
|
489
|
+
kind: "arg",
|
|
490
|
+
index: 0
|
|
491
|
+
} }
|
|
492
|
+
}
|
|
493
|
+
},
|
|
494
|
+
VarBit: {
|
|
495
|
+
kind: "typeConstructor",
|
|
496
|
+
inferred: true,
|
|
497
|
+
documentation: "A variable-length bit string with an optional maximum length in bits.",
|
|
498
|
+
args: [{
|
|
499
|
+
kind: "value",
|
|
500
|
+
dataType: PG_SIZE_TYPE,
|
|
501
|
+
name: "length",
|
|
502
|
+
optional: true
|
|
503
|
+
}],
|
|
504
|
+
output: {
|
|
505
|
+
codecId: "pg/varbit@1",
|
|
506
|
+
typeParams: { length: {
|
|
507
|
+
kind: "arg",
|
|
508
|
+
index: 0
|
|
509
|
+
} }
|
|
510
|
+
}
|
|
511
|
+
},
|
|
512
|
+
Interval: {
|
|
513
|
+
kind: "typeConstructor",
|
|
514
|
+
inferred: true,
|
|
515
|
+
documentation: "A span of time stored as PostgreSQL interval, with optional fractional-second precision.",
|
|
516
|
+
args: [{
|
|
517
|
+
kind: "value",
|
|
518
|
+
dataType: PG_SIZE_TYPE,
|
|
519
|
+
name: "precision",
|
|
520
|
+
optional: true
|
|
521
|
+
}],
|
|
522
|
+
output: {
|
|
523
|
+
codecId: "pg/interval@1",
|
|
524
|
+
typeParams: { precision: {
|
|
525
|
+
kind: "arg",
|
|
526
|
+
index: 0
|
|
527
|
+
} }
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
};
|
|
531
|
+
/**
|
|
532
|
+
* The constructors only PSL offers, defined here next to the codecs they name. The adapter contributes them: the TypeScript contract builder builds its `type.*` helpers from the target, so a target contribution would add `type.String()` and the like there. The constructors that should also be `type.*` helpers are the target's own, in `postgresAuthoringTypes`.
|
|
533
|
+
*/
|
|
534
|
+
const postgresPslTypeConstructors = {
|
|
535
|
+
...postgresScalarAuthoringTypes,
|
|
536
|
+
...postgresNativeAuthoringTypes
|
|
537
|
+
};
|
|
166
538
|
const PSL_POLICY_INVALID_MAP = "PSL_POLICY_INVALID_MAP";
|
|
167
539
|
const PSL_FULL_TEXT_INDEX_TOO_MANY_GROUPS = "PSL_FULL_TEXT_INDEX_TOO_MANY_GROUPS";
|
|
168
540
|
const PSL_FULL_TEXT_INDEX_EMPTY_GROUP = "PSL_FULL_TEXT_INDEX_EMPTY_GROUP";
|
|
@@ -183,6 +555,7 @@ const PSL_ROLE_BLOCK_OUTSIDE_UNBOUND_NAMESPACE = "PSL_ROLE_BLOCK_OUTSIDE_UNBOUND
|
|
|
183
555
|
* `pg/enum` data type, which renders `typeParams.typeName`.
|
|
184
556
|
*/
|
|
185
557
|
const postgresAuthoringTypes = {
|
|
558
|
+
.../* @__PURE__ */ sqlTargetTypeConstructors({ sizeType: PG_SIZE_TYPE }),
|
|
186
559
|
BigIntNumber: {
|
|
187
560
|
kind: "typeConstructor",
|
|
188
561
|
documentation: "A PostgreSQL 64-bit integer represented as a JavaScript number within its safe integer range.",
|
|
@@ -737,6 +1110,7 @@ const postgresAuthoringFieldPresets = {
|
|
|
737
1110
|
generatorId: postgresNowGeneratorIds[PG_TIMESTAMPTZ_DATE_CODEC_ID]
|
|
738
1111
|
})).updatedAt,
|
|
739
1112
|
timestamptzJsDate: /* @__PURE__ */ temporalCodecPresetWithPrecision({
|
|
1113
|
+
sizeType: PG_SIZE_TYPE,
|
|
740
1114
|
codecId: PG_TIMESTAMPTZ_DATE_CODEC_ID,
|
|
741
1115
|
generatorId: postgresNowGeneratorIds[PG_TIMESTAMPTZ_DATE_CODEC_ID]
|
|
742
1116
|
}),
|
|
@@ -749,18 +1123,22 @@ const postgresAuthoringFieldPresets = {
|
|
|
749
1123
|
generatorId: postgresNowGeneratorIds[PG_TIMESTAMPTZ_STRING_CODEC_ID]
|
|
750
1124
|
}),
|
|
751
1125
|
timestamp: /* @__PURE__ */ temporalCodecPresetWithPrecision({
|
|
1126
|
+
sizeType: PG_SIZE_TYPE,
|
|
752
1127
|
codecId: PG_TIMESTAMP_TEMPORAL_CODEC_ID,
|
|
753
1128
|
generatorId: postgresNowGeneratorIds[PG_TIMESTAMP_TEMPORAL_CODEC_ID]
|
|
754
1129
|
}),
|
|
755
1130
|
timestamptz: /* @__PURE__ */ temporalCodecPresetWithPrecision({
|
|
1131
|
+
sizeType: PG_SIZE_TYPE,
|
|
756
1132
|
codecId: PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID,
|
|
757
1133
|
generatorId: postgresNowGeneratorIds[PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID]
|
|
758
1134
|
}),
|
|
759
1135
|
timestampString: /* @__PURE__ */ temporalCodecPresetWithPrecision({
|
|
1136
|
+
sizeType: PG_SIZE_TYPE,
|
|
760
1137
|
codecId: PG_TIMESTAMP_STRING_CODEC_ID,
|
|
761
1138
|
generatorId: postgresNowGeneratorIds[PG_TIMESTAMP_STRING_CODEC_ID]
|
|
762
1139
|
}),
|
|
763
1140
|
timestamptzString: /* @__PURE__ */ temporalCodecPresetWithPrecision({
|
|
1141
|
+
sizeType: PG_SIZE_TYPE,
|
|
764
1142
|
codecId: PG_TIMESTAMPTZ_STRING_CODEC_ID,
|
|
765
1143
|
generatorId: postgresNowGeneratorIds[PG_TIMESTAMPTZ_STRING_CODEC_ID]
|
|
766
1144
|
}),
|
|
@@ -773,17 +1151,20 @@ const postgresAuthoringFieldPresets = {
|
|
|
773
1151
|
generatorId: postgresNowGeneratorIds[PG_DATE_STRING_CODEC_ID]
|
|
774
1152
|
}),
|
|
775
1153
|
time: /* @__PURE__ */ temporalCodecPresetWithPrecision({
|
|
1154
|
+
sizeType: PG_SIZE_TYPE,
|
|
776
1155
|
codecId: PG_TIME_TEMPORAL_CODEC_ID,
|
|
777
1156
|
generatorId: postgresNowGeneratorIds[PG_TIME_TEMPORAL_CODEC_ID],
|
|
778
1157
|
nowTakesPrecision: postgresNowGeneratorTakesPrecision[PG_TIME_TEMPORAL_CODEC_ID]
|
|
779
1158
|
}),
|
|
780
1159
|
timeString: /* @__PURE__ */ temporalCodecPresetWithPrecision({
|
|
1160
|
+
sizeType: PG_SIZE_TYPE,
|
|
781
1161
|
codecId: PG_TIME_STRING_CODEC_ID,
|
|
782
1162
|
generatorId: postgresNowGeneratorIds[PG_TIME_STRING_CODEC_ID],
|
|
783
1163
|
nowTakesPrecision: postgresNowGeneratorTakesPrecision[PG_TIME_STRING_CODEC_ID]
|
|
784
1164
|
}),
|
|
785
1165
|
/** Produces a string: no Temporal type holds a time of day with an offset. */
|
|
786
1166
|
timetz: /* @__PURE__ */ temporalCodecPresetWithPrecision({
|
|
1167
|
+
sizeType: PG_SIZE_TYPE,
|
|
787
1168
|
codecId: PG_TIMETZ_CODEC_ID,
|
|
788
1169
|
generatorId: postgresNowGeneratorIds[PG_TIMETZ_CODEC_ID],
|
|
789
1170
|
nowTakesPrecision: postgresNowGeneratorTakesPrecision[PG_TIMETZ_CODEC_ID]
|
|
@@ -942,6 +1323,6 @@ function postgresLowerEntityHandles(input) {
|
|
|
942
1323
|
return rows;
|
|
943
1324
|
}
|
|
944
1325
|
//#endregion
|
|
945
|
-
export { postgresAuthoringPslBlockDescriptors as a,
|
|
1326
|
+
export { postgresAuthoringPslBlockDescriptors as a, postgresNativeAuthoringTypes as c, postgresNowGenerators as d, postgresPslTypeConstructors as f, postgresAuthoringModelAttributes as i, postgresNowGeneratorControlDescriptors as l, postgresAuthoringEntityTypes as n, postgresAuthoringTypes as o, postgresScalarAuthoringTypes as p, postgresAuthoringFieldPresets as r, postgresLowerEntityHandles as s, POLICY_BLOCK_KEYWORDS as t, postgresNowGeneratorFunction as u };
|
|
946
1327
|
|
|
947
|
-
//# sourceMappingURL=authoring-
|
|
1328
|
+
//# sourceMappingURL=authoring-NKZZKf0m-aFhCcgbc.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authoring-NKZZKf0m-aFhCcgbc.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/authoring-NKZZKf0m.mjs"],"sourcesContent":["import { A as PG_TIME_TEMPORAL_CODEC_ID, C as PG_TIMESTAMPTZ_DATE_CODEC_ID, D as PG_TIMESTAMP_TEMPORAL_CODEC_ID, E as PG_TIMESTAMP_STRING_CODEC_ID, O as PG_TIMETZ_CODEC_ID, T as PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID, a as PG_DATE_STRING_CODEC_ID, k as PG_TIME_STRING_CODEC_ID, o as PG_DATE_TEMPORAL_CODEC_ID, s as PG_ENUM_CODEC_ID, w as PG_TIMESTAMPTZ_STRING_CODEC_ID } from \"./codec-ids-BMhEpFwv.mjs\";\nimport { c as postgresError } from \"./errors-BrhQYgdL.mjs\";\nimport { N as requireTemporal } from \"./codecs-CI5UwRqu.mjs\";\nimport { t as PostgresNativeEnum } from \"./postgres-native-enum-CdP3b_-R.mjs\";\nimport { f as weightGroupsOf, l as POSTGRES_TEXT_SEARCH_LANGUAGES, o as fullTextIndexProblems, r as describeFullTextIndexProblem, t as FULL_TEXT_INDEX_TYPE } from \"./full-text-index-definition-BPxQQBuC.mjs\";\nimport { t as postgresCodecTraitsOf } from \"./postgres-codec-traits-C8pMXZ1-.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-C6w1rzOF.mjs\";\nimport { r as computeContentHash } from \"./canonicalize-RdxoUHao.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { sqlTargetTypeConstructors, temporalCodecPresetWithPrecision, temporalStringAuthoringPresets } from \"@internal/family-sql/pack\";\nimport { TIMESTAMP_NOW_GENERATOR_ID, temporalAuthoringPresets, temporalCodecPreset } from \"@internal/framework-components/authoring\";\nimport { blockAttribute, bool, dataTypeValue, entityRef, fieldRef, identifier, leafDiagnostic, list, mapBlock, modelAttribute, oneOf, optional, str, structBlock } from \"@internal/psl-parser\";\nimport { exactNameBodyWarning } from \"@internal/sql-contract/index-naming\";\nimport { SQL_EXPRESSION_DATA_TYPE_ID, requireSqlExpression, sqlTextFromStored } from \"@internal/sql-contract/sql-expression\";\nimport { assertWireNamePrefixLength, normalizeSqlBody } from \"@internal/sql-schema-ir/naming\";\nimport { assertDefined, invariant } from \"@internal/utils/assertions\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { singleGeneratorBinding } from \"@internal/framework-components/components\";\n//#region src/core/date-time-now-generators.ts\n/**\n* The Postgres \"now\" generators, one per date and time codec except `pg/timestamptz-date@1`, which uses the framework's `timestampNow`. All read the clock through `Date.now()` and write UTC. The time generators round down to their `precision` param. The string generators are named after the codec they serve and write the text PostgreSQL prints in a UTC session, with milliseconds and no trailing zeros in the fraction.\n*/\nconst INSTANT_NOW_GENERATOR_ID = \"instantNow\";\nconst PLAIN_DATE_TIME_NOW_GENERATOR_ID = \"plainDateTimeNow\";\nconst PLAIN_DATE_NOW_GENERATOR_ID = \"plainDateNow\";\nconst PLAIN_TIME_NOW_GENERATOR_ID = \"plainTimeNow\";\nconst TIMESTAMP_STRING_NOW_GENERATOR_ID = \"timestampStringNow\";\nconst TIMESTAMPTZ_STRING_NOW_GENERATOR_ID = \"timestamptzStringNow\";\nconst DATE_STRING_NOW_GENERATOR_ID = \"dateStringNow\";\nconst TIME_STRING_NOW_GENERATOR_ID = \"timeStringNow\";\nconst TIMETZ_NOW_GENERATOR_ID = \"timetzNow\";\nconst UTC_OFFSET = \"+00\";\nconst MAX_TIME_PRECISION = 6;\nfunction fractionDigitsOf(params) {\n\tconst precision = params?.[\"precision\"];\n\treturn typeof precision === \"number\" ? precision : MAX_TIME_PRECISION;\n}\nfunction utcNow(fractionDigits = MAX_TIME_PRECISION) {\n\tconst iso = new Date(Date.now()).toISOString();\n\tconst [wholeSeconds = \"\", fraction = \"\"] = iso.slice(11, -1).split(\".\");\n\tconst kept = fraction.slice(0, fractionDigits).replace(/0+$/, \"\");\n\treturn {\n\t\tdate: iso.slice(0, 10),\n\t\ttime: kept === \"\" ? wholeSeconds : `${wholeSeconds}.${kept}`\n\t};\n}\n/** Rounds down, so PostgreSQL stores the value without rounding it up, which can reach `24:00:00`. */\nfunction truncateTime(time, fractionDigits) {\n\tif (fractionDigits <= 0) return time.round({\n\t\tsmallestUnit: \"second\",\n\t\troundingMode: \"trunc\"\n\t});\n\tconst smallestUnit = fractionDigits <= 3 ? \"millisecond\" : \"microsecond\";\n\tconst unitDigits = fractionDigits <= 3 ? 3 : 6;\n\treturn time.round({\n\t\tsmallestUnit,\n\t\troundingIncrement: 10 ** (unitDigits - Math.min(fractionDigits, unitDigits)),\n\t\troundingMode: \"trunc\"\n\t});\n}\nfunction utcDateTimeNow(generatorId) {\n\treturn requireTemporal({ generatorId }).Instant.fromEpochMilliseconds(Date.now()).toZonedDateTimeISO(\"UTC\");\n}\nfunction instantNow() {\n\treturn requireTemporal({ generatorId: INSTANT_NOW_GENERATOR_ID }).Instant.fromEpochMilliseconds(Date.now());\n}\nfunction plainDateTimeNow() {\n\treturn utcDateTimeNow(PLAIN_DATE_TIME_NOW_GENERATOR_ID).toPlainDateTime();\n}\nfunction plainDateNow() {\n\treturn utcDateTimeNow(PLAIN_DATE_NOW_GENERATOR_ID).toPlainDate();\n}\nfunction plainTimeNow(params) {\n\treturn truncateTime(utcDateTimeNow(PLAIN_TIME_NOW_GENERATOR_ID).toPlainTime(), fractionDigitsOf(params));\n}\nfunction timestampStringNow() {\n\tconst { date, time } = utcNow();\n\treturn `${date} ${time}`;\n}\nfunction timestamptzStringNow() {\n\treturn `${timestampStringNow()}${UTC_OFFSET}`;\n}\nfunction dateStringNow() {\n\treturn utcNow().date;\n}\nfunction timeStringNow(params) {\n\treturn utcNow(fractionDigitsOf(params)).time;\n}\nfunction timetzNow(params) {\n\treturn `${timeStringNow(params)}${UTC_OFFSET}`;\n}\nconst postgresNowGenerators = [\n\t{\n\t\tid: INSTANT_NOW_GENERATOR_ID,\n\t\tgenerate: instantNow\n\t},\n\t{\n\t\tid: PLAIN_DATE_TIME_NOW_GENERATOR_ID,\n\t\tgenerate: plainDateTimeNow\n\t},\n\t{\n\t\tid: PLAIN_DATE_NOW_GENERATOR_ID,\n\t\tgenerate: plainDateNow\n\t},\n\t{\n\t\tid: PLAIN_TIME_NOW_GENERATOR_ID,\n\t\tgenerate: plainTimeNow\n\t},\n\t{\n\t\tid: TIMESTAMP_STRING_NOW_GENERATOR_ID,\n\t\tgenerate: timestampStringNow\n\t},\n\t{\n\t\tid: TIMESTAMPTZ_STRING_NOW_GENERATOR_ID,\n\t\tgenerate: timestamptzStringNow\n\t},\n\t{\n\t\tid: DATE_STRING_NOW_GENERATOR_ID,\n\t\tgenerate: dateStringNow\n\t},\n\t{\n\t\tid: TIME_STRING_NOW_GENERATOR_ID,\n\t\tgenerate: timeStringNow\n\t},\n\t{\n\t\tid: TIMETZ_NOW_GENERATOR_ID,\n\t\tgenerate: timetzNow\n\t}\n];\nfunction postgresNowGeneratorControlDescriptors() {\n\treturn postgresNowGenerators.map(({ id }) => ({ id }));\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_DATE_TEMPORAL_CODEC_ID]: PLAIN_DATE_NOW_GENERATOR_ID,\n\t[PG_DATE_STRING_CODEC_ID]: DATE_STRING_NOW_GENERATOR_ID,\n\t[PG_TIME_TEMPORAL_CODEC_ID]: PLAIN_TIME_NOW_GENERATOR_ID,\n\t[PG_TIME_STRING_CODEC_ID]: TIME_STRING_NOW_GENERATOR_ID,\n\t[PG_TIMETZ_CODEC_ID]: TIMETZ_NOW_GENERATOR_ID,\n\t[PG_TIMESTAMP_TEMPORAL_CODEC_ID]: PLAIN_DATE_TIME_NOW_GENERATOR_ID,\n\t[PG_TIMESTAMP_STRING_CODEC_ID]: TIMESTAMP_STRING_NOW_GENERATOR_ID,\n\t[PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID]: INSTANT_NOW_GENERATOR_ID,\n\t[PG_TIMESTAMPTZ_STRING_CODEC_ID]: TIMESTAMPTZ_STRING_NOW_GENERATOR_ID,\n\t[PG_TIMESTAMPTZ_DATE_CODEC_ID]: TIMESTAMP_NOW_GENERATOR_ID\n};\nnew Map(Object.entries(postgresNowGeneratorIds));\n/** The codecs whose \"now\" generator takes the column's precision, so that it rounds down where PostgreSQL would round a time up to `24:00:00`. */\nconst postgresNowGeneratorTakesPrecision = {\n\t[PG_TIME_TEMPORAL_CODEC_ID]: true,\n\t[PG_TIME_STRING_CODEC_ID]: true,\n\t[PG_TIMETZ_CODEC_ID]: true\n};\n/** The `now` generator function bound to each Postgres date and time codec, with the column's precision on the three time codecs. */\nconst postgresNowGeneratorFunction = {\n\tname: \"now\",\n\tbindings: Object.entries(postgresNowGeneratorIds).map(([codecId, generatorId]) => singleGeneratorBinding({\n\t\tcodecIds: [codecId],\n\t\tgeneratorId,\n\t\tparamsFromField: (column) => {\n\t\t\tconst precision = column.typeParams?.[\"precision\"];\n\t\t\treturn Object.hasOwn(postgresNowGeneratorTakesPrecision, codecId) && typeof precision === \"number\" ? { precision } : void 0;\n\t\t}\n\t}))\n};\n//#endregion\n//#region src/core/type-constructors.ts\n/** The data type of every size argument on Postgres, such as a length or a precision: a typmod is an `int4`. */\nconst PG_SIZE_TYPE = \"pg/int4\";\n/**\n* The base PSL scalars as zero-arg type constructors in the unified authoring\n* channel. Each names a codec; the column's database type is its data type's.\n*\n* The type position is the only storage decider: a mutation-default generator\n* (`@onCreate(uuid())`) never re-picks a column's storage.\n*/\nconst postgresScalarAuthoringTypes = {\n\tString: {\n\t\tkind: \"typeConstructor\",\n\t\tinferred: true,\n\t\tdocumentation: \"Variable-length text stored as PostgreSQL text.\",\n\t\toutput: { codecId: \"pg/text@1\" }\n\t},\n\tBoolean: {\n\t\tkind: \"typeConstructor\",\n\t\tinferred: true,\n\t\tdocumentation: \"A true or false value stored as PostgreSQL boolean.\",\n\t\toutput: { codecId: \"pg/bool@1\" }\n\t},\n\tInt: {\n\t\tkind: \"typeConstructor\",\n\t\tinferred: true,\n\t\tdocumentation: \"A signed 32-bit integer represented as a JavaScript number.\",\n\t\toutput: { codecId: \"pg/int4@1\" }\n\t},\n\tBigInt: {\n\t\tkind: \"typeConstructor\",\n\t\tinferred: true,\n\t\tdocumentation: \"A signed 64-bit integer represented as a JavaScript bigint.\",\n\t\toutput: { codecId: \"pg/int8@1\" }\n\t},\n\tFloat: {\n\t\tkind: \"typeConstructor\",\n\t\tinferred: true,\n\t\tdocumentation: \"A double-precision floating-point number.\",\n\t\toutput: { codecId: \"pg/float8@1\" }\n\t},\n\tDecimal: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"An exact decimal value stored as PostgreSQL numeric.\",\n\t\toutput: { codecId: \"pg/numeric@1\" }\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: { codecId: \"pg/timestamptz-temporal@1\" }\n\t},\n\tJson: {\n\t\tkind: \"typeConstructor\",\n\t\tinferred: true,\n\t\tdocumentation: \"A JSON value stored as PostgreSQL json.\",\n\t\toutput: { codecId: \"pg/json@1\" }\n\t},\n\tJsonb: {\n\t\tkind: \"typeConstructor\",\n\t\tinferred: true,\n\t\tdocumentation: \"A JSON value stored in PostgreSQL binary jsonb format.\",\n\t\toutput: { codecId: \"pg/jsonb@1\" }\n\t},\n\tBytes: {\n\t\tkind: \"typeConstructor\",\n\t\tinferred: true,\n\t\tdocumentation: \"Binary data stored as PostgreSQL bytea.\",\n\t\toutput: { codecId: \"pg/bytea@1\" }\n\t}\n};\nconst postgresNativeAuthoringTypes = {\n\tVarChar: {\n\t\tkind: \"typeConstructor\",\n\t\tinferred: true,\n\t\tdocumentation: \"Variable-length text with an optional maximum character length.\",\n\t\targs: [{\n\t\t\tkind: \"value\",\n\t\t\tdataType: PG_SIZE_TYPE,\n\t\t\tname: \"length\",\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"sql/varchar@1\",\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\tinferred: true,\n\t\tdocumentation: \"Fixed-length, blank-padded text with an optional character length.\",\n\t\targs: [{\n\t\t\tkind: \"value\",\n\t\t\tdataType: PG_SIZE_TYPE,\n\t\t\tname: \"length\",\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"sql/char@1\",\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\tinferred: true,\n\t\tdocumentation: \"An exact decimal value with optional precision and scale.\",\n\t\targs: [{\n\t\t\tkind: \"value\",\n\t\t\tdataType: PG_SIZE_TYPE,\n\t\t\tname: \"precision\",\n\t\t\toptional: true\n\t\t}, {\n\t\t\tkind: \"value\",\n\t\t\tdataType: PG_SIZE_TYPE,\n\t\t\tname: \"scale\",\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"pg/numeric@1\",\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: \"value\",\n\t\t\tdataType: PG_SIZE_TYPE,\n\t\t\tname: \"precision\",\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"pg/timestamp-temporal@1\",\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: \"value\",\n\t\t\tdataType: PG_SIZE_TYPE,\n\t\t\tname: \"precision\",\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"pg/timestamptz-temporal@1\",\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: \"value\",\n\t\t\tdataType: PG_SIZE_TYPE,\n\t\t\tname: \"precision\",\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"pg/time-temporal@1\",\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\tinferred: true,\n\t\tdocumentation: \"A time of day with a UTC offset stored as PostgreSQL timetz.\",\n\t\targs: [{\n\t\t\tkind: \"value\",\n\t\t\tdataType: PG_SIZE_TYPE,\n\t\t\tname: \"precision\",\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"pg/timetz@1\",\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\tinferred: true,\n\t\tdocumentation: \"A universally unique identifier stored as PostgreSQL uuid.\",\n\t\toutput: { codecId: \"pg/uuid@1\" }\n\t},\n\tInet: {\n\t\tkind: \"typeConstructor\",\n\t\tinferred: true,\n\t\tdocumentation: \"An IPv4 or IPv6 address with an optional subnet mask.\",\n\t\toutput: { codecId: \"pg/inet@1\" }\n\t},\n\tSmallInt: {\n\t\tkind: \"typeConstructor\",\n\t\tinferred: true,\n\t\tdocumentation: \"A signed 16-bit integer represented as a JavaScript number.\",\n\t\toutput: { codecId: \"pg/int2@1\" }\n\t},\n\tReal: {\n\t\tkind: \"typeConstructor\",\n\t\tinferred: true,\n\t\tdocumentation: \"A single-precision floating-point number.\",\n\t\toutput: { codecId: \"pg/float4@1\" }\n\t},\n\tDate: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A calendar date represented as Temporal.PlainDate.\",\n\t\toutput: { codecId: \"pg/date-temporal@1\" }\n\t},\n\tDateString: {\n\t\tkind: \"typeConstructor\",\n\t\tinferred: true,\n\t\tdocumentation: \"A PostgreSQL date represented as database text rather than Temporal.PlainDate.\",\n\t\toutput: { codecId: \"pg/date-string@1\" }\n\t},\n\tTimestampString: {\n\t\tkind: \"typeConstructor\",\n\t\tinferred: true,\n\t\tdocumentation: \"A timestamp without a time zone represented as PostgreSQL text.\",\n\t\targs: [{\n\t\t\tkind: \"value\",\n\t\t\tdataType: PG_SIZE_TYPE,\n\t\t\tname: \"precision\",\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"pg/timestamp-string@1\",\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: \"value\",\n\t\t\tdataType: PG_SIZE_TYPE,\n\t\t\tname: \"precision\",\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: PG_TIMESTAMPTZ_DATE_CODEC_ID,\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\tinferred: true,\n\t\tdocumentation: \"A timestamp with time zone represented as PostgreSQL text.\",\n\t\targs: [{\n\t\t\tkind: \"value\",\n\t\t\tdataType: PG_SIZE_TYPE,\n\t\t\tname: \"precision\",\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"pg/timestamptz-string@1\",\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\tinferred: true,\n\t\tdocumentation: \"A time of day without a time zone represented as PostgreSQL text.\",\n\t\targs: [{\n\t\t\tkind: \"value\",\n\t\t\tdataType: PG_SIZE_TYPE,\n\t\t\tname: \"precision\",\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"pg/time-string@1\",\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\tBit: {\n\t\tkind: \"typeConstructor\",\n\t\tinferred: true,\n\t\tdocumentation: \"A fixed-length bit string with an optional length in bits.\",\n\t\targs: [{\n\t\t\tkind: \"value\",\n\t\t\tdataType: PG_SIZE_TYPE,\n\t\t\tname: \"length\",\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"pg/bit@1\",\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\tVarBit: {\n\t\tkind: \"typeConstructor\",\n\t\tinferred: true,\n\t\tdocumentation: \"A variable-length bit string with an optional maximum length in bits.\",\n\t\targs: [{\n\t\t\tkind: \"value\",\n\t\t\tdataType: PG_SIZE_TYPE,\n\t\t\tname: \"length\",\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"pg/varbit@1\",\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\tInterval: {\n\t\tkind: \"typeConstructor\",\n\t\tinferred: true,\n\t\tdocumentation: \"A span of time stored as PostgreSQL interval, with optional fractional-second precision.\",\n\t\targs: [{\n\t\t\tkind: \"value\",\n\t\t\tdataType: PG_SIZE_TYPE,\n\t\t\tname: \"precision\",\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"pg/interval@1\",\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};\n/**\n* The constructors only PSL offers, defined here next to the codecs they name. The adapter contributes them: the TypeScript contract builder builds its `type.*` helpers from the target, so a target contribution would add `type.String()` and the like there. The constructors that should also be `type.*` helpers are the target's own, in `postgresAuthoringTypes`.\n*/\nconst postgresPslTypeConstructors = {\n\t...postgresScalarAuthoringTypes,\n\t...postgresNativeAuthoringTypes\n};\n//#endregion\n//#region src/core/authoring.ts\nconst PSL_POLICY_INVALID_MAP = \"PSL_POLICY_INVALID_MAP\";\nconst PSL_FULL_TEXT_INDEX_TOO_MANY_GROUPS = \"PSL_FULL_TEXT_INDEX_TOO_MANY_GROUPS\";\nconst PSL_FULL_TEXT_INDEX_EMPTY_GROUP = \"PSL_FULL_TEXT_INDEX_EMPTY_GROUP\";\nconst PSL_FULL_TEXT_INDEX_DUPLICATE_FIELD = \"PSL_FULL_TEXT_INDEX_DUPLICATE_FIELD\";\nconst PSL_FULL_TEXT_INDEX_REQUIRES_NAME = \"PSL_FULL_TEXT_INDEX_REQUIRES_NAME\";\nconst PSL_FULL_TEXT_INDEX_NAME_XOR_MAP = \"PSL_FULL_TEXT_INDEX_NAME_XOR_MAP\";\nconst PSL_FULL_TEXT_INDEX_TEXT_FIELD = \"PSL_FULL_TEXT_INDEX_TEXT_FIELD\";\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`. The column's type name comes from the\n* `pg/enum` data type, which renders `typeParams.typeName`.\n*/\nconst postgresAuthoringTypes = {\n\t.../* @__PURE__ */ sqlTargetTypeConstructors({ sizeType: PG_SIZE_TYPE }),\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: { codecId: \"pg/int8number@1\" }\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: { codecId: \"pg/unboundedint@1\" }\n\t},\n\tpg: { enum: {\n\t\tkind: \"typeConstructor\",\n\t\tinferred: true,\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};\nconst policyTargetParam = {\n\ttype: entityRef({ kind: \"model\" }),\n\tdocumentation: \"The model protected by this policy; it must declare @@rls.\"\n};\nconst policyRolesParam = {\n\ttype: optional(list(oneOf(entityRef({\n\t\tkind: \"block\",\n\t\tkeyword: \"role\"\n\t}), identifier()))),\n\tdocumentation: \"The database roles to which this policy applies.\"\n};\nfunction policyUsingParam(ctx) {\n\treturn {\n\t\ttype: optional(dataTypeValue(SQL_EXPRESSION_DATA_TYPE_ID, ctx.dataTypes)),\n\t\tdocumentation: \"A SQL predicate controlling which rows this policy permits.\"\n\t};\n}\nfunction policyWithCheckParam(ctx) {\n\treturn {\n\t\ttype: optional(dataTypeValue(SQL_EXPRESSION_DATA_TYPE_ID, ctx.dataTypes)),\n\t\tdocumentation: \"A SQL predicate checking rows being written by this policy.\"\n\t};\n}\nconst policyPermissiveParam = {\n\ttype: optional(bool()),\n\tdocumentation: \"Whether the policy is permissive (combined with OR) rather than restrictive (combined with AND).\"\n};\nfunction policyUsingOnlySpec(ctx) {\n\treturn structBlock({ parameters: {\n\t\ttarget: policyTargetParam,\n\t\troles: policyRolesParam,\n\t\tusing: policyUsingParam(ctx),\n\t\tpermissive: policyPermissiveParam\n\t} });\n}\nfunction policyWithCheckOnlySpec(ctx) {\n\treturn structBlock({ parameters: {\n\t\ttarget: policyTargetParam,\n\t\troles: policyRolesParam,\n\t\twithCheck: policyWithCheckParam(ctx),\n\t\tpermissive: policyPermissiveParam\n\t} });\n}\nfunction policyBothPredicatesSpec(ctx) {\n\treturn structBlock({ parameters: {\n\t\ttarget: policyTargetParam,\n\t\troles: policyRolesParam,\n\t\tusing: policyUsingParam(ctx),\n\t\twithCheck: policyWithCheckParam(ctx),\n\t\tpermissive: policyPermissiveParam\n\t} });\n}\nfunction roleSpec() {\n\treturn structBlock({ parameters: {} });\n}\nfunction nativeEnumSpec() {\n\treturn mapBlock({ value: {\n\t\ttype: str(),\n\t\tdocumentation: \"The member value stored in the database enum type.\"\n\t} });\n}\n/**\n* The block keyword that authors each row-level security operation. The keyword is the operation, so\n* a policy block has no `operation` parameter. The reader looks a block's operation up here, and\n* `contract infer` and `contract print` look up the keyword to write.\n*/\nconst POLICY_BLOCK_KEYWORDS = {\n\tselect: \"policy_select\",\n\tinsert: \"policy_insert\",\n\tupdate: \"policy_update\",\n\tdelete: \"policy_delete\",\n\tall: \"policy_all\"\n};\nfunction isRlsPolicyOperation(value) {\n\treturn Object.hasOwn(POLICY_BLOCK_KEYWORDS, value);\n}\n/** The operation a `policy_<operation>` block keyword authors, or `undefined` for another keyword. */\nfunction policyOperationOfKeyword(keyword) {\n\treturn Object.keys(POLICY_BLOCK_KEYWORDS).filter(isRlsPolicyOperation).find((operation) => POLICY_BLOCK_KEYWORDS[operation] === keyword);\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 = policyOperationOfKeyword(block.keyword) ?? \"select\";\n\tconst target = block.resolvedModelRefs?.[\"target\"];\n\tassertDefined(target, `lowerRlsPolicyFromBlock: policy \"${block.name}\" reached the factory without a projected \\`target\\` coordinate; the interpreter projects checked model references before invoking entity factories.`);\n\tconst roles = block.values.roles === void 0 ? [] : block.values.roles.map((role) => typeof role === \"string\" ? role : role.declaration.name).sort();\n\tconst using = block.values.using === void 0 ? void 0 : sqlTextFromStored(block.values.using.value.value);\n\tconst withCheck = block.values.withCheck === void 0 ? void 0 : sqlTextFromStored(block.values.withCheck.value.value);\n\tconst permissive = block.values.permissive ?? true;\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: target.tableName,\n\t\t\tnamespaceId: target.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: target.tableName,\n\t\tnamespaceId: target.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}\nconst policyEntityTypeOutput = {\n\tfactory: lowerRlsPolicyFromBlock,\n\tpslPlacement: (entity) => ({ namespaceId: entity.namespaceId })\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, value] of Object.entries(block.values)) {\n\t\tif (seenValues.has(value)) {\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 \"${value}\"`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: block.parameterSpans[memberName] ?? block.span\n\t\t\t});\n\t\t\tmemberError = true;\n\t\t\tcontinue;\n\t\t}\n\t\tseenValues.add(value);\n\t\tmembers.push(value);\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: policyEntityTypeOutput\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*/\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\t[POLICY_BLOCK_KEYWORDS.select]: {\n\t\tkind: \"pslBlock\",\n\t\tkeyword: POLICY_BLOCK_KEYWORDS.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\tspec: policyUsingOnlySpec,\n\t\trequiresModelAttribute: policyRequiresRls,\n\t\tattributes: policyBlockAttributes\n\t},\n\t[POLICY_BLOCK_KEYWORDS.delete]: {\n\t\tkind: \"pslBlock\",\n\t\tkeyword: POLICY_BLOCK_KEYWORDS.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\tspec: policyUsingOnlySpec,\n\t\trequiresModelAttribute: policyRequiresRls,\n\t\tattributes: policyBlockAttributes\n\t},\n\t[POLICY_BLOCK_KEYWORDS.insert]: {\n\t\tkind: \"pslBlock\",\n\t\tkeyword: POLICY_BLOCK_KEYWORDS.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\tspec: policyWithCheckOnlySpec,\n\t\trequiresModelAttribute: policyRequiresRls,\n\t\tattributes: policyBlockAttributes\n\t},\n\t[POLICY_BLOCK_KEYWORDS.update]: {\n\t\tkind: \"pslBlock\",\n\t\tkeyword: POLICY_BLOCK_KEYWORDS.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\tspec: policyBothPredicatesSpec,\n\t\trequiresModelAttribute: policyRequiresRls,\n\t\tattributes: policyBlockAttributes\n\t},\n\t[POLICY_BLOCK_KEYWORDS.all]: {\n\t\tkind: \"pslBlock\",\n\t\tkeyword: POLICY_BLOCK_KEYWORDS.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\tspec: policyBothPredicatesSpec,\n\t\trequiresModelAttribute: policyRequiresRls,\n\t\tattributes: policyBlockAttributes\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\tspec: nativeEnumSpec,\n\t\tnameIsStorageName: 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\tspec: roleSpec\n\t}\n};\nconst postgresRlsSpec = modelAttribute(\"rls\", { documentation: \"Enables PostgreSQL row-level security on this model’s table.\" });\nconst postgresRlsSpecFactory = () => postgresRlsSpec;\nconst [firstLanguage, ...remainingLanguages] = POSTGRES_TEXT_SEARCH_LANGUAGES;\nconst fullTextField = fieldRef();\nfunction postgresFullTextIndexSpec(ctx) {\n\treturn modelAttribute(\"fullTextIndex\", {\n\t\tdocumentation: \"Indexes text fields for full-text search. Each item of the list is a weight group, strongest first; a nested list puts several fields in one group. Pass the index from the table's `indexes` to `fullTextMatches` and `fullTextRank` to search the same document.\",\n\t\tpositional: [{\n\t\t\tkey: \"fields\",\n\t\t\ttype: oneOf(fullTextField, list(oneOf(fullTextField, list(fullTextField)), {\n\t\t\t\tallowEmpty: false,\n\t\t\t\tlabel: \"(field name | field name[])[]\"\n\t\t\t})),\n\t\t\tdocumentation: \"The fields to index: one field, or a list of fields and lists of fields. Each top-level item is a weight group, from A down to D.\"\n\t\t}],\n\t\tnamed: {\n\t\t\tlanguage: {\n\t\t\t\ttype: optional(oneOf(str(firstLanguage), ...remainingLanguages.map((language) => str(language)))),\n\t\t\t\tdocumentation: \"The text-search configuration. Defaults to `english`, and must match the language the query operations are given.\"\n\t\t\t},\n\t\t\tname: {\n\t\t\t\ttype: optional(str()),\n\t\t\t\tdocumentation: \"The index name. Mutually exclusive with `map`.\"\n\t\t\t},\n\t\t\tmap: {\n\t\t\t\ttype: optional(str()),\n\t\t\t\tdocumentation: \"The database index name. Mutually exclusive with `name`.\"\n\t\t\t},\n\t\t\twhere: {\n\t\t\t\ttype: optional(dataTypeValue(SQL_EXPRESSION_DATA_TYPE_ID, ctx.dataTypes)),\n\t\t\t\tdocumentation: \"The SQL predicate restricting rows included in a partial index.\"\n\t\t\t}\n\t\t},\n\t\trefine: (value, ctx, attributeNode) => {\n\t\t\tconst diagnostics = fullTextIndexProblems({ weightGroups: weightGroupsOf(value.fields, isFieldName) }).filter(isPslFullTextIndexProblem).map((problem) => leafDiagnostic(ctx, attributeNode, describeFullTextIndexProblem(\"`@@fullTextIndex`\", problem), FULL_TEXT_INDEX_PROBLEM_CODES[problem.kind]));\n\t\t\tif (value.name === void 0 && value.map === void 0) diagnostics.push(leafDiagnostic(ctx, attributeNode, \"`@@fullTextIndex` requires a `name` or `map` argument\", PSL_FULL_TEXT_INDEX_REQUIRES_NAME));\n\t\t\tif (value.name !== void 0 && value.map !== void 0) diagnostics.push(leafDiagnostic(ctx, attributeNode, \"`@@fullTextIndex` takes at most one of `name` and `map`\", PSL_FULL_TEXT_INDEX_NAME_XOR_MAP));\n\t\t\treturn diagnostics;\n\t\t}\n\t});\n}\nfunction isFieldName(value) {\n\treturn typeof value === \"string\";\n}\nfunction isPslFullTextIndexProblem(problem) {\n\treturn problem.kind !== \"unique\" && problem.kind !== \"no-fields\";\n}\nconst FULL_TEXT_INDEX_PROBLEM_CODES = {\n\t\"too-many-groups\": PSL_FULL_TEXT_INDEX_TOO_MANY_GROUPS,\n\t\"empty-group\": PSL_FULL_TEXT_INDEX_EMPTY_GROUP,\n\t\"duplicate-field\": PSL_FULL_TEXT_INDEX_DUPLICATE_FIELD,\n\t\"not-text\": PSL_FULL_TEXT_INDEX_TEXT_FIELD\n};\nconst postgresFullTextIndexSpecFactory = (ctx) => postgresFullTextIndexSpec(ctx);\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 = {\n\trls: {\n\t\tkind: \"modelAttribute\",\n\t\tattribute: \"rls\",\n\t\tspec: postgresRlsSpecFactory,\n\t\tlower: (_parsed, ctx) => ({\n\t\t\tkey: ctx.storageName,\n\t\t\tentity: new PostgresRlsEnablement({\n\t\t\t\ttableName: ctx.storageName,\n\t\t\t\tnamespaceId: ctx.namespaceId\n\t\t\t})\n\t\t})\n\t},\n\tfullTextIndex: {\n\t\tkind: \"modelAttribute\",\n\t\tattribute: \"fullTextIndex\",\n\t\tspec: postgresFullTextIndexSpecFactory,\n\t\trepeatable: true,\n\t\tlower: (parsed, ctx) => {\n\t\t\tconst fieldGroups = weightGroupsOf(parsed.fields, isFieldName);\n\t\t\tconst problems = fullTextIndexProblems({\n\t\t\t\tweightGroups: fieldGroups,\n\t\t\t\tcodecs: {\n\t\t\t\t\tcodecIdOf: (fieldName) => ctx.fieldStorageName(fieldName) === void 0 ? void 0 : ctx.fieldCodecId(fieldName),\n\t\t\t\t\ttraitsOf: postgresCodecTraitsOf\n\t\t\t\t}\n\t\t\t}).filter(isPslFullTextIndexProblem);\n\t\t\tfor (const problem of problems) ctx.diagnostics?.push({\n\t\t\t\tcode: FULL_TEXT_INDEX_PROBLEM_CODES[problem.kind],\n\t\t\t\tmessage: describeFullTextIndexProblem(\"`@@fullTextIndex`\", problem, (fieldName) => `${ctx.modelName}.${fieldName}`),\n\t\t\t\tsourceId: ctx.sourceId ?? \"unknown\"\n\t\t\t});\n\t\t\tif (problems.length > 0) return void 0;\n\t\t\tconst weightGroups = fieldGroups.map((group) => group.map((fieldName) => {\n\t\t\t\tconst columnName = ctx.fieldStorageName(fieldName);\n\t\t\t\tassertDefined(columnName, `@@fullTextIndex field \"${fieldName}\" has no storage column`);\n\t\t\t\treturn columnName;\n\t\t\t}));\n\t\t\treturn { index: {\n\t\t\t\tcolumns: weightGroups.flat(),\n\t\t\t\ttype: FULL_TEXT_INDEX_TYPE,\n\t\t\t\toptions: {\n\t\t\t\t\tweightGroups,\n\t\t\t\t\tlanguage: parsed.language ?? \"english\"\n\t\t\t\t},\n\t\t\t\twhere: parsed.where === void 0 ? void 0 : sqlTextFromStored(parsed.where.value.value),\n\t\t\t\tunique: void 0,\n\t\t\t\tname: parsed.name,\n\t\t\t\tmap: parsed.map\n\t\t\t} };\n\t\t}\n\t}\n};\nconst postgresAuthoringFieldPresets = {\n\ttext: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: { codecId: \"pg/text@1\" }\n\t},\n\tint: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: { codecId: \"pg/int4@1\" }\n\t},\n\tbigint: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: { codecId: \"pg/int8@1\" }\n\t},\n\tfloat: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: { codecId: \"pg/float8@1\" }\n\t},\n\tdecimal: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: { codecId: \"pg/numeric@1\" }\n\t},\n\tboolean: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: { codecId: \"pg/bool@1\" }\n\t},\n\tjson: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: { codecId: \"pg/jsonb@1\" }\n\t},\n\tbytes: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: { codecId: \"pg/bytea@1\" }\n\t},\n\tdateTime: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: { codecId: \"pg/timestamptz-temporal@1\" }\n\t},\n\ttemporal: {\n\t\tcreatedAtJsDate: (/* @__PURE__ */ temporalAuthoringPresets({\n\t\t\tcodecId: PG_TIMESTAMPTZ_DATE_CODEC_ID,\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\tgeneratorId: postgresNowGeneratorIds[PG_TIMESTAMPTZ_DATE_CODEC_ID]\n\t\t})).updatedAt,\n\t\ttimestamptzJsDate: /* @__PURE__ */ temporalCodecPresetWithPrecision({\n\t\t\tsizeType: PG_SIZE_TYPE,\n\t\t\tcodecId: PG_TIMESTAMPTZ_DATE_CODEC_ID,\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\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\tgeneratorId: postgresNowGeneratorIds[PG_TIMESTAMPTZ_STRING_CODEC_ID]\n\t\t}),\n\t\ttimestamp: /* @__PURE__ */ temporalCodecPresetWithPrecision({\n\t\t\tsizeType: PG_SIZE_TYPE,\n\t\t\tcodecId: PG_TIMESTAMP_TEMPORAL_CODEC_ID,\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIMESTAMP_TEMPORAL_CODEC_ID]\n\t\t}),\n\t\ttimestamptz: /* @__PURE__ */ temporalCodecPresetWithPrecision({\n\t\t\tsizeType: PG_SIZE_TYPE,\n\t\t\tcodecId: PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID,\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID]\n\t\t}),\n\t\ttimestampString: /* @__PURE__ */ temporalCodecPresetWithPrecision({\n\t\t\tsizeType: PG_SIZE_TYPE,\n\t\t\tcodecId: PG_TIMESTAMP_STRING_CODEC_ID,\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIMESTAMP_STRING_CODEC_ID]\n\t\t}),\n\t\ttimestamptzString: /* @__PURE__ */ temporalCodecPresetWithPrecision({\n\t\t\tsizeType: PG_SIZE_TYPE,\n\t\t\tcodecId: PG_TIMESTAMPTZ_STRING_CODEC_ID,\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIMESTAMPTZ_STRING_CODEC_ID]\n\t\t}),\n\t\tdate: /* @__PURE__ */ temporalCodecPreset({\n\t\t\tcodecId: PG_DATE_TEMPORAL_CODEC_ID,\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_DATE_TEMPORAL_CODEC_ID]\n\t\t}),\n\t\tdateString: /* @__PURE__ */ temporalCodecPreset({\n\t\t\tcodecId: PG_DATE_STRING_CODEC_ID,\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_DATE_STRING_CODEC_ID]\n\t\t}),\n\t\ttime: /* @__PURE__ */ temporalCodecPresetWithPrecision({\n\t\t\tsizeType: PG_SIZE_TYPE,\n\t\t\tcodecId: PG_TIME_TEMPORAL_CODEC_ID,\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIME_TEMPORAL_CODEC_ID],\n\t\t\tnowTakesPrecision: postgresNowGeneratorTakesPrecision[PG_TIME_TEMPORAL_CODEC_ID]\n\t\t}),\n\t\ttimeString: /* @__PURE__ */ temporalCodecPresetWithPrecision({\n\t\t\tsizeType: PG_SIZE_TYPE,\n\t\t\tcodecId: PG_TIME_STRING_CODEC_ID,\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIME_STRING_CODEC_ID],\n\t\t\tnowTakesPrecision: postgresNowGeneratorTakesPrecision[PG_TIME_STRING_CODEC_ID]\n\t\t}),\n\t\t/** Produces a string: no Temporal type holds a time of day with an offset. */\n\t\ttimetz: /* @__PURE__ */ temporalCodecPresetWithPrecision({\n\t\t\tsizeType: PG_SIZE_TYPE,\n\t\t\tcodecId: PG_TIMETZ_CODEC_ID,\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIMETZ_CODEC_ID],\n\t\t\tnowTakesPrecision: postgresNowGeneratorTakesPrecision[PG_TIMETZ_CODEC_ID]\n\t\t})\n\t},\n\tuuidNative: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: { codecId: \"pg/uuid@1\" }\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\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\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};\nfunction predicateText(predicate, what) {\n\treturn predicate === void 0 ? void 0 : requireSqlExpression(predicate, what).text;\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\", predicateText(policy.using, `Policy \"${prefix}\" using`)),\n\t\t\t\t...ifDefined(\"withCheck\", predicateText(policy.withCheck, `Policy \"${prefix}\" 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 { postgresAuthoringPslBlockDescriptors as a, postgresNativeAuthoringTypes as c, postgresNowGeneratorFunction as d, postgresNowGeneratorControlDescriptors as f, postgresAuthoringModelAttributes as i, postgresPslTypeConstructors as l, postgresAuthoringEntityTypes as n, postgresAuthoringTypes as o, postgresNowGenerators as p, postgresAuthoringFieldPresets as r, postgresLowerEntityHandles as s, POLICY_BLOCK_KEYWORDS as t, postgresScalarAuthoringTypes as u };\n\n//# sourceMappingURL=authoring-NKZZKf0m.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAuBA,MAAM,2BAA2B;AACjC,MAAM,mCAAmC;AACzC,MAAM,8BAA8B;AACpC,MAAM,8BAA8B;AACpC,MAAM,oCAAoC;AAC1C,MAAM,sCAAsC;AAC5C,MAAM,+BAA+B;AACrC,MAAM,+BAA+B;AACrC,MAAM,0BAA0B;AAChC,MAAM,aAAa;AACnB,MAAM,qBAAqB;AAC3B,SAAS,iBAAiB,QAAQ;CACjC,MAAM,YAAY,SAAS;CAC3B,OAAO,OAAO,cAAc,WAAW,YAAY;AACpD;AACA,SAAS,OAAO,iBAAiB,oBAAoB;CACpD,MAAM,MAAM,IAAI,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,YAAY;CAC7C,MAAM,CAAC,eAAe,IAAI,WAAW,MAAM,IAAI,MAAM,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG;CACtE,MAAM,OAAO,SAAS,MAAM,GAAG,cAAc,CAAC,CAAC,QAAQ,OAAO,EAAE;CAChE,OAAO;EACN,MAAM,IAAI,MAAM,GAAG,EAAE;EACrB,MAAM,SAAS,KAAK,eAAe,GAAG,aAAa,GAAG;CACvD;AACD;;AAEA,SAAS,aAAa,MAAM,gBAAgB;CAC3C,IAAI,kBAAkB,GAAG,OAAO,KAAK,MAAM;EAC1C,cAAc;EACd,cAAc;CACf,CAAC;CACD,MAAM,eAAe,kBAAkB,IAAI,gB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T_CODEC_ID, T as PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID, V as SQL_VARCHAR_CODEC_ID, a as PG_DATE_STRING_CODEC_ID, b as PG_NUMERIC_CODEC_ID, c as PG_FLOAT4_CODEC_ID, f as PG_INT2_CODEC_ID, g as PG_INTERVAL_CODEC_ID, k as PG_TIME_STRING_CODEC_ID, l as PG_FLOAT8_CODEC_ID, m as PG_INT8_CODEC_ID, n as PG_BOOL_CODEC_ID, o as PG_DATE_TEMPORAL_CODEC_ID, p as PG_INT4_CODEC_ID, r as PG_BYTEA_CODEC_ID, t as PG_BIT_CODEC_ID, v as PG_JSONB_CODEC_ID, w as PG_TIMESTAMPTZ_STRING_CODEC_ID, y as PG_JSON_CODEC_ID, z as SQL_RAW_CODEC_ID } from "./codec-ids-BMhEpFwv-BLIC4g3Y.mjs";
|
|
2
|
+
import { requireSqlExpression } from "@prisma/orm-family-sql/contract/sql-expression";
|
|
2
3
|
//#region ../../../3-targets/6-adapters/postgres/dist/column-types.mjs
|
|
3
4
|
const textColumn = { codecId: PG_TEXT_CODEC_ID };
|
|
4
5
|
function charColumn(length) {
|
|
@@ -13,11 +14,12 @@ function varcharColumn(length) {
|
|
|
13
14
|
typeParams: { length }
|
|
14
15
|
};
|
|
15
16
|
}
|
|
16
|
-
/** A column of a type no other column type covers, named exactly as the database catalog prints it, such as
|
|
17
|
-
function rawColumn(
|
|
17
|
+
/** A column of a type no other column type covers, named exactly as the database catalog prints it, such as ``rawColumn(sql`tsvector`)`` (ADR 273). Its values are typed `unknown`. */
|
|
18
|
+
function rawColumn(definition) {
|
|
19
|
+
const { text } = requireSqlExpression(definition, "rawColumn(...)");
|
|
18
20
|
return {
|
|
19
21
|
codecId: SQL_RAW_CODEC_ID,
|
|
20
|
-
typeParams: { sql }
|
|
22
|
+
typeParams: { sql: text }
|
|
21
23
|
};
|
|
22
24
|
}
|
|
23
25
|
const int4Column = { codecId: PG_INT4_CODEC_ID };
|
|
@@ -101,4 +103,4 @@ const jsonbColumn = { codecId: PG_JSONB_CODEC_ID };
|
|
|
101
103
|
//#endregion
|
|
102
104
|
export { timestamptzStringColumn as C, varcharColumn as D, varbitColumn as E, timestamptzJsDateColumn as S, timetzColumn as T, textColumn as _, dateStringColumn as a, timestampStringColumn as b, float8Column as c, int8Column as d, intervalColumn as f, rawColumn as g, numericColumn as h, charColumn as i, int2Column as l, jsonbColumn as m, boolColumn as n, dateTemporalColumn as o, jsonColumn as p, byteaColumn as r, float4Column as s, bitColumn as t, int4Column as u, timeStringColumn as v, timestamptzTemporalColumn as w, timestampTemporalColumn as x, timeTemporalColumn as y };
|
|
103
105
|
|
|
104
|
-
//# sourceMappingURL=column-types-
|
|
106
|
+
//# sourceMappingURL=column-types-CI9_dRcU.mjs.map
|