@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
package/dist/target.d.mts CHANGED
@@ -18,42 +18,42 @@ import "./ddl-D_JWHRzo.mjs";
18
18
  import "./codec-ids-BQRXOwQR.mjs";
19
19
  import { a as FullTextIndexCandidate, c as FullTextSearchLanguage, d as fullTextIndexProblems, f as weightGroupsOf, i as FullTextFieldsInput, n as FULL_TEXT_INDEX_TYPE, o as FullTextIndexDefinition, r as FullTextColumnCodecs, s as FullTextIndexProblem, t as DEFAULT_FULL_TEXT_SEARCH_LANGUAGE, u as describeFullTextIndexProblem } from "./full-text-index-definition-D5iBWLss-FifKlctQ.mjs";
20
20
  import { a as renderFullTextIndexDocument, i as quoteQualifiedName, n as qualifyName, o as validateEnumValueLength, r as quoteIdentifier, t as escapeLiteral } from "./sql-utils-B7LfCQCB.mjs";
21
- import { t as postgresAggregateDescriptors } from "./aggregates-C2xqsGZ2.mjs";
21
+ import { t as postgresAggregateDescriptors } from "./aggregates-B3lIBjGK.mjs";
22
22
  import { a as JsonValue$1, c as Time, d as TimestampString, f as Timestamptz, g as Varchar, h as VarBit, i as Interval, l as TimeString, m as Timetz, n as Char, o as Numeric, p as TimestamptzString, r as CodecTypes, s as ParameterizedOutputTypesForTypeParams, t as Bit, u as Timestamp } from "./codec-types-DX-72F9v-CORaQjWv.mjs";
23
23
  import "./codec-types-DoxsMXp7.mjs";
24
24
  import { A as noNullValuesAst, B as timestamptz, C as createTable, D as int4, E as indexExistsAst, F as tableExistsAst, H as toRegclass, I as tableIsEmptyAst, L as tablePrimaryKeyAst, M as rlsEnabledAst, N as rlsPolicyExistsAst, O as int8, P as sequenceNameAvailableAst, R as text, S as createSchema, T as extensionExistsAst, V as timestamptzJsDate, _ as columnDefaultSequenceAst, a as IndexExistsCheckBuilder, b as columnTypeAst, c as TableExistsCheckBuilder, d as addConstraintAction, f as alterColumnTypeAction, g as columnDefaultAst, h as buildSignMarkerBootstrapQueries, i as ExtensionExistsCheckBuilder, j as pgTable, k as jsonb, l as TablePrimaryKeyCheckBuilder, m as buildControlTableBootstrapQueries, n as ColumnExistsCheckBuilder, o as RlsEnabledCheckBuilder, p as alterTable, r as ConstraintExistsCheckBuilder, s as RlsPolicyExistsCheckBuilder, t as ColumnDefaultCheckBuilder, u as addColumnAction, v as columnExistsAst, w as dropDefaultAction, x as constraintExistsAst, y as columnNullabilityAst, z as textArray } from "./contract-free-D1JEZVpQ.mjs";
25
25
  import { t as PostgresPlanTargetDetails } from "./planner-target-details-HkP4RrRO-_xPQVPF0.mjs";
26
26
  import { n as postgresNowGenerators, t as postgresNowGeneratorControlDescriptors } from "./date-time-now-generators-CMkXVbMG-CYwplAuf.mjs";
27
- import { n as postgresPslTypeConstructors, r as postgresScalarAuthoringTypes, t as postgresNativeAuthoringTypes } from "./control-DmWVxA23.mjs";
27
+ import { n as postgresPslTypeConstructors, r as postgresScalarAuthoringTypes, t as postgresNativeAuthoringTypes } from "./control-BRE_BcLl.mjs";
28
28
  import { i as dataTransform, r as DataTransformOptions, t as DataTransformClosure } from "./data-transform-nGy9rz87-CEOXAj91.mjs";
29
29
  import "./data-transform-C-3UJ3hC.mjs";
30
30
  import { A as pgTimestamptz, B as qualifiedEnumName, C as pgPrecisionParams, D as pgTimeStoredText, E as pgTime, F as pgUuid, I as pgVarbit, L as pgVarchar, M as pgTimetz, N as pgTimetzStoredText, O as pgTimestamp, P as pgTsquery, R as postgresDataTypeEntries, S as pgNumericParams, T as pgTextArray, _ as pgInt8, a as pgBytea, b as pgJsonb, c as pgDate, d as pgEnumParams, f as pgFloat4, g as pgInt4, h as pgInt2, i as pgBool, j as pgTimestamptzStoredText, k as pgTimestampStoredText, l as pgDateStoredText, m as pgInet, n as pgBit, o as pgChar, p as pgFloat8, r as pgBitLengthParams, s as pgCharacterLengthParams, t as createPostgresBuiltinDataTypeLookup, u as pgEnum, v as pgInterval, w as pgText, x as pgNumeric, y as pgJson, z as postgresDataTypes } from "./data-types-BTUMiCZS.mjs";
31
31
  import { n as postgresResolveDefault, r as readPostgresDefault, t as PostgresReportedDefault } from "./default-normalizer-P-u2VRBf.mjs";
32
- import { t as buildPostgresPlanDiff } from "./diff-database-schema-BGcRo8FM.mjs";
32
+ import { t as buildPostgresPlanDiff } from "./diff-database-schema-Diw5m51r.mjs";
33
33
  import { n as postgresError, t as errorPostgresMigrationStackMissing } from "./errors-BP-2V2_C.mjs";
34
34
  import { _ as plaintoTsquery, a as FullTextIndexReference, c as QueryOperationTypes, d as TsqueryArgument, f as TsqueryExpression, g as phrasetoTsquery, h as fullTextDocument, i as FullTextHeadlineOptions, l as QueryOperationTypesForCodecs, m as TsqueryParserOptions, n as FullTextDocumentColumn, o as FullTextMatchesOptions, p as TsqueryParser, r as FullTextDocumentGroups, s as FullTextRankOptions, t as FullTextDocument, u as TextArgument, v as toTsquery, y as websearchToTsquery } from "./operation-types-CK6URXeD-BsCK-mcK.mjs";
35
35
  import { n as PostgresTsqueryArgument, t as PostgresFullTextMethods } from "./full-text-collection-method-BIqQH9XN-CkW2x4u2.mjs";
36
36
  import { n as tsquery, t as TsqueryTag } from "./full-text-OAJrtCtv.mjs";
37
37
  import { t as postgresCodecTraitsOf } from "./full-text-index-authoring-Ca6bWXyG.mjs";
38
- import { i as stackDataTypes, n as alterTypeCheck, r as qualifyTableName, t as ColumnTypeCheck } from "./planner-sql-checks-CxlrM4J2-VqQpmMwn.mjs";
39
- 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";
40
- import { n as planIssues, t as coalesceSubtreeIssues } from "./issue-planner-DrWlNiAf.mjs";
38
+ import { i as stackDataTypes, n as alterTypeCheck, r as qualifyTableName, t as ColumnTypeCheck } from "./planner-sql-checks-CWOmxltY-CoWF8Eq0.mjs";
39
+ 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";
40
+ import { n as planIssues, t as coalesceSubtreeIssues } from "./issue-planner-BT5rqDNx.mjs";
41
41
  import { n as MARKER_LOCK_SQL, t as MARKER_LOCK_KEY } from "./marker-lock-BGBqXaQ4.mjs";
42
42
  import { t as PostgresContractView } from "./postgres-contract-view-BFzIDwwN-pJ6gJGOT.mjs";
43
- import { t as PostgresMigration } from "./postgres-migration-Crcs_mmg-D1ZyiWtc.mjs";
44
- 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";
43
+ import { t as PostgresMigration } from "./postgres-migration-HW4fCGNb-CLkytGtG.mjs";
44
+ 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";
45
45
  import { n as IntrospectedTypeText, r as introspectedTypeText, t as CatalogColumnType } from "./native-type-normalizer-DFE5L3YY.mjs";
46
- import "./op-factory-call-CijzNDaJ.mjs";
46
+ import "./op-factory-call-CEyI7a78.mjs";
47
47
  import "./operation-types-ECV4mkfb.mjs";
48
- import "./pack-CcQNl-gj.mjs";
49
- import { t as TypeScriptRenderablePostgresMigration } from "./planner-produced-postgres-migration-BRjNXwjn-DhjS0Pbw.mjs";
50
- import { n as createPostgresMigrationPlanner, t as contractToPostgresDatabaseSchemaNode } from "./planner-D3wWu7Kj.mjs";
48
+ import "./pack-C-rgdVoH.mjs";
49
+ import { t as TypeScriptRenderablePostgresMigration } from "./planner-produced-postgres-migration-C8uYGzUj-DRmZY4_u.mjs";
50
+ import { n as createPostgresMigrationPlanner, t as contractToPostgresDatabaseSchemaNode } from "./planner-Bo92I5YX.mjs";
51
51
  import { t as buildColumnTypeSql } from "./planner-ddl-builders-DbG9_uAk.mjs";
52
52
  import { n as resolveIdentityValue, t as buildBuiltinIdentityValue } from "./planner-identity-values-B-NAiN7I.mjs";
53
- import "./planner-produced-postgres-migration-CiHKwaE_.mjs";
53
+ import "./planner-produced-postgres-migration-DaDlRTID.mjs";
54
54
  import { i as hasUniqueConstraint, n as hasForeignKey, r as hasIndex, t as buildSchemaLookupMap } from "./planner-schema-lookup-C4DHAddq.mjs";
55
- import "./planner-sql-checks-CB4oLSuZ.mjs";
56
- import { t as prisma7PostgresBinding } from "./prisma7-binding-C5RLV6kJ.mjs";
55
+ import "./planner-sql-checks-Cp3fcCNc.mjs";
56
+ import { t as prisma7PostgresBinding } from "./prisma7-binding-BXyT6bKE.mjs";
57
57
  import { t as renderOps } from "./render-ops-DPwhZt2W.mjs";
58
58
  import { t as renderCallsToTypeScript } from "./render-typescript-6sCFvMBh.mjs";
59
59
  import { n as PostgresListDecoder, r as PostgresRuntimeTargetInstance, t as PostgresContractSerializer } from "./runtime-BeTyqpCH.mjs";
package/dist/target.mjs CHANGED
@@ -14,7 +14,7 @@ import { B as tablePrimaryKeyAst, E as extensionExistsAst, F as rlsPolicyExistsA
14
14
  import { a as jsonb, c as textArray, i as int8, l as timestamptz, n as buildSignMarkerBootstrapQueries, o as pgTable, r as int4, s as text, t as buildControlTableBootstrapQueries, u as timestamptzJsDate } from "./contract-free-Kwm74Hg9.mjs";
15
15
  import { t as postgresCodecTraitsOf } from "./postgres-codec-traits-D3muwxMS-OwnBG0Mz.mjs";
16
16
  import { i as policyRoleList, n as POLICY_OPERATION_PREDICATES, r as computeContentHash, t as POLICY_COMMAND_SQL } from "./canonicalize-RdxoUHao-DK_M6HU-.mjs";
17
- import { c as postgresNowGeneratorControlDescriptors, u as postgresNowGenerators } from "./authoring-DhyLHFHA-pB4NuFxh.mjs";
17
+ import { c as postgresNowGeneratorControlDescriptors, u as postgresNowGenerators } from "./authoring-DtjMn8TZ-sv84Cdw_.mjs";
18
18
  import { t as postgresRenderCheckExpressions } from "./check-expressions-7uCCP01t-WtUqfqkP.mjs";
19
19
  import { t as postgresDataTypeEntries } from "./data-type-entries-CqnLlCkK-uN0WjREd.mjs";
20
20
  import { n as PostgresSchemaNodeKind, r as PostgresTableSchemaNode, t as PostgresNativeEnumSchemaNode } from "./postgres-table-schema-node-BBkitBQh-DT1T5VWU.mjs";
@@ -28,19 +28,19 @@ import { t as buildColumnTypeSql } from "./planner-ddl-builders-B8PhQZ2T-D1KBJxc
28
28
  import { n as resolveIdentityValue, t as buildBuiltinIdentityValue } from "./planner-identity-values-BnxSwhlS-CzyBeK0a.mjs";
29
29
  import { a as planIssues, t as coalesceSubtreeIssues } from "./control-policy-BHjZnca1-DUWuKmdJ.mjs";
30
30
  import { n as contractToPostgresDatabaseSchemaNode, t as buildPostgresPlanDiff } from "./diff-database-schema-DyCIRT80-C1zMCmRx.mjs";
31
- import { n as PostgresContractView, t as PostgresContractSerializer } from "./postgres-contract-view-B-bLZB7o-zpuamDXT.mjs";
31
+ import { n as PostgresContractView, t as PostgresContractSerializer } from "./postgres-contract-view-Ctg2ire_-smoqnU-u.mjs";
32
32
  import { t as dataTransform } from "./data-transform-CtHnNYhF-r19375h3.mjs";
33
- import { t as PostgresMigration } from "./postgres-migration-BbXm1l5I-DDy8IgYB.mjs";
33
+ import { t as PostgresMigration } from "./postgres-migration-BdFXT6xg-BPApPGX9.mjs";
34
34
  import { t as renderOps } from "./render-ops-MeXLgeOa-nL4PdJzz.mjs";
35
35
  import { t as renderCallsToTypeScript } from "./render-typescript-Dqp1Spgn-B128r1qw.mjs";
36
- import { t as TypeScriptRenderablePostgresMigration } from "./planner-produced-postgres-migration-F9joIngl-C04yYu-i.mjs";
37
- import { t as createPostgresMigrationPlanner } from "./planner-CE4YoVdA-BfwuVRuT.mjs";
36
+ import { t as TypeScriptRenderablePostgresMigration } from "./planner-produced-postgres-migration-Y7bMLPPc-tZeIl3hP.mjs";
37
+ import { t as createPostgresMigrationPlanner } from "./planner-BIOXTf-E-CFs_l_0M.mjs";
38
38
  import { n as MARKER_LOCK_SQL, t as MARKER_LOCK_KEY } from "./marker-lock-DFc1Tfv5-QMJSzMIa.mjs";
39
- import { _ as postgresNativeAuthoringTypes, v as postgresPslTypeConstructors, y as postgresScalarAuthoringTypes } from "./type-constructors-C4QD_3HB-Czhx8fAX.mjs";
39
+ import { _ as postgresNativeAuthoringTypes, v as postgresPslTypeConstructors, y as postgresScalarAuthoringTypes } from "./type-constructors-BEZJxWcZ-Co2GJw1M.mjs";
40
40
  import { c as toTsquery, l as websearchToTsquery, n as fullTextDocument, o as phrasetoTsquery, s as plaintoTsquery, t as FullTextDocument } from "./full-text-parsers-CrMjTR2n-CHDNR_vE.mjs";
41
41
  import { t as tsquery } from "./full-text-CSMAiOYz.mjs";
42
42
  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";
43
43
  import { t as introspectedTypeText } from "./native-type-normalizer-a1XJSlk6.mjs";
44
44
  import { i as hasUniqueConstraint, n as hasForeignKey, r as hasIndex, t as buildSchemaLookupMap } from "./planner-schema-lookup-CdgWer9s.mjs";
45
- import { t as prisma7PostgresBinding } from "./prisma7-binding-CS42flik.mjs";
45
+ import { t as prisma7PostgresBinding } from "./prisma7-binding-DWeHpJrg.mjs";
46
46
  export { AddCheckConstraintCall, AddColumnAction, AddColumnCall, AddColumnWithTemporaryDefaultCall, AddConstraintAction, AddForeignKeyCall, AddNativeEnumValueCall, AddPrimaryKeyCall, AddRequiredColumnToEmptyTableCall, AddUniqueCall, AlterColumnTypeAction, AlterColumnTypeCall, CreateExtensionCall, CreateIndexCall, CreateNativeEnumTypeCall, CreatePostgresRlsPolicyCall, CreateSchemaCall, CreateTableCall, DEFAULT_FULL_TEXT_SEARCH_LANGUAGE, DataTransformCall, DisableRowLevelSecurityCall, DropCheckConstraintCall, DropColumnCall, DropConstraintCall, DropDefaultAction, DropDefaultCall, DropIndexCall, DropNativeEnumTypeCall, DropNotNullCall, DropPostgresRlsPolicyCall, DropTableCall, EnableRowLevelSecurityCall, FULL_TEXT_INDEX_TYPE, FullTextDocument, MARKER_LOCK_KEY, MARKER_LOCK_SQL, PostgresMigration as Migration, MigrationCLI, PG_BIT_CODEC_ID, PG_BOOL_CODEC_ID, PG_BYTEA_CODEC_ID, PG_CHAR_CODEC_ID, PG_DATE_STRING_CODEC_ID, PG_DATE_TEMPORAL_CODEC_ID, PG_ENUM_CODEC_ID, PG_FLOAT4_CODEC_ID, PG_FLOAT8_CODEC_ID, PG_FLOAT_CODEC_ID, PG_INET_CODEC_ID, PG_INT2_CODEC_ID, PG_INT4_CODEC_ID, PG_INT8_CODEC_ID, PG_INT8_NUMBER_CODEC_ID, PG_INTERVAL_CODEC_ID, PG_INT_CODEC_ID, PG_JSONB_CODEC_ID, PG_JSON_CODEC_ID, PG_NUMERIC_CODEC_ID, PG_TEXT_ARRAY_CODEC_ID, PG_TEXT_CODEC_ID, PG_TIMESTAMPTZ_DATE_CODEC_ID, PG_TIMESTAMPTZ_STRING_CODEC_ID, PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID, PG_TIMESTAMP_STRING_CODEC_ID, PG_TIMESTAMP_TEMPORAL_CODEC_ID, PG_TIMETZ_CODEC_ID, PG_TIME_STRING_CODEC_ID, PG_TIME_TEMPORAL_CODEC_ID, PG_TSQUERY_CODEC_ID, PG_UNBOUNDED_INT_CODEC_ID, PG_UUID_CODEC_ID, PG_VARBIT_CODEC_ID, PG_VARCHAR_CODEC_ID, POLICY_COMMAND_SQL, POLICY_OPERATION_PREDICATES, PgTimestamptzDateCodec, PgTimestamptzDateDescriptor, PostgresAlterIndexRename, PostgresAlterPolicyRename, PostgresAlterTable, PostgresCodecDescriptor, PostgresContractSerializer, PostgresContractView, PostgresCreateIndex, PostgresCreatePolicy, PostgresCreateSchema, PostgresCreateTable, PostgresCreateType, PostgresDatabaseSchemaNode, PostgresDdlNode, PostgresDisableRowLevelSecurity, PostgresDropIndex, PostgresDropPolicy, PostgresDropType, PostgresNamespaceSchemaNode, PostgresNativeEnum, PostgresNativeEnumSchemaNode, PostgresPolicySchemaNode, PostgresRlsEnablement, PostgresRlsPolicy, PostgresRole, PostgresRoleSchemaNode, PostgresSchema, PostgresSchemaNodeKind, PostgresTableSchemaNode, PostgresTableSource, PostgresUnboundSchema, RawSqlCall, RenameColumnCall, RenameConstraintCall, RenameIndexCall, RenamePostgresRlsPolicyCall, RenameTableCall, SQL_CHAR_CODEC_ID, SQL_FLOAT_CODEC_ID, SQL_INT_CODEC_ID, SQL_TEXT_CODEC_ID, SQL_VARCHAR_CODEC_ID, SetDefaultCall, SetNotNullCall, TypeScriptRenderablePostgresMigration, addColumnAction, addConstraintAction, alterColumnTypeAction, alterTable, alterTypeCheck, assemblePostgresCodecRegistry, assemblePostgresCodecRegistryWithBuiltins, buildBuiltinIdentityValue, buildColumnTypeSql, buildControlTableBootstrapQueries, buildPostgresCodecDescriptorRegistry, buildPostgresPlanDiff, buildSchemaLookupMap, buildSignMarkerBootstrapQueries, checkExpression, coalesceSubtreeIssues, col, columnDefaultAst, columnDefaultSequenceAst, columnExistsAst, columnNullabilityAst, columnTypeAst, computeContentHash, constraintExistsAst, contractToPostgresDatabaseSchemaNode, createExtension, createPostgresBuiltinCodecLookup, createPostgresBuiltinDataTypeLookup, createPostgresCodecRegistryWithBuiltins, createPostgresMigrationPlanner, createSchema, createTable, dataTransform, decodePostgresListText, definePostgresCodecs, describeFullTextIndexProblem, dropDefaultAction, errorPostgresMigrationStackMissing, escapeLiteral, extensionExistsAst, fn, foreignKey, fullTextDocument, fullTextIndexProblems, hasForeignKey, hasIndex, hasUniqueConstraint, indexExistsAst, int4, int8, introspectedTypeText, isPgEnumParams, isPostgresCodecDescriptor, isPostgresSchema, jsonb, lit, noNullValuesAst, parsePostgresListText, pgBit, pgBitColumn, pgBitLengthParams, pgBool, pgBoolColumn, pgBytea, pgChar, pgCharColumn, pgCharacterLengthParams, pgDate, pgDateStoredText, pgEnum, pgEnumDescriptor, pgEnumParams, pgFloat4, pgFloat4Column, pgFloat8, pgFloat8Column, pgFloatColumn, pgInet, pgInetColumn, pgInt2, pgInt2Column, pgInt4, pgInt4Column, pgInt8, pgInt8Column, pgInt8NumberColumn, pgIntColumn, pgInterval, pgIntervalColumn, pgJson, pgJsonColumn, pgJsonb, pgJsonbColumn, pgNumeric, pgNumericColumn, pgNumericParams, pgPrecisionParams, pgTable, pgText, pgTextArray, pgTextColumn, pgTime, pgTimeStoredText, pgTimestamp, pgTimestampStoredText, pgTimestamptz, pgTimestamptzDateColumn, pgTimestamptzDateDescriptor, pgTimestamptzStoredText, pgTimetz, pgTimetzColumn, pgTimetzStoredText, pgTsquery, pgUnboundedIntColumn, pgUuid, pgUuidColumn, pgVarbit, pgVarbitColumn, pgVarchar, pgVarcharColumn, phrasetoTsquery, placeholder, plaintoTsquery, planIssues, policyInputFromSerialized, policyRoleList, postgresAggregateDescriptors, postgresCodec, postgresCodecDescriptorRegistry, postgresCodecRegistry, postgresCodecTraitsOf, postgresCreateNamespace, postgresDataTypeEntries, postgresDataTypes, postgresError, postgresNativeAuthoringTypes, postgresNowGeneratorControlDescriptors, postgresNowGenerators, postgresPslTypeConstructors, postgresRenderCheckExpressions, postgresResolveDefault, postgresScalarAuthoringTypes, primaryKey, prisma7PostgresBinding, qualifiedEnumName, qualifyName, qualifyTableName, quoteIdentifier, quoteQualifiedName, rawSql, readPostgresDefault, renderCallsToTypeScript, renderFullTextIndexDocument, renderOps, resolveDdlSchemaForNamespaceStorage, resolveIdentityValue, rlsEnabledAst, rlsPolicyExistsAst, sequenceNameAvailableAst, sql, stackDataTypes, tableExistsAst, tableIsEmptyAst, tablePrimaryKeyAst, text, textArray, timestamptz, timestamptzJsDate, toRegclass, toTsquery, tsquery, unique, validateEnumValueLength, websearchToTsquery, weightGroupsOf };
@@ -1,2 +1,2 @@
1
- import { t as postgresAggregateDescriptors } from "./aggregates-C2xqsGZ2.mjs";
1
+ import { t as postgresAggregateDescriptors } from "./aggregates-B3lIBjGK.mjs";
2
2
  export { postgresAggregateDescriptors };
@@ -1,4 +1,4 @@
1
1
  import { n as parsePostgresListText, t as decodePostgresListText } from "./list-decoder-BcrLExnx-hTa7qY7a.mjs";
2
2
  import { t as postgresNowGeneratorControlDescriptors } from "./date-time-now-generators-CMkXVbMG-CYwplAuf.mjs";
3
- import { i as postgresTargetDescriptor, n as postgresPslTypeConstructors, r as postgresScalarAuthoringTypes, t as postgresNativeAuthoringTypes } from "./control-DmWVxA23.mjs";
3
+ import { i as postgresTargetDescriptor, n as postgresPslTypeConstructors, r as postgresScalarAuthoringTypes, t as postgresNativeAuthoringTypes } from "./control-BRE_BcLl.mjs";
4
4
  export { decodePostgresListText, postgresTargetDescriptor as default, parsePostgresListText, postgresNativeAuthoringTypes, postgresNowGeneratorControlDescriptors, postgresPslTypeConstructors, postgresScalarAuthoringTypes };
@@ -7,18 +7,18 @@ import { P as setFallbackTemporal, i as decodePostgresListText, o as parsePostgr
7
7
  import { s as fullTextIndexDefinitionOf } from "./full-text-index-definition-BPxQQBuC-BrpDsuJu.mjs";
8
8
  import { i as PostgresRlsPolicy, n as PostgresRlsEnablement, o as PostgresRole } from "./postgres-schema-DyUXtYIT-vb-RxpRN.mjs";
9
9
  import { r as computeContentHash } from "./canonicalize-RdxoUHao-DK_M6HU-.mjs";
10
- import { c as postgresNowGeneratorControlDescriptors, t as POLICY_BLOCK_KEYWORDS } from "./authoring-DhyLHFHA-pB4NuFxh.mjs";
10
+ import { c as postgresNowGeneratorControlDescriptors, t as POLICY_BLOCK_KEYWORDS } from "./authoring-DtjMn8TZ-sv84Cdw_.mjs";
11
11
  import { t as postgresRenderCheckExpressions } from "./check-expressions-7uCCP01t-WtUqfqkP.mjs";
12
- import { t as postgresTargetDescriptorMeta } from "./descriptor-meta-Bzs7kSyA-BjbnpZLW.mjs";
12
+ import { t as postgresTargetDescriptorMeta } from "./descriptor-meta-C0yUaYLH-CUtYbbZp.mjs";
13
13
  import { a as postgresDiffSubjectGranularity, i as postgresDiffSubjectEntityKind } from "./postgres-table-schema-node-BBkitBQh-DT1T5VWU.mjs";
14
14
  import { t as PostgresDatabaseSchemaNode } from "./postgres-role-schema-node-B8Z5i5D--PObwlU2Z.mjs";
15
15
  import { i as qualifyTableName } from "./planner-sql-checks-pkURMYMz-2QAIKyW-.mjs";
16
16
  import { r as diffPostgresSchema } from "./diff-database-schema-DyCIRT80-C1zMCmRx.mjs";
17
- import { t as PostgresContractSerializer } from "./postgres-contract-view-B-bLZB7o-zpuamDXT.mjs";
18
- import { o as postgresContractToSchema } from "./postgres-migration-BbXm1l5I-DDy8IgYB.mjs";
19
- import { t as createPostgresMigrationPlanner } from "./planner-CE4YoVdA-BfwuVRuT.mjs";
17
+ import { t as PostgresContractSerializer } from "./postgres-contract-view-Ctg2ire_-smoqnU-u.mjs";
18
+ import { o as postgresContractToSchema } from "./postgres-migration-BdFXT6xg-BPApPGX9.mjs";
19
+ import { t as createPostgresMigrationPlanner } from "./planner-BIOXTf-E-CFs_l_0M.mjs";
20
20
  import { n as MARKER_LOCK_SQL, t as MARKER_LOCK_KEY } from "./marker-lock-DFc1Tfv5-QMJSzMIa.mjs";
21
- import { _ as postgresNativeAuthoringTypes, a as buildIndexAttribute, c as buildNativeEnumBlock, d as inferPostgresPslContract, f as namedArg, g as positionalArg, h as parseDefaultAttributeString, i as buildFullTextIndexAttribute, n as buildAttribute, o as buildMapAttribute, r as buildCheckAttribute, s as buildModelConstraintAttribute, t as SYNTHETIC_SPAN, v as postgresPslTypeConstructors, y as postgresScalarAuthoringTypes } from "./type-constructors-C4QD_3HB-Czhx8fAX.mjs";
21
+ import { _ as postgresNativeAuthoringTypes, a as buildIndexAttribute, c as buildNativeEnumBlock, d as inferPostgresPslContract, f as namedArg, g as positionalArg, h as parseDefaultAttributeString, i as buildFullTextIndexAttribute, n as buildAttribute, o as buildMapAttribute, r as buildCheckAttribute, s as buildModelConstraintAttribute, t as SYNTHETIC_SPAN, v as postgresPslTypeConstructors, y as postgresScalarAuthoringTypes } from "./type-constructors-BEZJxWcZ-Co2GJw1M.mjs";
22
22
  import { dataTypeParams, requiredParamKeys, validateCodecTypeParams } from "@prisma/orm-framework/components/codec";
23
23
  import { blindCast } from "@prisma/orm-framework/utils/casts";
24
24
  import { isSqlDataType, unquotedSqlBaseName } from "@prisma/orm-family-sql/contract/data-type";
@@ -37,7 +37,7 @@ import { InternalError } from "@prisma/orm-framework/utils/internal-error";
37
37
  import { notOk, ok, okVoid } from "@prisma/orm-framework/utils/result";
38
38
  import { SqlSchemaVerifierBase } from "@prisma/orm-family-sql/family/ir";
39
39
  import { effectiveControlPolicy } from "@prisma/orm-framework/contract/types";
40
- import { defaultFunctionCallFor, fieldPresetCallFor, inferredTypeConstructors, mapDefault, pslTypeArgumentText } from "@prisma/orm-family-sql/family/psl-build";
40
+ import { generatorCallsFor, inferredTypeConstructors, mapDefault, pslTypeArgumentText } from "@prisma/orm-family-sql/family/psl-build";
41
41
  import { UNBOUND_PSL_NAMESPACE_NAME, UNSPECIFIED_PSL_NAMESPACE_ID, makePslNamespace, makePslNamespaceEntries } from "@prisma/orm-framework/components/psl-ast";
42
42
  import { Temporal } from "temporal-polyfill/full/implementation";
43
43
  import { SqlQueryError } from "@prisma/orm-family-sql/errors";
@@ -624,81 +624,45 @@ function refuseUnwritableLiteralDefault(input) {
624
624
  pslTypeName: input.pslTypeName
625
625
  });
626
626
  }
627
- function describePhases(phases) {
628
- return [phases.onCreate === void 0 ? void 0 : `"${phases.onCreate}" on create`, phases.onUpdate === void 0 ? void 0 : `"${phases.onUpdate}" on update`].filter((phase) => phase !== void 0).join(" and ");
629
- }
630
- function refuseGeneratorsNoPresetWritesTogether(phases) {
631
- throw unsupported(`column ${phases.coordinate} generates ${describePhases(phases)}, which cannot be written in Prisma 8 PSL.`, "The field preset in the configured stack that writes one of these generators for the column codec does not also write the other phase, so that phase would be dropped from the written file, and no default function in the configured stack writes the column's generators instead.", KEEP_SOURCE, {
632
- coordinate: phases.coordinate,
633
- onCreate: phases.onCreate,
634
- onUpdate: phases.onUpdate
635
- });
636
- }
627
+ const PHASE_TEXT = {
628
+ onCreate: "on create",
629
+ onUpdate: "on update"
630
+ };
637
631
  function describeGenerator(generator) {
638
632
  if (generator === void 0) return "no generator";
639
633
  const params = generator.params ?? {};
640
634
  return Object.keys(params).length === 0 ? `"${generator.id}"` : `"${generator.id}" with params ${canonicalizeJson(params)}`;
641
635
  }
642
- function describeDifference(difference) {
643
- switch (difference.part) {
644
- case "codecId": return `codec "${difference.printed}" instead of "${difference.column}"`;
645
- case "typeParams": return `type params ${canonicalizeJson(difference.printed ?? {})} instead of ${canonicalizeJson(difference.column ?? {})}`;
646
- case "onCreate":
647
- case "onUpdate": return `${difference.part === "onCreate" ? "on create" : "on update"} ${describeGenerator(difference.printed)} instead of ${describeGenerator(difference.column)}`;
648
- }
649
- }
650
- const COLUMN_TYPE_KINDS = {
651
- namedType: "a named type",
652
- valueObject: "a value object",
653
- enum: "an enum"
654
- };
655
- function describeUnwritableReason(reason) {
656
- switch (reason.kind) {
657
- case "columnType": return `its type ${reason.typeName} is ${COLUMN_TYPE_KINDS[reason.columnType]}, which the preset call would replace`;
658
- case "list": return "the column is a list, and a preset call cannot be a list element";
659
- case "unwritableArgument": return `its type param "${reason.argument}" is ${JSON.stringify(reason.value)}, which a PSL argument cannot carry`;
660
- case "argumentsRejected": return `the preset does not accept the call, since ${reason.message}`;
661
- }
662
- }
663
- function refuseUnwritablePresetCall(input) {
664
- throw unsupported(`column ${input.coordinate} cannot be written with field preset ${input.preset}: ${describeUnwritableReason(input.reason)}.`, "The printer writes a column's generators as the call of the field preset that writes the column's codec with them, or a create-only generator as the call of its default function. The preset call cannot be written for this column, and no default function in the configured stack writes its generators.", KEEP_SOURCE, {
665
- coordinate: input.coordinate,
666
- preset: input.preset,
667
- reason: input.reason
668
- });
669
- }
670
- function refusePresetCallReadingBackDifferently(input) {
671
- throw unsupported(`column ${input.coordinate} is written with field preset ${input.preset}, and that call reads back as a different column: ${input.differences.map(describeDifference).join("; ")}.`, "The printer writes a column's generators as the call of the field preset that writes the column's codec with them, and that call must read back with the column's codec, type params and generators. No default function in the configured stack writes its generators instead.", KEEP_SOURCE, {
636
+ function refuseGeneratorOnList(input) {
637
+ throw unsupported(`column ${input.coordinate} is a list and generates "${input.generatorId}" ${PHASE_TEXT[input.phase]}, which cannot be written in Prisma 8 PSL.`, "Prisma 8 PSL refuses `@onCreate(…)` and `@onUpdate(…)` on a list field, since a list has no generated value per element.", KEEP_SOURCE, {
672
638
  coordinate: input.coordinate,
673
- preset: input.preset,
674
- differences: input.differences
675
- });
676
- }
677
- function refuseGeneratorOnUpdate(phases) {
678
- throw unsupported(`column ${phases.coordinate} generates a value on update ("${phases.onUpdate}"), which cannot be written in Prisma 8 PSL.`, "`@default(…)` writes a generator for create only; a generator on update is written only through a field preset, and the configured stack has no field preset for the column codec that contract print can write with this generator.", KEEP_SOURCE, {
679
- coordinate: phases.coordinate,
680
- onCreate: phases.onCreate,
681
- onUpdate: phases.onUpdate
639
+ phase: input.phase,
640
+ generatorId: input.generatorId
682
641
  });
683
642
  }
684
643
  function refuseGeneratorWithoutPslFunction(input) {
685
- const { coordinate, onCreate, onUpdate, registeredBy } = input;
644
+ const { coordinate, phase, generatorId, codecId, registeredBy } = input;
686
645
  const meta = {
687
646
  coordinate,
688
- onCreate,
689
- onUpdate
647
+ phase,
648
+ generatorId,
649
+ codecId
690
650
  };
691
- if (registeredBy === void 0) throw unsupported(`column ${coordinate} is generated by "${onCreate}", which no component in the configured stack registers.`, "The printer writes each generator as the PSL call of the default function in the configured stack that produces it, and no component in the stack registers this generator.", "Add the extension that registers the generator and its default function to the config, or keep authoring this contract in its current source.", meta);
651
+ if (registeredBy === void 0) throw unsupported(`column ${coordinate} is generated by "${generatorId}" ${PHASE_TEXT[phase]}, which no component in the configured stack registers.`, `The printer writes each generator as \`@${phase}(fn(…))\` with the generator function the configured stack binds to the column's codec, and no component in the stack registers this generator.`, "Add the extension that registers the generator and its generator function to the config, or keep authoring this contract in its current source.", meta);
692
652
  const { componentId } = registeredBy;
693
- throw unsupported(`column ${coordinate} is generated by "${onCreate}", which ${componentId === void 0 ? "a configured component" : `"${componentId}"`} registers, but no default function in the configured stack declares how contract print writes it, and the stack has no field preset for the column codec that contract print can write with it.`, "The printer writes a generator as the call of the field preset that writes the column's codec with it, or else as the PSL call of the default function that declares `printArguments` for it. The configured stack has neither for this generator.", `If ${componentId === void 0 ? `the component that registers "${onCreate}"` : `"${componentId}"`} has a default function that produces ${componentId === void 0 ? "it" : `"${onCreate}"`}, its author must add \`printArguments\` for "${onCreate}" to it, as the upgrade instructions "contract-print-generated-values" for extension authors describe. Otherwise "${onCreate}" is written only through a field preset of the column codec, and the configured stack has none that contract print can write. Until then, keep authoring this contract in its current source.`, {
653
+ const registrant = componentId === void 0 ? "a configured component" : `"${componentId}"`;
654
+ throw unsupported(`column ${coordinate} is generated by "${generatorId}" ${PHASE_TEXT[phase]}, which ${registrant} registers, but no generator function in the configured stack writes it for codec "${codecId}".`, `The printer writes each generator as \`@${phase}(fn(…))\` with the generator function the configured stack binds to the column's codec, and no function bound to "${codecId}" produces this generator.`, `If ${componentId === void 0 ? `the component that registers "${generatorId}"` : `"${componentId}"`} declares a generator function that produces it, its author must bind that function to codec "${codecId}", as the upgrade instructions "default-generators-to-on-create" for extension authors describe. Until then, keep authoring this contract in its current source.`, {
694
655
  ...meta,
695
656
  ...ifDefined("componentId", componentId)
696
657
  });
697
658
  }
698
- function refuseGeneratorWithDatabaseDefault(input) {
699
- throw unsupported(`column ${input.coordinate} has both a generated value ("${input.onCreate}") and a database default, which cannot be written in Prisma 8 PSL.`, "`@default(…)` writes either the generator or the database default, so the other would be lost.", "Drop one of the two, or keep authoring this contract in its current source.", {
659
+ function refuseGeneratorReadingBackDifferently(input) {
660
+ throw unsupported(`column ${input.coordinate} generates ${describeGenerator(input.stored)} ${PHASE_TEXT[input.phase]}, but @${input.phase}(${input.call}) reads back as ${describeGenerator(input.readBack)}.`, "The printer writes each generator as the call of the generator function the configured stack binds to the column's codec, and that call must resolve back to the stored generator and params on the column.", KEEP_SOURCE, {
700
661
  coordinate: input.coordinate,
701
- onCreate: input.onCreate
662
+ phase: input.phase,
663
+ call: input.call,
664
+ stored: input.stored,
665
+ readBack: input.readBack
702
666
  });
703
667
  }
704
668
  /**
@@ -2110,62 +2074,47 @@ function buildColumnDefault(input) {
2110
2074
  });
2111
2075
  return parseDefaultAttributeString(result.attribute);
2112
2076
  }
2113
- function toPslArgument(argument) {
2114
- return argument.kind === "positional" ? positionalArg(argument.value) : namedArg(argument.name, argument.value);
2115
- }
2116
- /**
2117
- * How one column's execution generators are written in PSL: as the call of the field preset of the stack that writes the column's codec with them, or else a create-only generator as the `@default(<fn>(...))` call of the default function that declares `printArguments` for it. A column neither writes is refused, with the preset's reason when a preset writes its codec and generators.
2118
- */
2119
- function buildExecutionDefault(input) {
2120
- const { executionDefault, codecId, pslType, list, typeParams, coordinate, context } = input;
2121
- const onCreateId = executionDefault.onCreate?.id;
2122
- const onUpdateId = executionDefault.onUpdate?.id;
2123
- const phases = {
2124
- coordinate,
2125
- onCreate: onCreateId,
2126
- onUpdate: onUpdateId
2127
- };
2128
- const choice = fieldPresetCallFor({
2129
- fieldPresetsByCodecAndGenerator: context.fieldPresetsByCodecAndGenerator,
2130
- column: {
2077
+ function refuse(refusal, input) {
2078
+ const { coordinate, codecId, context } = input;
2079
+ const { phase, generator } = refusal;
2080
+ switch (refusal.kind) {
2081
+ case "on-list": return refuseGeneratorOnList({
2082
+ coordinate,
2083
+ phase,
2084
+ generatorId: generator.id
2085
+ });
2086
+ case "no-function": return refuseGeneratorWithoutPslFunction({
2087
+ coordinate,
2088
+ phase,
2089
+ generatorId: generator.id,
2131
2090
  codecId,
2132
- pslType,
2133
- list,
2134
- typeParams,
2135
- generators: executionDefault
2136
- }
2137
- });
2138
- if (choice.kind === "call") return {
2139
- kind: "preset",
2140
- path: choice.preset.path,
2141
- args: choice.arguments.map(toPslArgument)
2142
- };
2143
- const call = onCreateId === void 0 || onUpdateId !== void 0 ? void 0 : defaultFunctionCallFor(context.defaultFunctionPrintersByGenerator, onCreateId, executionDefault.onCreate?.params);
2144
- if (call !== void 0) return {
2145
- kind: "attribute",
2146
- attribute: buildAttribute("field", "default", [positionalArg(call)])
2147
- };
2148
- switch (choice.kind) {
2149
- case "cannotWrite":
2150
- if (choice.reason.kind === "phasesNotWrittenTogether") return refuseGeneratorsNoPresetWritesTogether(phases);
2151
- return refuseUnwritablePresetCall({
2152
- coordinate,
2153
- preset: choice.preset.path.join("."),
2154
- reason: choice.reason
2155
- });
2156
- case "readsBackDifferently": return refusePresetCallReadingBackDifferently({
2091
+ registeredBy: context.componentIdsByGenerator.has(generator.id) ? { componentId: context.componentIdsByGenerator.get(generator.id) } : void 0
2092
+ });
2093
+ case "reads-back-differently": return refuseGeneratorReadingBackDifferently({
2157
2094
  coordinate,
2158
- preset: choice.preset.path.join("."),
2159
- differences: choice.differences
2095
+ phase,
2096
+ call: refusal.text,
2097
+ stored: generator,
2098
+ readBack: refusal.readBack
2160
2099
  });
2161
- case "noPreset":
2162
- if (onUpdateId !== void 0) return refuseGeneratorOnUpdate(phases);
2163
- return refuseGeneratorWithoutPslFunction({
2164
- ...phases,
2165
- registeredBy: onCreateId !== void 0 && context.componentIdsByGenerator.has(onCreateId) ? { componentId: context.componentIdsByGenerator.get(onCreateId) } : void 0
2166
- });
2167
2100
  }
2168
2101
  }
2102
+ /**
2103
+ * The `@onCreate(fn(...))` and `@onUpdate(fn(...))` attributes that write one column's generators. A column whose generators cannot be written as calls that read back the same is refused.
2104
+ */
2105
+ function buildGeneratorAttributes(input) {
2106
+ const result = generatorCallsFor({
2107
+ executionDefault: input.executionDefault,
2108
+ field: {
2109
+ codecId: input.codecId,
2110
+ typeParams: input.typeParams
2111
+ },
2112
+ list: input.list,
2113
+ generatorFunctions: input.context.generatorFunctions
2114
+ });
2115
+ if (!result.ok) refuse(result.refusal, input);
2116
+ return result.calls.map(({ phase, text }) => buildAttribute("field", phase, [positionalArg(text)]));
2117
+ }
2169
2118
  /** The generated values of the contract, keyed by the column they fill. */
2170
2119
  function executionDefaultsByColumn(contract) {
2171
2120
  const byColumn = /* @__PURE__ */ new Map();
@@ -2179,7 +2128,7 @@ function executionDefaultsByColumn(contract) {
2179
2128
  function scalarFieldAttributes(input) {
2180
2129
  const attributes = [];
2181
2130
  if (input.isSingleColumnId) attributes.push(buildAttribute("field", "id", input.primaryKeyName === void 0 ? [] : [namedArg("map", `"${escapePslString(input.primaryKeyName)}"`)]));
2182
- const columnDefault = input.generatedDefault ?? buildColumnDefault({
2131
+ const columnDefault = buildColumnDefault({
2183
2132
  column: input.column,
2184
2133
  pslTypeName: input.pslTypeName,
2185
2134
  isEnum: input.isEnum,
@@ -2191,6 +2140,7 @@ function scalarFieldAttributes(input) {
2191
2140
  namedTypes: input.namedTypes
2192
2141
  });
2193
2142
  if (columnDefault !== void 0) attributes.push(columnDefault);
2143
+ attributes.push(...input.generatorAttributes);
2194
2144
  const mapName = pslFieldMapName(input.fieldName, input.columnName);
2195
2145
  if (mapName !== void 0) attributes.push(buildMapAttribute("field", mapName));
2196
2146
  return attributes;
@@ -2247,37 +2197,20 @@ function buildScalarFields(input) {
2247
2197
  coordinate,
2248
2198
  namespaceId: entry.namespaceId
2249
2199
  });
2250
- let { typeName, typeConstructor } = columnType;
2200
+ const { typeName, typeConstructor } = columnType;
2251
2201
  const execution = executionDefaults.get(JSON.stringify([
2252
2202
  entry.namespaceId,
2253
2203
  entry.tableName,
2254
2204
  columnName
2255
2205
  ]));
2256
- let generatedDefault;
2257
- if (execution !== void 0) {
2258
- const built = buildExecutionDefault({
2259
- executionDefault: execution,
2260
- codecId: column.codecId,
2261
- pslType: columnType,
2262
- list: !!field.many,
2263
- typeParams: column.typeParams,
2264
- coordinate,
2265
- context
2266
- });
2267
- if (built.kind === "preset") {
2268
- typeName = built.path.join(".");
2269
- typeConstructor = {
2270
- kind: "typeConstructor",
2271
- path: built.path,
2272
- args: built.args,
2273
- span: SYNTHETIC_SPAN
2274
- };
2275
- } else if (column.default !== void 0) refuseGeneratorWithDatabaseDefault({
2276
- coordinate,
2277
- onCreate: execution.onCreate?.id
2278
- });
2279
- else generatedDefault = built.attribute;
2280
- }
2206
+ const generatorAttributes = execution === void 0 ? [] : buildGeneratorAttributes({
2207
+ executionDefault: execution,
2208
+ codecId: column.codecId,
2209
+ list: !!field.many,
2210
+ typeParams: resolvedTypeParams(column, input.namedTypes),
2211
+ coordinate,
2212
+ context
2213
+ });
2281
2214
  fields.push({
2282
2215
  kind: "field",
2283
2216
  name: fieldName,
@@ -2297,7 +2230,7 @@ function buildScalarFields(input) {
2297
2230
  pslTypeName: columnType.typeName,
2298
2231
  isEnum: column.codecId === PG_ENUM_CODEC_ID,
2299
2232
  domainEnum: column.codecId === "pg/enum@1" || column.valueSet === void 0 ? void 0 : domainEnums[column.valueSet.entityName],
2300
- generatedDefault,
2233
+ generatorAttributes,
2301
2234
  context,
2302
2235
  namedTypes: input.namedTypes
2303
2236
  }),