@prisma/orm-target-postgres 8.0.0-rc.18-dev.29 → 8.0.0-rc.18-dev.30

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 (85) hide show
  1. package/dist/{adapter-CEZ6dg2a.d.mts → adapter-vfsQ80l6.d.mts} +8 -8
  2. package/dist/{adapter-CEZ6dg2a.d.mts.map → adapter-vfsQ80l6.d.mts.map} +1 -1
  3. package/dist/adapter.d.mts +1 -1
  4. package/dist/adapter__adapter.d.mts +1 -1
  5. package/dist/adapter__control.mjs +13 -133
  6. package/dist/adapter__control.mjs.map +1 -1
  7. package/dist/adapter__runtime.mjs +2 -2
  8. package/dist/adapter__runtime.mjs.map +1 -1
  9. package/dist/{aggregates-C2xqsGZ2.d.mts → aggregates-B3lIBjGK.d.mts} +8 -8
  10. package/dist/{aggregates-C2xqsGZ2.d.mts.map → aggregates-B3lIBjGK.d.mts.map} +1 -1
  11. package/dist/{authoring-DhyLHFHA-pB4NuFxh.mjs → authoring-DtjMn8TZ-sv84Cdw_.mjs} +18 -34
  12. package/dist/authoring-DtjMn8TZ-sv84Cdw_.mjs.map +1 -0
  13. package/dist/{control-DmWVxA23.d.mts → control-BRE_BcLl.d.mts} +2 -2
  14. package/dist/{control-DmWVxA23.d.mts.map → control-BRE_BcLl.d.mts.map} +1 -1
  15. package/dist/{descriptor-meta-Bzs7kSyA-BjbnpZLW.mjs → descriptor-meta-C0yUaYLH-CUtYbbZp.mjs} +21 -3
  16. package/dist/descriptor-meta-C0yUaYLH-CUtYbbZp.mjs.map +1 -0
  17. package/dist/{diff-database-schema-BGcRo8FM.d.mts → diff-database-schema-Diw5m51r.d.mts} +2 -2
  18. package/dist/{diff-database-schema-BGcRo8FM.d.mts.map → diff-database-schema-Diw5m51r.d.mts.map} +1 -1
  19. package/dist/{indexes-DtIXFHAb-DBubdl32.d.mts → indexes-BX4ewz3l-CPzMc0-t.d.mts} +3 -3
  20. package/dist/{indexes-DtIXFHAb-DBubdl32.d.mts.map → indexes-BX4ewz3l-CPzMc0-t.d.mts.map} +1 -1
  21. package/dist/{issue-planner-DrWlNiAf.d.mts → issue-planner-BT5rqDNx.d.mts} +3 -3
  22. package/dist/{issue-planner-DrWlNiAf.d.mts.map → issue-planner-BT5rqDNx.d.mts.map} +1 -1
  23. package/dist/{migration-DST6YA2w.d.mts → migration-BWZskUHP.d.mts} +3 -3
  24. package/dist/{migration-DST6YA2w.d.mts.map → migration-BWZskUHP.d.mts.map} +1 -1
  25. package/dist/migration-CbOh59ZJ.mjs.map +1 -1
  26. package/dist/op-factory-call-CEyI7a78.d.mts +1 -0
  27. package/dist/{op-factory-call-kdPO0kgG-DV8hS6qA.d.mts → op-factory-call-DILl2zlf-BakJezLJ.d.mts} +4 -4
  28. package/dist/{op-factory-call-kdPO0kgG-DV8hS6qA.d.mts.map → op-factory-call-DILl2zlf-BakJezLJ.d.mts.map} +1 -1
  29. package/dist/{pack-CcQNl-gj.d.mts → pack-C-rgdVoH.d.mts} +6 -1
  30. package/dist/{pack-CcQNl-gj.d.mts.map → pack-C-rgdVoH.d.mts.map} +1 -1
  31. package/dist/{planner-CE4YoVdA-BfwuVRuT.mjs → planner-BIOXTf-E-CFs_l_0M.mjs} +4 -4
  32. package/dist/{planner-CE4YoVdA-BfwuVRuT.mjs.map → planner-BIOXTf-E-CFs_l_0M.mjs.map} +1 -1
  33. package/dist/{planner-D3wWu7Kj.d.mts → planner-Bo92I5YX.d.mts} +3 -3
  34. package/dist/{planner-D3wWu7Kj.d.mts.map → planner-Bo92I5YX.d.mts.map} +1 -1
  35. package/dist/{planner-produced-postgres-migration-BRjNXwjn-DhjS0Pbw.d.mts → planner-produced-postgres-migration-C8uYGzUj-DRmZY4_u.d.mts} +3 -3
  36. package/dist/planner-produced-postgres-migration-C8uYGzUj-DRmZY4_u.d.mts.map +1 -0
  37. package/dist/planner-produced-postgres-migration-DaDlRTID.d.mts +1 -0
  38. package/dist/{planner-produced-postgres-migration-F9joIngl-C04yYu-i.mjs → planner-produced-postgres-migration-Y7bMLPPc-tZeIl3hP.mjs} +3 -3
  39. package/dist/{planner-produced-postgres-migration-F9joIngl-C04yYu-i.mjs.map → planner-produced-postgres-migration-Y7bMLPPc-tZeIl3hP.mjs.map} +1 -1
  40. package/dist/{planner-sql-checks-CxlrM4J2-VqQpmMwn.d.mts → planner-sql-checks-CWOmxltY-CoWF8Eq0.d.mts} +3 -3
  41. package/dist/{planner-sql-checks-CxlrM4J2-VqQpmMwn.d.mts.map → planner-sql-checks-CWOmxltY-CoWF8Eq0.d.mts.map} +1 -1
  42. package/dist/planner-sql-checks-Cp3fcCNc.d.mts +1 -0
  43. package/dist/{postgres-contract-view-B-bLZB7o-zpuamDXT.mjs → postgres-contract-view-Ctg2ire_-smoqnU-u.mjs} +3 -3
  44. package/dist/{postgres-contract-view-B-bLZB7o-zpuamDXT.mjs.map → postgres-contract-view-Ctg2ire_-smoqnU-u.mjs.map} +1 -1
  45. package/dist/{postgres-migration-BbXm1l5I-DDy8IgYB.mjs → postgres-migration-BdFXT6xg-BPApPGX9.mjs} +3 -3
  46. package/dist/{postgres-migration-BbXm1l5I-DDy8IgYB.mjs.map → postgres-migration-BdFXT6xg-BPApPGX9.mjs.map} +1 -1
  47. package/dist/{postgres-migration-Crcs_mmg-D1ZyiWtc.d.mts → postgres-migration-HW4fCGNb-CLkytGtG.d.mts} +3 -3
  48. package/dist/{postgres-migration-Crcs_mmg-D1ZyiWtc.d.mts.map → postgres-migration-HW4fCGNb-CLkytGtG.d.mts.map} +1 -1
  49. package/dist/{prisma7-binding-C5RLV6kJ.d.mts → prisma7-binding-BXyT6bKE.d.mts} +6 -10
  50. package/dist/prisma7-binding-BXyT6bKE.d.mts.map +1 -0
  51. package/dist/{prisma7-binding-CS42flik.mjs → prisma7-binding-DWeHpJrg.mjs} +3 -5
  52. package/dist/prisma7-binding-DWeHpJrg.mjs.map +1 -0
  53. package/dist/target.d.mts +15 -15
  54. package/dist/target.mjs +7 -7
  55. package/dist/target__aggregates.d.mts +1 -1
  56. package/dist/target__control.d.mts +1 -1
  57. package/dist/target__control.mjs +76 -143
  58. package/dist/target__control.mjs.map +1 -1
  59. package/dist/target__diff-database-schema.d.mts +1 -1
  60. package/dist/target__issue-planner.d.mts +1 -1
  61. package/dist/target__migration.d.mts +2 -2
  62. package/dist/target__migration.mjs +1 -1
  63. package/dist/target__op-factory-call.d.mts +2 -2
  64. package/dist/target__pack.d.mts +1 -1
  65. package/dist/target__pack.mjs +1 -1
  66. package/dist/target__planner-produced-postgres-migration.d.mts +2 -2
  67. package/dist/target__planner-produced-postgres-migration.mjs +1 -1
  68. package/dist/target__planner-sql-checks.d.mts +2 -2
  69. package/dist/target__planner.d.mts +1 -1
  70. package/dist/target__planner.mjs +1 -1
  71. package/dist/target__prisma7-binding.d.mts +1 -1
  72. package/dist/target__prisma7-binding.mjs +1 -1
  73. package/dist/target__runtime.mjs +2 -2
  74. package/dist/target__runtime.mjs.map +1 -1
  75. package/dist/{type-constructors-C4QD_3HB-Czhx8fAX.mjs → type-constructors-BEZJxWcZ-Co2GJw1M.mjs} +4 -4
  76. package/dist/{type-constructors-C4QD_3HB-Czhx8fAX.mjs.map → type-constructors-BEZJxWcZ-Co2GJw1M.mjs.map} +1 -1
  77. package/package.json +9 -9
  78. package/dist/authoring-DhyLHFHA-pB4NuFxh.mjs.map +0 -1
  79. package/dist/descriptor-meta-Bzs7kSyA-BjbnpZLW.mjs.map +0 -1
  80. package/dist/op-factory-call-CijzNDaJ.d.mts +0 -1
  81. package/dist/planner-produced-postgres-migration-BRjNXwjn-DhjS0Pbw.d.mts.map +0 -1
  82. package/dist/planner-produced-postgres-migration-CiHKwaE_.d.mts +0 -1
  83. package/dist/planner-sql-checks-CB4oLSuZ.d.mts +0 -1
  84. package/dist/prisma7-binding-C5RLV6kJ.d.mts.map +0 -1
  85. package/dist/prisma7-binding-CS42flik.mjs.map +0 -1
@@ -1,2 +1,2 @@
1
- import { t as buildPostgresPlanDiff } from "./diff-database-schema-BGcRo8FM.mjs";
1
+ import { t as buildPostgresPlanDiff } from "./diff-database-schema-Diw5m51r.mjs";
2
2
  export { buildPostgresPlanDiff };
@@ -1,2 +1,2 @@
1
- import { n as planIssues, t as coalesceSubtreeIssues } from "./issue-planner-DrWlNiAf.mjs";
1
+ import { n as planIssues, t as coalesceSubtreeIssues } from "./issue-planner-BT5rqDNx.mjs";
2
2
  export { coalesceSubtreeIssues, planIssues };
@@ -1,4 +1,4 @@
1
1
  import { i as dataTransform, r as DataTransformOptions, t as DataTransformClosure } from "./data-transform-nGy9rz87-CEOXAj91.mjs";
2
- import { t as PostgresMigration } from "./postgres-migration-Crcs_mmg-D1ZyiWtc.mjs";
3
- import { a as fn, c as placeholder, d as sql, f as unique, i as createExtension, l as primaryKey, n as checkExpression, o as foreignKey, r as col, s as lit, t as MigrationCLI, u as rawSql } from "./migration-DST6YA2w.mjs";
2
+ import { t as PostgresMigration } from "./postgres-migration-HW4fCGNb-CLkytGtG.mjs";
3
+ import { a as fn, c as placeholder, d as sql, f as unique, i as createExtension, l as primaryKey, n as checkExpression, o as foreignKey, r as col, s as lit, t as MigrationCLI, u as rawSql } from "./migration-BWZskUHP.mjs";
4
4
  export { type DataTransformClosure, type DataTransformOptions, PostgresMigration as Migration, MigrationCLI, checkExpression, col, createExtension, dataTransform, fn, foreignKey, lit, placeholder, primaryKey, rawSql, sql, unique };
@@ -1,5 +1,5 @@
1
1
  import { R as createExtension } from "./op-factory-call-No9Z2tdw-Lap8xvVy.mjs";
2
2
  import { t as dataTransform } from "./data-transform-CtHnNYhF-r19375h3.mjs";
3
- import { t as PostgresMigration } from "./postgres-migration-BbXm1l5I-DDy8IgYB.mjs";
3
+ import { t as PostgresMigration } from "./postgres-migration-BdFXT6xg-BPApPGX9.mjs";
4
4
  import { a as foreignKey, c as primaryKey, d as unique, i as fn, l as rawSql, n as checkExpression, o as lit, r as col, s as placeholder, t as MigrationCLI, u as sql } from "./migration-CbOh59ZJ.mjs";
5
5
  export { PostgresMigration as Migration, MigrationCLI, checkExpression, col, createExtension, dataTransform, fn, foreignKey, lit, placeholder, primaryKey, rawSql, sql, unique };
@@ -1,3 +1,3 @@
1
- import { A as RenameColumnCall, C as DropNativeEnumTypeCall, D as EnableRowLevelSecurityCall, E as DropTableCall, F as SetDefaultCall, I as SetNotNullCall, M as RenameIndexCall, N as RenamePostgresRlsPolicyCall, P as RenameTableCall, S as DropIndexCall, T as DropPostgresRlsPolicyCall, _ as DisableRowLevelSecurityCall, a as AddNativeEnumValueCall, b as DropConstraintCall, c as AddUniqueCall, d as CreateIndexCall, f as CreateNativeEnumTypeCall, g as DataTransformCall, h as CreateTableCall, i as AddForeignKeyCall, j as RenameConstraintCall, k as RawSqlCall, l as AlterColumnTypeCall, m as CreateSchemaCall, n as AddColumnCall, o as AddPrimaryKeyCall, p as CreatePostgresRlsPolicyCall, r as AddColumnWithTemporaryDefaultCall, s as AddRequiredColumnToEmptyTableCall, t as AddCheckConstraintCall, u as CreateExtensionCall, v as DropCheckConstraintCall, w as DropNotNullCall, x as DropDefaultCall, y as DropColumnCall } from "./op-factory-call-kdPO0kgG-DV8hS6qA.mjs";
2
- import "./op-factory-call-CijzNDaJ.mjs";
1
+ import { A as RenameColumnCall, C as DropNativeEnumTypeCall, D as EnableRowLevelSecurityCall, E as DropTableCall, F as SetDefaultCall, I as SetNotNullCall, M as RenameIndexCall, N as RenamePostgresRlsPolicyCall, P as RenameTableCall, S as DropIndexCall, T as DropPostgresRlsPolicyCall, _ as DisableRowLevelSecurityCall, a as AddNativeEnumValueCall, b as DropConstraintCall, c as AddUniqueCall, d as CreateIndexCall, f as CreateNativeEnumTypeCall, g as DataTransformCall, h as CreateTableCall, i as AddForeignKeyCall, j as RenameConstraintCall, k as RawSqlCall, l as AlterColumnTypeCall, m as CreateSchemaCall, n as AddColumnCall, o as AddPrimaryKeyCall, p as CreatePostgresRlsPolicyCall, r as AddColumnWithTemporaryDefaultCall, s as AddRequiredColumnToEmptyTableCall, t as AddCheckConstraintCall, u as CreateExtensionCall, v as DropCheckConstraintCall, w as DropNotNullCall, x as DropDefaultCall, y as DropColumnCall } from "./op-factory-call-DILl2zlf-BakJezLJ.mjs";
2
+ import "./op-factory-call-CEyI7a78.mjs";
3
3
  export { AddCheckConstraintCall, AddColumnCall, AddColumnWithTemporaryDefaultCall, AddForeignKeyCall, AddNativeEnumValueCall, AddPrimaryKeyCall, AddRequiredColumnToEmptyTableCall, AddUniqueCall, AlterColumnTypeCall, CreateExtensionCall, CreateIndexCall, CreateNativeEnumTypeCall, CreatePostgresRlsPolicyCall, CreateSchemaCall, CreateTableCall, DataTransformCall, DisableRowLevelSecurityCall, DropCheckConstraintCall, DropColumnCall, DropConstraintCall, DropDefaultCall, DropIndexCall, DropNativeEnumTypeCall, DropNotNullCall, DropPostgresRlsPolicyCall, DropTableCall, EnableRowLevelSecurityCall, RawSqlCall, RenameColumnCall, RenameConstraintCall, RenameIndexCall, RenamePostgresRlsPolicyCall, RenameTableCall, SetDefaultCall, SetNotNullCall };
@@ -1,3 +1,3 @@
1
1
  import { p as TsqueryParser, t as FullTextDocument } from "./operation-types-CK6URXeD-BsCK-mcK.mjs";
2
- import { t as postgresTargetDescriptorMeta } from "./pack-CcQNl-gj.mjs";
2
+ import { t as postgresTargetDescriptorMeta } from "./pack-C-rgdVoH.mjs";
3
3
  export { type FullTextDocument, type TsqueryParser, postgresTargetDescriptorMeta as default };
@@ -1,2 +1,2 @@
1
- import { t as postgresTargetDescriptorMeta } from "./descriptor-meta-Bzs7kSyA-BjbnpZLW.mjs";
1
+ import { t as postgresTargetDescriptorMeta } from "./descriptor-meta-C0yUaYLH-CUtYbbZp.mjs";
2
2
  export { postgresTargetDescriptorMeta as default };
@@ -1,3 +1,3 @@
1
- import { t as TypeScriptRenderablePostgresMigration } from "./planner-produced-postgres-migration-BRjNXwjn-DhjS0Pbw.mjs";
2
- import "./planner-produced-postgres-migration-CiHKwaE_.mjs";
1
+ import { t as TypeScriptRenderablePostgresMigration } from "./planner-produced-postgres-migration-C8uYGzUj-DRmZY4_u.mjs";
2
+ import "./planner-produced-postgres-migration-DaDlRTID.mjs";
3
3
  export { TypeScriptRenderablePostgresMigration };
@@ -1,2 +1,2 @@
1
- import { t as TypeScriptRenderablePostgresMigration } from "./planner-produced-postgres-migration-F9joIngl-C04yYu-i.mjs";
1
+ import { t as TypeScriptRenderablePostgresMigration } from "./planner-produced-postgres-migration-Y7bMLPPc-tZeIl3hP.mjs";
2
2
  export { TypeScriptRenderablePostgresMigration };
@@ -1,3 +1,3 @@
1
- import { i as stackDataTypes, n as alterTypeCheck, r as qualifyTableName, t as ColumnTypeCheck } from "./planner-sql-checks-CxlrM4J2-VqQpmMwn.mjs";
2
- import "./planner-sql-checks-CB4oLSuZ.mjs";
1
+ import { i as stackDataTypes, n as alterTypeCheck, r as qualifyTableName, t as ColumnTypeCheck } from "./planner-sql-checks-CWOmxltY-CoWF8Eq0.mjs";
2
+ import "./planner-sql-checks-Cp3fcCNc.mjs";
3
3
  export { type ColumnTypeCheck, alterTypeCheck, qualifyTableName, stackDataTypes };
@@ -1,2 +1,2 @@
1
- import { n as createPostgresMigrationPlanner, t as contractToPostgresDatabaseSchemaNode } from "./planner-D3wWu7Kj.mjs";
1
+ import { n as createPostgresMigrationPlanner, t as contractToPostgresDatabaseSchemaNode } from "./planner-Bo92I5YX.mjs";
2
2
  export { contractToPostgresDatabaseSchemaNode, createPostgresMigrationPlanner };
@@ -1,3 +1,3 @@
1
1
  import { n as contractToPostgresDatabaseSchemaNode } from "./diff-database-schema-DyCIRT80-C1zMCmRx.mjs";
2
- import { t as createPostgresMigrationPlanner } from "./planner-CE4YoVdA-BfwuVRuT.mjs";
2
+ import { t as createPostgresMigrationPlanner } from "./planner-BIOXTf-E-CFs_l_0M.mjs";
3
3
  export { contractToPostgresDatabaseSchemaNode, createPostgresMigrationPlanner };
@@ -1,2 +1,2 @@
1
- import { t as prisma7PostgresBinding } from "./prisma7-binding-C5RLV6kJ.mjs";
1
+ import { t as prisma7PostgresBinding } from "./prisma7-binding-BXyT6bKE.mjs";
2
2
  export { prisma7PostgresBinding };
@@ -1,2 +1,2 @@
1
- import { t as prisma7PostgresBinding } from "./prisma7-binding-CS42flik.mjs";
1
+ import { t as prisma7PostgresBinding } from "./prisma7-binding-DWeHpJrg.mjs";
2
2
  export { prisma7PostgresBinding };
@@ -2,10 +2,10 @@ import { S as PG_TEXT_CODEC_ID, c as PG_FLOAT4_CODEC_ID, j as PG_TSQUERY_CODEC_I
2
2
  import { c as postgresError } from "./errors-BrhQYgdL-D_lIrddD.mjs";
3
3
  import { i as decodePostgresListText } from "./codecs-UZ1NEbvk-CMnI6Ti0.mjs";
4
4
  import { c as fullTextIndexOptions, n as FULL_TEXT_INDEX_TYPE } from "./full-text-index-definition-BPxQQBuC-BrpDsuJu.mjs";
5
- import { u as postgresNowGenerators } from "./authoring-DhyLHFHA-pB4NuFxh.mjs";
5
+ import { u as postgresNowGenerators } from "./authoring-DtjMn8TZ-sv84Cdw_.mjs";
6
6
  import { t as postgresTargetDescriptorMetaRuntime } from "./descriptor-meta-runtime-C1AjrKaP-CYer0qt7.mjs";
7
7
  import { t as renderFullTextDocument } from "./full-text-search-document-Doy5TF7c-DezgYsP-.mjs";
8
- import { n as PostgresContractView, t as PostgresContractSerializer } from "./postgres-contract-view-B-bLZB7o-zpuamDXT.mjs";
8
+ import { n as PostgresContractView, t as PostgresContractSerializer } from "./postgres-contract-view-Ctg2ire_-smoqnU-u.mjs";
9
9
  import { a as normalizationLiteral, c as toTsquery, i as languageLiteral, l as websearchToTsquery, o as phrasetoTsquery, r as headlineOptionsLiteral, s as plaintoTsquery, t as FullTextDocument } from "./full-text-parsers-CrMjTR2n-CHDNR_vE.mjs";
10
10
  import { blindCast } from "@prisma/orm-framework/utils/casts";
11
11
  import { type } from "arktype";
@@ -1 +1 @@
1
- {"version":3,"file":"target__runtime.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/runtime.mjs"],"sourcesContent":["import { S as PG_TEXT_CODEC_ID, c as PG_FLOAT4_CODEC_ID, j as PG_TSQUERY_CODEC_ID, n as PG_BOOL_CODEC_ID } from \"./codec-ids-Cb0yO-IS.mjs\";\nimport { c as postgresError } from \"./errors-BrhQYgdL.mjs\";\nimport { D as decodePostgresListText } from \"./codecs-UZ1NEbvk.mjs\";\nimport { a as fullTextIndexOptions, t as FULL_TEXT_INDEX_TYPE } from \"./full-text-index-definition-BPxQQBuC.mjs\";\nimport { u as postgresNowGenerators } from \"./authoring-DhyLHFHA.mjs\";\nimport { t as postgresTargetDescriptorMetaRuntime } from \"./descriptor-meta-runtime-C1AjrKaP.mjs\";\nimport { t as renderFullTextDocument } from \"./full-text-search-document-Doy5TF7c.mjs\";\nimport { n as PostgresContractSerializer, t as PostgresContractView } from \"./postgres-contract-view-B-bLZB7o.mjs\";\nimport { a as headlineOptionsLiteral, c as FullTextDocument, i as websearchToTsquery, n as plaintoTsquery, o as languageLiteral, r as toTsquery, s as normalizationLiteral, t as phrasetoTsquery } from \"./full-text-parsers-CrMjTR2n.mjs\";\nimport { type } from \"arktype\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { assertDefined } from \"@internal/utils/assertions\";\nimport { buildOperation, isExpression, toExpr } from \"@internal/sql-relational-core/expression\";\nimport { uniqueIndexNamesOfType } from \"@internal/sql-relational-core/index-reference\";\n//#region src/core/full-text-collection-method.ts\nfunction indexFunction(tools, name) {\n\treturn blindCast(tools.fns[name]);\n}\nfunction fullTextMethod(indexName) {\n\treturn (collection, ...args) => collection.where((_model, tools) => indexFunction(tools, \"fullTextMatches\")(tools.indexes[indexName], ...args)).orderBy((_model, tools) => indexFunction(tools, \"fullTextRank\")(tools.indexes[indexName], ...args).desc());\n}\n/** The run-time half of `PostgresFullTextMethods`. */\nconst postgresFullTextMethods = {\n\tid: \"postgres/fullText\",\n\tmethodsFor: (model) => Object.fromEntries(uniqueIndexNamesOfType(model.table.indexes, FULL_TEXT_INDEX_TYPE).map((name) => [name, fullTextMethod(name)]))\n};\n//#endregion\n//#region src/core/query-operations.ts\nconst TEXT_REF = { codecId: PG_TEXT_CODEC_ID };\nconst TSQUERY_REF = { codecId: PG_TSQUERY_CODEC_ID };\nconst languageOf = (options) => options.language ?? \"english\";\nfunction isIndexReference(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value) && !isExpression(value) && \"type\" in value && \"options\" in value && \"columns\" in value;\n}\nfunction invalidDocument(method, argument, received, message, fix) {\n\treturn postgresError(\"RUNTIME.ARGUMENT_INVALID\", `${method}: ${message}`, {\n\t\twhy: \"Postgres uses a full-text index only for a query over the same search document, so the document comes from the index itself, from one column, or from `fullTextDocument`.\",\n\t\tfix,\n\t\tmeta: {\n\t\t\thelper: method,\n\t\t\targument,\n\t\t\treceived\n\t\t}\n\t});\n}\n/**\n* The weight groups and the language a search document stands for. A full-text index states both;\n* a column and a `fullTextDocument` take the language from the options.\n*/\nfunction documentGroups(method, document, options) {\n\tif (document instanceof FullTextDocument) return {\n\t\tweightGroups: document.weightGroups,\n\t\tlanguage: languageOf(options)\n\t};\n\tif (isExpression(document)) return {\n\t\tweightGroups: [[document]],\n\t\tlanguage: languageOf(options)\n\t};\n\tif (!isIndexReference(document)) throw invalidDocument(method, \"document\", Array.isArray(document) ? \"array\" : typeof document, \"the document must be a full-text index from a table's `indexes`, a column, or a document from `fullTextDocument`.\", \"Pass the index, as `table.indexes.<name>`, or wrap the weight groups in `fullTextDocument(...)`.\");\n\tif (document.type !== \"fullText\") throw invalidDocument(method, \"document\", document.type, `the index is of type \"${String(document.type)}\", not a full-text index.`, \"Pass an index declared with `@@fullTextIndex` or `fullTextIndex`.\");\n\tif (options.language !== void 0) throw invalidDocument(method, \"options\", options.language, \"a full-text index states its language, so the `language` option is not taken with one.\", \"Leave `language` out; the index decides it.\");\n\tconst definition = fullTextIndexOptions(document.options ?? {});\n\tif (definition instanceof type.errors) throw invalidDocument(method, \"document\", document.options, `the full-text index has invalid options: ${definition.summary}`, \"Pass the index as the table gives it.\");\n\tconst columns = document.columns;\n\tconst columnOf = (name) => {\n\t\tconst column = typeof columns === \"object\" && columns !== null && Object.hasOwn(columns, name) ? Reflect.get(columns, name) : void 0;\n\t\tif (!isExpression(column)) throw invalidDocument(method, \"document\", name, `the full-text index has no column \"${name}\", which its weight groups name.`, \"Pass the index as the table gives it.\");\n\t\treturn column;\n\t};\n\treturn {\n\t\tweightGroups: definition.weightGroups.map((group) => group.map(columnOf)),\n\t\tlanguage: definition.language\n\t};\n}\n/**\n* The search document an operation searches. The first column is the operation's `self`; the\n* others follow the `fixedArgs` the operation passes first, so the query, the language and any\n* further option keep their positions.\n*/\nfunction searchDocument(method, document, options, fixedArgs) {\n\tconst { weightGroups, language } = documentGroups(method, document, options);\n\tlet position = 0;\n\tconst template = renderFullTextDocument(weightGroups.map((group) => group.map(() => position++)), {\n\t\tcolumn: (index) => index === 0 ? \"{{self}}\" : `{{arg${fixedArgs + index - 1}}}`,\n\t\tlanguage: \"{{arg1}}\"\n\t});\n\tconst [self, ...rest] = weightGroups.flat().map((column) => toExpr(column));\n\tassertDefined(self, `${method}: a checked document has a first column`);\n\treturn {\n\t\tself,\n\t\trest,\n\t\ttemplate,\n\t\tlanguage: languageLiteral(method, language)\n\t};\n}\nfunction postgresQueryOperations() {\n\treturn {\n\t\tilike: {\n\t\t\tself: { traits: [\"textual\"] },\n\t\t\timpl: (self, pattern) => buildOperation({\n\t\t\t\tmethod: \"ilike\",\n\t\t\t\targs: [toExpr(self), toExpr(pattern, TEXT_REF)],\n\t\t\t\treturns: {\n\t\t\t\t\tcodecId: PG_BOOL_CODEC_ID,\n\t\t\t\t\tnullable: false\n\t\t\t\t},\n\t\t\t\tlowering: {\n\t\t\t\t\ttargetFamily: \"sql\",\n\t\t\t\t\ttemplate: \"{{self}} ILIKE {{arg0}}\"\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\t\tfullTextMatches: {\n\t\t\tself: { traits: [\"textual\"] },\n\t\t\timpl: (document, query, options = {}) => {\n\t\t\t\tconst searched = searchDocument(\"fullTextMatches\", document, options, 2);\n\t\t\t\treturn buildOperation({\n\t\t\t\t\tmethod: \"fullTextMatches\",\n\t\t\t\t\targs: [\n\t\t\t\t\t\tsearched.self,\n\t\t\t\t\t\ttoExpr(query, TSQUERY_REF),\n\t\t\t\t\t\tsearched.language,\n\t\t\t\t\t\t...searched.rest\n\t\t\t\t\t],\n\t\t\t\t\treturns: {\n\t\t\t\t\t\tcodecId: PG_BOOL_CODEC_ID,\n\t\t\t\t\t\tnullable: false\n\t\t\t\t\t},\n\t\t\t\t\tlowering: {\n\t\t\t\t\t\ttargetFamily: \"sql\",\n\t\t\t\t\t\ttemplate: `${searched.template} @@ {{arg0}}`\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\tfullTextRank: {\n\t\t\tself: { traits: [\"textual\"] },\n\t\t\timpl: (document, query, options = {}) => {\n\t\t\t\tconst fn = options.coverDensity === true ? \"ts_rank_cd\" : \"ts_rank\";\n\t\t\t\tconst normalization = options.normalization === void 0 ? void 0 : normalizationLiteral(\"fullTextRank\", options.normalization);\n\t\t\t\tconst searched = searchDocument(\"fullTextRank\", document, options, normalization === void 0 ? 2 : 3);\n\t\t\t\tconst fixed = normalization === void 0 ? [searched.language] : [searched.language, normalization];\n\t\t\t\treturn buildOperation({\n\t\t\t\t\tmethod: \"fullTextRank\",\n\t\t\t\t\targs: [\n\t\t\t\t\t\tsearched.self,\n\t\t\t\t\t\ttoExpr(query, TSQUERY_REF),\n\t\t\t\t\t\t...fixed,\n\t\t\t\t\t\t...searched.rest\n\t\t\t\t\t],\n\t\t\t\t\treturns: {\n\t\t\t\t\t\tcodecId: PG_FLOAT4_CODEC_ID,\n\t\t\t\t\t\tnullable: false\n\t\t\t\t\t},\n\t\t\t\t\tlowering: {\n\t\t\t\t\t\ttargetFamily: \"sql\",\n\t\t\t\t\t\ttemplate: `${fn}(${searched.template}, {{arg0}}${normalization === void 0 ? \"\" : \", {{arg2}}\"})`\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\tfullTextHeadline: {\n\t\t\tself: { traits: [\"textual\"] },\n\t\t\timpl: (self, query, options = {}) => {\n\t\t\t\tconst headlineOptions = headlineOptionsLiteral(\"fullTextHeadline\", options);\n\t\t\t\tconst base = \"ts_headline({{arg1}}, {{self}}, {{arg0}}\";\n\t\t\t\treturn buildOperation({\n\t\t\t\t\tmethod: \"fullTextHeadline\",\n\t\t\t\t\targs: [\n\t\t\t\t\t\ttoExpr(self),\n\t\t\t\t\t\ttoExpr(query, TSQUERY_REF),\n\t\t\t\t\t\tlanguageLiteral(\"fullTextHeadline\", languageOf(options)),\n\t\t\t\t\t\t...headlineOptions === void 0 ? [] : [headlineOptions]\n\t\t\t\t\t],\n\t\t\t\t\treturns: {\n\t\t\t\t\t\tcodecId: PG_TEXT_CODEC_ID,\n\t\t\t\t\t\tnullable: false\n\t\t\t\t\t},\n\t\t\t\t\tlowering: {\n\t\t\t\t\t\ttargetFamily: \"sql\",\n\t\t\t\t\t\ttemplate: `${base}${headlineOptions === void 0 ? \"\" : \", {{arg2}}\"})`\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\twebsearchToTsquery: { impl: websearchToTsquery },\n\t\ttoTsquery: { impl: toTsquery },\n\t\tplaintoTsquery: { impl: plaintoTsquery },\n\t\tphrasetoTsquery: { impl: phrasetoTsquery }\n\t};\n}\n//#endregion\n//#region src/exports/runtime.ts\n/**\n* Target-postgres deliberately does NOT import `SqlRuntimeTargetDescriptor` from `@internal/sql-runtime`. The target package is a control-plane residence and must not pull the SQL execution-plane package into its dependency closure. The runtime descriptor here is shaped to satisfy the framework's `RuntimeTargetDescriptor` plus the structural `SqlStaticContributions` (`codecs:` returning a descriptor list) that\n* `@internal/sql-runtime` consumers narrow to at composition time.\n*\n* The target itself contributes no codecs — postgres-specific codecs ship from the postgres adapter and from extension packs (pgvector, arktype-json, etc.).\n*/\nconst postgresRuntimeTargetDescriptor = {\n\t...postgresTargetDescriptorMetaRuntime,\n\tcodecs: () => [],\n\tlistDecoder: () => decodePostgresListText,\n\tqueryOperations: () => postgresQueryOperations(),\n\tcollectionMethods: () => [postgresFullTextMethods],\n\tcreate() {\n\t\treturn {\n\t\t\tfamilyId: \"sql\",\n\t\t\ttargetId: \"postgres\"\n\t\t};\n\t}\n};\n//#endregion\nexport { PostgresContractSerializer, PostgresContractView, decodePostgresListText, postgresRuntimeTargetDescriptor as default, postgresNowGenerators };\n\n//# sourceMappingURL=runtime.mjs.map"],"mappings":";;;;;;;;;;;;;;;AAeA,SAAS,cAAc,OAAO,MAAM;CACnC,OAAO,UAAU,MAAM,IAAI,KAAK;AACjC;AACA,SAAS,eAAe,WAAW;CAClC,QAAQ,YAAY,GAAG,SAAS,WAAW,OAAO,QAAQ,UAAU,cAAc,OAAO,iBAAiB,CAAC,CAAC,MAAM,QAAQ,YAAY,GAAG,IAAI,CAAC,CAAC,CAAC,SAAS,QAAQ,UAAU,cAAc,OAAO,cAAc,CAAC,CAAC,MAAM,QAAQ,YAAY,GAAG,IAAI,CAAC,CAAC,KAAK,CAAC;AAC1P;;AAEA,MAAM,0BAA0B;CAC/B,IAAI;CACJ,aAAa,UAAU,OAAO,YAAY,uBAAuB,MAAM,MAAM,SAAS,oBAAoB,CAAC,CAAC,KAAK,SAAS,CAAC,MAAM,eAAe,IAAI,CAAC,CAAC,CAAC;AACxJ;AAGA,MAAM,WAAW,EAAE,SAAS,iBAAiB;AAC7C,MAAM,cAAc,EAAE,SAAS,oBAAoB;AACnD,MAAM,cAAc,YAAY,QAAQ,YAAY;AACpD,SAAS,iBAAiB,OAAO;CAChC,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK,KAAK,CAAC,aAAa,KAAK,KAAK,UAAU,SAAS,aAAa,SAAS,aAAa;AAC9J;AACA,SAAS,gBAAgB,QAAQ,UAAU,UAAU,SAAS,KAAK;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MAAM,kCAAkC;CACvC,GAAG;CACH,cAAc,CAAC;CACf,mBAAmB;CACnB,uBAAuB,wBAAwB;CAC/C,yBAAyB,CAAC,uBAAuB;CACjD,SAAS;EACR,OAAO;GACN,UAAU;GACV,UAAU;EACX;CACD;AACD"}
1
+ {"version":3,"file":"target__runtime.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/runtime.mjs"],"sourcesContent":["import { S as PG_TEXT_CODEC_ID, c as PG_FLOAT4_CODEC_ID, j as PG_TSQUERY_CODEC_ID, n as PG_BOOL_CODEC_ID } from \"./codec-ids-Cb0yO-IS.mjs\";\nimport { c as postgresError } from \"./errors-BrhQYgdL.mjs\";\nimport { D as decodePostgresListText } from \"./codecs-UZ1NEbvk.mjs\";\nimport { a as fullTextIndexOptions, t as FULL_TEXT_INDEX_TYPE } from \"./full-text-index-definition-BPxQQBuC.mjs\";\nimport { u as postgresNowGenerators } from \"./authoring-DtjMn8TZ.mjs\";\nimport { t as postgresTargetDescriptorMetaRuntime } from \"./descriptor-meta-runtime-C1AjrKaP.mjs\";\nimport { t as renderFullTextDocument } from \"./full-text-search-document-Doy5TF7c.mjs\";\nimport { n as PostgresContractSerializer, t as PostgresContractView } from \"./postgres-contract-view-Ctg2ire_.mjs\";\nimport { a as headlineOptionsLiteral, c as FullTextDocument, i as websearchToTsquery, n as plaintoTsquery, o as languageLiteral, r as toTsquery, s as normalizationLiteral, t as phrasetoTsquery } from \"./full-text-parsers-CrMjTR2n.mjs\";\nimport { type } from \"arktype\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { assertDefined } from \"@internal/utils/assertions\";\nimport { buildOperation, isExpression, toExpr } from \"@internal/sql-relational-core/expression\";\nimport { uniqueIndexNamesOfType } from \"@internal/sql-relational-core/index-reference\";\n//#region src/core/full-text-collection-method.ts\nfunction indexFunction(tools, name) {\n\treturn blindCast(tools.fns[name]);\n}\nfunction fullTextMethod(indexName) {\n\treturn (collection, ...args) => collection.where((_model, tools) => indexFunction(tools, \"fullTextMatches\")(tools.indexes[indexName], ...args)).orderBy((_model, tools) => indexFunction(tools, \"fullTextRank\")(tools.indexes[indexName], ...args).desc());\n}\n/** The run-time half of `PostgresFullTextMethods`. */\nconst postgresFullTextMethods = {\n\tid: \"postgres/fullText\",\n\tmethodsFor: (model) => Object.fromEntries(uniqueIndexNamesOfType(model.table.indexes, FULL_TEXT_INDEX_TYPE).map((name) => [name, fullTextMethod(name)]))\n};\n//#endregion\n//#region src/core/query-operations.ts\nconst TEXT_REF = { codecId: PG_TEXT_CODEC_ID };\nconst TSQUERY_REF = { codecId: PG_TSQUERY_CODEC_ID };\nconst languageOf = (options) => options.language ?? \"english\";\nfunction isIndexReference(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value) && !isExpression(value) && \"type\" in value && \"options\" in value && \"columns\" in value;\n}\nfunction invalidDocument(method, argument, received, message, fix) {\n\treturn postgresError(\"RUNTIME.ARGUMENT_INVALID\", `${method}: ${message}`, {\n\t\twhy: \"Postgres uses a full-text index only for a query over the same search document, so the document comes from the index itself, from one column, or from `fullTextDocument`.\",\n\t\tfix,\n\t\tmeta: {\n\t\t\thelper: method,\n\t\t\targument,\n\t\t\treceived\n\t\t}\n\t});\n}\n/**\n* The weight groups and the language a search document stands for. A full-text index states both;\n* a column and a `fullTextDocument` take the language from the options.\n*/\nfunction documentGroups(method, document, options) {\n\tif (document instanceof FullTextDocument) return {\n\t\tweightGroups: document.weightGroups,\n\t\tlanguage: languageOf(options)\n\t};\n\tif (isExpression(document)) return {\n\t\tweightGroups: [[document]],\n\t\tlanguage: languageOf(options)\n\t};\n\tif (!isIndexReference(document)) throw invalidDocument(method, \"document\", Array.isArray(document) ? \"array\" : typeof document, \"the document must be a full-text index from a table's `indexes`, a column, or a document from `fullTextDocument`.\", \"Pass the index, as `table.indexes.<name>`, or wrap the weight groups in `fullTextDocument(...)`.\");\n\tif (document.type !== \"fullText\") throw invalidDocument(method, \"document\", document.type, `the index is of type \"${String(document.type)}\", not a full-text index.`, \"Pass an index declared with `@@fullTextIndex` or `fullTextIndex`.\");\n\tif (options.language !== void 0) throw invalidDocument(method, \"options\", options.language, \"a full-text index states its language, so the `language` option is not taken with one.\", \"Leave `language` out; the index decides it.\");\n\tconst definition = fullTextIndexOptions(document.options ?? {});\n\tif (definition instanceof type.errors) throw invalidDocument(method, \"document\", document.options, `the full-text index has invalid options: ${definition.summary}`, \"Pass the index as the table gives it.\");\n\tconst columns = document.columns;\n\tconst columnOf = (name) => {\n\t\tconst column = typeof columns === \"object\" && columns !== null && Object.hasOwn(columns, name) ? Reflect.get(columns, name) : void 0;\n\t\tif (!isExpression(column)) throw invalidDocument(method, \"document\", name, `the full-text index has no column \"${name}\", which its weight groups name.`, \"Pass the index as the table gives it.\");\n\t\treturn column;\n\t};\n\treturn {\n\t\tweightGroups: definition.weightGroups.map((group) => group.map(columnOf)),\n\t\tlanguage: definition.language\n\t};\n}\n/**\n* The search document an operation searches. The first column is the operation's `self`; the\n* others follow the `fixedArgs` the operation passes first, so the query, the language and any\n* further option keep their positions.\n*/\nfunction searchDocument(method, document, options, fixedArgs) {\n\tconst { weightGroups, language } = documentGroups(method, document, options);\n\tlet position = 0;\n\tconst template = renderFullTextDocument(weightGroups.map((group) => group.map(() => position++)), {\n\t\tcolumn: (index) => index === 0 ? \"{{self}}\" : `{{arg${fixedArgs + index - 1}}}`,\n\t\tlanguage: \"{{arg1}}\"\n\t});\n\tconst [self, ...rest] = weightGroups.flat().map((column) => toExpr(column));\n\tassertDefined(self, `${method}: a checked document has a first column`);\n\treturn {\n\t\tself,\n\t\trest,\n\t\ttemplate,\n\t\tlanguage: languageLiteral(method, language)\n\t};\n}\nfunction postgresQueryOperations() {\n\treturn {\n\t\tilike: {\n\t\t\tself: { traits: [\"textual\"] },\n\t\t\timpl: (self, pattern) => buildOperation({\n\t\t\t\tmethod: \"ilike\",\n\t\t\t\targs: [toExpr(self), toExpr(pattern, TEXT_REF)],\n\t\t\t\treturns: {\n\t\t\t\t\tcodecId: PG_BOOL_CODEC_ID,\n\t\t\t\t\tnullable: false\n\t\t\t\t},\n\t\t\t\tlowering: {\n\t\t\t\t\ttargetFamily: \"sql\",\n\t\t\t\t\ttemplate: \"{{self}} ILIKE {{arg0}}\"\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\t\tfullTextMatches: {\n\t\t\tself: { traits: [\"textual\"] },\n\t\t\timpl: (document, query, options = {}) => {\n\t\t\t\tconst searched = searchDocument(\"fullTextMatches\", document, options, 2);\n\t\t\t\treturn buildOperation({\n\t\t\t\t\tmethod: \"fullTextMatches\",\n\t\t\t\t\targs: [\n\t\t\t\t\t\tsearched.self,\n\t\t\t\t\t\ttoExpr(query, TSQUERY_REF),\n\t\t\t\t\t\tsearched.language,\n\t\t\t\t\t\t...searched.rest\n\t\t\t\t\t],\n\t\t\t\t\treturns: {\n\t\t\t\t\t\tcodecId: PG_BOOL_CODEC_ID,\n\t\t\t\t\t\tnullable: false\n\t\t\t\t\t},\n\t\t\t\t\tlowering: {\n\t\t\t\t\t\ttargetFamily: \"sql\",\n\t\t\t\t\t\ttemplate: `${searched.template} @@ {{arg0}}`\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\tfullTextRank: {\n\t\t\tself: { traits: [\"textual\"] },\n\t\t\timpl: (document, query, options = {}) => {\n\t\t\t\tconst fn = options.coverDensity === true ? \"ts_rank_cd\" : \"ts_rank\";\n\t\t\t\tconst normalization = options.normalization === void 0 ? void 0 : normalizationLiteral(\"fullTextRank\", options.normalization);\n\t\t\t\tconst searched = searchDocument(\"fullTextRank\", document, options, normalization === void 0 ? 2 : 3);\n\t\t\t\tconst fixed = normalization === void 0 ? [searched.language] : [searched.language, normalization];\n\t\t\t\treturn buildOperation({\n\t\t\t\t\tmethod: \"fullTextRank\",\n\t\t\t\t\targs: [\n\t\t\t\t\t\tsearched.self,\n\t\t\t\t\t\ttoExpr(query, TSQUERY_REF),\n\t\t\t\t\t\t...fixed,\n\t\t\t\t\t\t...searched.rest\n\t\t\t\t\t],\n\t\t\t\t\treturns: {\n\t\t\t\t\t\tcodecId: PG_FLOAT4_CODEC_ID,\n\t\t\t\t\t\tnullable: false\n\t\t\t\t\t},\n\t\t\t\t\tlowering: {\n\t\t\t\t\t\ttargetFamily: \"sql\",\n\t\t\t\t\t\ttemplate: `${fn}(${searched.template}, {{arg0}}${normalization === void 0 ? \"\" : \", {{arg2}}\"})`\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\tfullTextHeadline: {\n\t\t\tself: { traits: [\"textual\"] },\n\t\t\timpl: (self, query, options = {}) => {\n\t\t\t\tconst headlineOptions = headlineOptionsLiteral(\"fullTextHeadline\", options);\n\t\t\t\tconst base = \"ts_headline({{arg1}}, {{self}}, {{arg0}}\";\n\t\t\t\treturn buildOperation({\n\t\t\t\t\tmethod: \"fullTextHeadline\",\n\t\t\t\t\targs: [\n\t\t\t\t\t\ttoExpr(self),\n\t\t\t\t\t\ttoExpr(query, TSQUERY_REF),\n\t\t\t\t\t\tlanguageLiteral(\"fullTextHeadline\", languageOf(options)),\n\t\t\t\t\t\t...headlineOptions === void 0 ? [] : [headlineOptions]\n\t\t\t\t\t],\n\t\t\t\t\treturns: {\n\t\t\t\t\t\tcodecId: PG_TEXT_CODEC_ID,\n\t\t\t\t\t\tnullable: false\n\t\t\t\t\t},\n\t\t\t\t\tlowering: {\n\t\t\t\t\t\ttargetFamily: \"sql\",\n\t\t\t\t\t\ttemplate: `${base}${headlineOptions === void 0 ? \"\" : \", {{arg2}}\"})`\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\twebsearchToTsquery: { impl: websearchToTsquery },\n\t\ttoTsquery: { impl: toTsquery },\n\t\tplaintoTsquery: { impl: plaintoTsquery },\n\t\tphrasetoTsquery: { impl: phrasetoTsquery }\n\t};\n}\n//#endregion\n//#region src/exports/runtime.ts\n/**\n* Target-postgres deliberately does NOT import `SqlRuntimeTargetDescriptor` from `@internal/sql-runtime`. The target package is a control-plane residence and must not pull the SQL execution-plane package into its dependency closure. The runtime descriptor here is shaped to satisfy the framework's `RuntimeTargetDescriptor` plus the structural `SqlStaticContributions` (`codecs:` returning a descriptor list) that\n* `@internal/sql-runtime` consumers narrow to at composition time.\n*\n* The target itself contributes no codecs — postgres-specific codecs ship from the postgres adapter and from extension packs (pgvector, arktype-json, etc.).\n*/\nconst postgresRuntimeTargetDescriptor = {\n\t...postgresTargetDescriptorMetaRuntime,\n\tcodecs: () => [],\n\tlistDecoder: () => decodePostgresListText,\n\tqueryOperations: () => postgresQueryOperations(),\n\tcollectionMethods: () => [postgresFullTextMethods],\n\tcreate() {\n\t\treturn {\n\t\t\tfamilyId: \"sql\",\n\t\t\ttargetId: \"postgres\"\n\t\t};\n\t}\n};\n//#endregion\nexport { PostgresContractSerializer, PostgresContractView, decodePostgresListText, postgresRuntimeTargetDescriptor as default, postgresNowGenerators };\n\n//# sourceMappingURL=runtime.mjs.map"],"mappings":";;;;;;;;;;;;;;;AAeA,SAAS,cAAc,OAAO,MAAM;CACnC,OAAO,UAAU,MAAM,IAAI,KAAK;AACjC;AACA,SAAS,eAAe,WAAW;CAClC,QAAQ,YAAY,GAAG,SAAS,WAAW,OAAO,QAAQ,UAAU,cAAc,OAAO,iBAAiB,CAAC,CAAC,MAAM,QAAQ,YAAY,GAAG,IAAI,CAAC,CAAC,CAAC,SAAS,QAAQ,UAAU,cAAc,OAAO,cAAc,CAAC,CAAC,MAAM,QAAQ,YAAY,GAAG,IAAI,CAAC,CAAC,KAAK,CAAC;AAC1P;;AAEA,MAAM,0BAA0B;CAC/B,IAAI;CACJ,aAAa,UAAU,OAAO,YAAY,uBAAuB,MAAM,MAAM,SAAS,oBAAoB,CAAC,CAAC,KAAK,SAAS,CAAC,MAAM,eAAe,IAAI,CAAC,CAAC,CAAC;AACxJ;AAGA,MAAM,WAAW,EAAE,SAAS,iBAAiB;AAC7C,MAAM,cAAc,EAAE,SAAS,oBAAoB;A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ACT,cAAc;MACd,UAAU,GAAG,OAAO,oBAAoB,KAAK,IAAI,KAAK,aAAa;KACpE;IACD,CAAC;GACF;EACD;EACA,oBAAoB,EAAE,MAAM,mBAAmB;EAC/C,WAAW,EAAE,MAAM,UAAU;EAC7B,gBAAgB,EAAE,MAAM,eAAe;EACvC,iBAAiB,EAAE,MAAM,gBAAgB;CAC1C;AACD;;;;;;;AASA,MAAM,kCAAkC;CACvC,GAAG;CACH,cAAc,CAAC;CACf,mBAAmB;CACnB,uBAAuB,wBAAwB;CAC/C,yBAAyB,CAAC,uBAAuB;CACjD,SAAS;EACR,OAAO;GACN,UAAU;GACV,UAAU;EACX;CACD;AACD"}
@@ -2,7 +2,7 @@ import { C as PG_TIMESTAMPTZ_DATE_CODEC_ID, S as PG_TEXT_CODEC_ID } from "./code
2
2
  import { c as postgresError } from "./errors-BrhQYgdL-D_lIrddD.mjs";
3
3
  import { A as pgJsonb, i as createPostgresBuiltinDataTypeLookup, k as pgJson } from "./data-types-Cs-LkJBw-CJN57Y5M.mjs";
4
4
  import { r as createPostgresBuiltinCodecLookup } from "./codec-registry-T79ktJL4-B9_zlIhI.mjs";
5
- import { t as POLICY_BLOCK_KEYWORDS } from "./authoring-DhyLHFHA-pB4NuFxh.mjs";
5
+ import { t as POLICY_BLOCK_KEYWORDS } from "./authoring-DtjMn8TZ-sv84Cdw_.mjs";
6
6
  import { t as postgresRenderCheckExpressions } from "./check-expressions-7uCCP01t-WtUqfqkP.mjs";
7
7
  import { t as postgresDataTypeEntries } from "./data-type-entries-CqnLlCkK-uN0WjREd.mjs";
8
8
  import { n as readPostgresDefault } from "./default-normalizer-BqK6XxdC-BAgxt9FF.mjs";
@@ -24,7 +24,7 @@ import { inferColumnTypes, inferredTypeConstructors, mapDefault, toEnumMemberNam
24
24
  import { buildChildRelationField, deriveRelationFieldName, inferRelations, toEnumName, toFieldName, toModelName } from "@prisma/orm-family-sql/family/psl-infer";
25
25
  import { UNSPECIFIED_PSL_NAMESPACE_ID, makePslNamespace, makePslNamespaceEntries } from "@prisma/orm-framework/components/psl-ast";
26
26
  import { parsePslPositionalArgs } from "@prisma/orm-framework/psl-parser/interpret";
27
- //#region ../../../3-targets/3-targets/postgres/dist/type-constructors-C4QD_3HB.mjs
27
+ //#region ../../../3-targets/3-targets/postgres/dist/type-constructors-BEZJxWcZ.mjs
28
28
  const SYNTHETIC_SPAN = {
29
29
  start: {
30
30
  offset: 0,
@@ -1144,7 +1144,7 @@ function buildPslDocumentAst(schemaIR, options, foreignKeyExtras, namespaceName,
1144
1144
  * channel. Each names a codec; the column's database type is its data type's.
1145
1145
  *
1146
1146
  * The type position is the only storage decider: a mutation-default generator
1147
- * (`@default(uuid())`) never re-picks a column's storage.
1147
+ * (`@onCreate(uuid())`) never re-picks a column's storage.
1148
1148
  */
1149
1149
  const postgresScalarAuthoringTypes = {
1150
1150
  String: {
@@ -1512,4 +1512,4 @@ const postgresPslTypeConstructors = {
1512
1512
  //#endregion
1513
1513
  export { postgresNativeAuthoringTypes as _, buildIndexAttribute as a, buildNativeEnumBlock as c, inferPostgresPslContract as d, namedArg as f, positionalArg as g, parseDefaultAttributeString as h, buildFullTextIndexAttribute as i, buildPslDocumentAst as l, noInferredDefaults as m, buildAttribute as n, buildMapAttribute as o, noColumnDefaults as p, buildCheckAttribute as r, buildModelConstraintAttribute as s, SYNTHETIC_SPAN as t, createPostgresDefaultMapping as u, postgresPslTypeConstructors as v, postgresScalarAuthoringTypes as y };
1514
1514
 
1515
- //# sourceMappingURL=type-constructors-C4QD_3HB-Czhx8fAX.mjs.map
1515
+ //# sourceMappingURL=type-constructors-BEZJxWcZ-Co2GJw1M.mjs.map