@prisma/orm-target-postgres 8.0.0-rc.19 → 8.0.0-rc.19-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{adapter-D_h3CcXJ.d.mts → adapter-DLPamqZO.d.mts} +9 -9
- package/dist/{adapter-D_h3CcXJ.d.mts.map → adapter-DLPamqZO.d.mts.map} +1 -1
- package/dist/adapter.d.mts +1 -1
- package/dist/adapter__adapter.d.mts +1 -1
- package/dist/adapter__control.mjs +1 -5
- package/dist/adapter__control.mjs.map +1 -1
- package/dist/adapter__runtime.mjs +1 -1
- package/dist/{aggregates-C2xqsGZ2.d.mts → aggregates-BjiTuckw.d.mts} +9 -9
- package/dist/{aggregates-C2xqsGZ2.d.mts.map → aggregates-BjiTuckw.d.mts.map} +1 -1
- package/dist/{authoring-NKZZKf0m-aFhCcgbc.mjs → authoring-VPJEKQsx-B3xbnZ0h.mjs} +21 -7
- package/dist/authoring-VPJEKQsx-B3xbnZ0h.mjs.map +1 -0
- package/dist/{control-C6XU7Guz.d.mts → control-Cu-SPW3N.d.mts} +4 -4
- package/dist/{control-C6XU7Guz.d.mts.map → control-Cu-SPW3N.d.mts.map} +1 -1
- package/dist/{control-policy-XDdMfbBp-Bf5qOmWS.mjs → control-policy-CKpFHf2M-DiTgsTUn.mjs} +7 -10
- package/dist/control-policy-CKpFHf2M-DiTgsTUn.mjs.map +1 -0
- package/dist/{descriptor-meta-nvriPVgI-B-ZW5haL.mjs → descriptor-meta-BC8Pg1Bl-BHgZYJCX.mjs} +7 -4
- package/dist/descriptor-meta-BC8Pg1Bl-BHgZYJCX.mjs.map +1 -0
- package/dist/{diff-database-schema-BjbxFQr1-CxXB4GhI.mjs → diff-database-schema-BIPAJn7W-DhU2uiVA.mjs} +3 -3
- package/dist/{diff-database-schema-BjbxFQr1-CxXB4GhI.mjs.map → diff-database-schema-BIPAJn7W-DhU2uiVA.mjs.map} +1 -1
- package/dist/{infer-psl-contract-CwtwKri_-Ccao-UmG.mjs → infer-psl-contract-DEHEkYxP-D1nRXaLH.mjs} +3 -3
- package/dist/{infer-psl-contract-CwtwKri_-Ccao-UmG.mjs.map → infer-psl-contract-DEHEkYxP-D1nRXaLH.mjs.map} +1 -1
- package/dist/{issue-planner-DYLByGrp.d.mts → issue-planner-B2iWCR_t.d.mts} +2 -4
- package/dist/issue-planner-B2iWCR_t.d.mts.map +1 -0
- package/dist/migration-CbOh59ZJ.mjs.map +1 -1
- package/dist/{pack-BycbuOFo.d.mts → pack-BLeBhGWE.d.mts} +503 -1
- package/dist/pack-BLeBhGWE.d.mts.map +1 -0
- package/dist/{planner-Dzp0sfa8-BQQk49Bc.mjs → planner-DnjJIgvS-YnoVZc2N.mjs} +6 -8
- package/dist/planner-DnjJIgvS-YnoVZc2N.mjs.map +1 -0
- package/dist/{planner-ddl-builders-DbG9_uAk.d.mts → planner-ddl-builders-BvK8Reg3.d.mts} +4 -4
- package/dist/{planner-ddl-builders-DbG9_uAk.d.mts.map → planner-ddl-builders-BvK8Reg3.d.mts.map} +1 -1
- package/dist/{planner-ddl-builders-BKxUQ0nH-DJB_oubi.mjs → planner-ddl-builders-D7TKi2Cg-Bxxam4cQ.mjs} +6 -7
- package/dist/planner-ddl-builders-D7TKi2Cg-Bxxam4cQ.mjs.map +1 -0
- package/dist/{planner-identity-values-DhXsY-NI-BxiK5eXi.mjs → planner-identity-values-kXe6EviB-BfD5Gxo_.mjs} +4 -6
- package/dist/planner-identity-values-kXe6EviB-BfD5Gxo_.mjs.map +1 -0
- package/dist/{planner-identity-values-B-NAiN7I.d.mts → planner-identity-values-lke8kYOC.d.mts} +3 -3
- package/dist/planner-identity-values-lke8kYOC.d.mts.map +1 -0
- package/dist/{planner-produced-postgres-migration-HAdTAokB-mZ-CNMWW.mjs → planner-produced-postgres-migration-BRGqjq30-3uFr1J4_.mjs} +3 -3
- package/dist/{planner-produced-postgres-migration-HAdTAokB-mZ-CNMWW.mjs.map → planner-produced-postgres-migration-BRGqjq30-3uFr1J4_.mjs.map} +1 -1
- package/dist/{postgres-contract-view-BkuNbRzj-DXXkgI5Y.mjs → postgres-contract-view-DRppzflo-DxrBP7Tj.mjs} +3 -3
- package/dist/{postgres-contract-view-BkuNbRzj-DXXkgI5Y.mjs.map → postgres-contract-view-DRppzflo-DxrBP7Tj.mjs.map} +1 -1
- package/dist/{postgres-migration-Bi7QKUYk-ed-QEmS1.mjs → postgres-migration-B46jBuCV-ByXR4shS.mjs} +5 -5
- package/dist/{postgres-migration-Bi7QKUYk-ed-QEmS1.mjs.map → postgres-migration-B46jBuCV-ByXR4shS.mjs.map} +1 -1
- package/dist/{prisma7-binding-l7PybwgY.mjs → prisma7-binding-DsXmgX4b.mjs} +5 -5
- package/dist/prisma7-binding-DsXmgX4b.mjs.map +1 -0
- package/dist/{prisma7-binding-ynOpJPog.d.mts → prisma7-binding-kYc2Xcxt.d.mts} +503 -1
- package/dist/prisma7-binding-kYc2Xcxt.d.mts.map +1 -0
- package/dist/target.d.mts +8 -8
- package/dist/target.mjs +11 -11
- package/dist/target__aggregates.d.mts +1 -1
- package/dist/target__control.d.mts +2 -2
- package/dist/target__control.mjs +28 -82
- package/dist/target__control.mjs.map +1 -1
- package/dist/target__diff-database-schema.mjs +1 -1
- package/dist/target__issue-planner.d.mts +1 -1
- package/dist/target__issue-planner.mjs +1 -1
- package/dist/target__migration.mjs +1 -1
- package/dist/target__pack.d.mts +1 -1
- package/dist/target__pack.mjs +1 -1
- package/dist/target__planner-ddl-builders.d.mts +1 -1
- package/dist/target__planner-ddl-builders.mjs +1 -1
- package/dist/target__planner-identity-values.d.mts +1 -1
- package/dist/target__planner-identity-values.mjs +1 -1
- package/dist/target__planner-produced-postgres-migration.mjs +1 -1
- package/dist/target__planner.mjs +2 -2
- package/dist/target__prisma7-binding.d.mts +1 -1
- package/dist/target__prisma7-binding.mjs +1 -1
- package/dist/target__runtime.mjs +2 -2
- package/dist/target__runtime.mjs.map +1 -1
- package/package.json +9 -9
- package/dist/authoring-NKZZKf0m-aFhCcgbc.mjs.map +0 -1
- package/dist/control-policy-XDdMfbBp-Bf5qOmWS.mjs.map +0 -1
- package/dist/descriptor-meta-nvriPVgI-B-ZW5haL.mjs.map +0 -1
- package/dist/issue-planner-DYLByGrp.d.mts.map +0 -1
- package/dist/pack-BycbuOFo.d.mts.map +0 -1
- package/dist/planner-Dzp0sfa8-BQQk49Bc.mjs.map +0 -1
- package/dist/planner-ddl-builders-BKxUQ0nH-DJB_oubi.mjs.map +0 -1
- package/dist/planner-identity-values-B-NAiN7I.d.mts.map +0 -1
- package/dist/planner-identity-values-DhXsY-NI-BxiK5eXi.mjs.map +0 -1
- package/dist/prisma7-binding-l7PybwgY.mjs.map +0 -1
- package/dist/prisma7-binding-ynOpJPog.d.mts.map +0 -1
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-CN4hGOBI.mjs";
|
|
15
15
|
import { t as postgresCodecTraitsOf } from "./postgres-codec-traits-C8pMXZ1--D7uZOMyN.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 postgresNativeAuthoringTypes, d as postgresNowGenerators, f as
|
|
17
|
+
import { c as postgresNativeAuthoringTypes, d as postgresNowGenerators, f as postgresScalarAndNativeTypeConstructors, l as postgresNowGeneratorControlDescriptors, p as postgresScalarAuthoringTypes } from "./authoring-VPJEKQsx-B3xbnZ0h.mjs";
|
|
18
18
|
import { t as postgresRenderCheckExpressions } from "./check-expressions-7uCCP01t-WtUqfqkP.mjs";
|
|
19
19
|
import { t as postgresDataTypeEntries } from "./data-type-entries-B7ROystY-Bb3OHfWo.mjs";
|
|
20
20
|
import { n as PostgresSchemaNodeKind, r as PostgresTableSchemaNode, t as PostgresNativeEnumSchemaNode } from "./postgres-table-schema-node-BBkitBQh-DT1T5VWU.mjs";
|
|
@@ -24,22 +24,22 @@ import { n as renderFullTextIndexDocument } from "./full-text-search-document-Do
|
|
|
24
24
|
import { r as resolveDdlSchemaForNamespaceStorage } from "./resolve-ddl-schema-D3VNPMSm-DVuswLch.mjs";
|
|
25
25
|
import { a as stackDataTypes, i as qualifyTableName, t as alterTypeCheck } from "./planner-sql-checks-DJ9RWk0S-DpNK0_as.mjs";
|
|
26
26
|
import { A as RenameConstraintCall, C as DropNativeEnumTypeCall, D as EnableRowLevelSecurityCall, E as DropTableCall, F as SetNotNullCall, M as RenamePostgresRlsPolicyCall, N as RenameTableCall, O as RawSqlCall, P as SetDefaultCall, R as createExtension, 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 RenameIndexCall, k as RenameColumnCall, 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-B5_tnifS-BGaMVQ8g.mjs";
|
|
27
|
-
import { t as buildColumnTypeSql } from "./planner-ddl-builders-
|
|
28
|
-
import { n as resolveIdentityValue, t as buildBuiltinIdentityValue } from "./planner-identity-values-
|
|
29
|
-
import { a as planIssues, t as coalesceSubtreeIssues } from "./control-policy-
|
|
30
|
-
import { n as contractToPostgresDatabaseSchemaNode, t as buildPostgresPlanDiff } from "./diff-database-schema-
|
|
31
|
-
import { n as PostgresContractView, t as PostgresContractSerializer } from "./postgres-contract-view-
|
|
27
|
+
import { t as buildColumnTypeSql } from "./planner-ddl-builders-D7TKi2Cg-Bxxam4cQ.mjs";
|
|
28
|
+
import { n as resolveIdentityValue, t as buildBuiltinIdentityValue } from "./planner-identity-values-kXe6EviB-BfD5Gxo_.mjs";
|
|
29
|
+
import { a as planIssues, t as coalesceSubtreeIssues } from "./control-policy-CKpFHf2M-DiTgsTUn.mjs";
|
|
30
|
+
import { n as contractToPostgresDatabaseSchemaNode, t as buildPostgresPlanDiff } from "./diff-database-schema-BIPAJn7W-DhU2uiVA.mjs";
|
|
31
|
+
import { n as PostgresContractView, t as PostgresContractSerializer } from "./postgres-contract-view-DRppzflo-DxrBP7Tj.mjs";
|
|
32
32
|
import { t as dataTransform } from "./data-transform-h9agBu_c-B5dsDs8G.mjs";
|
|
33
|
-
import { t as PostgresMigration } from "./postgres-migration-
|
|
33
|
+
import { t as PostgresMigration } from "./postgres-migration-B46jBuCV-ByXR4shS.mjs";
|
|
34
34
|
import { t as renderOps } from "./render-ops-DzfUHzbE-aSmN95s3.mjs";
|
|
35
35
|
import { t as renderCallsToTypeScript } from "./render-typescript-Dqp1Spgn-B128r1qw.mjs";
|
|
36
|
-
import { t as TypeScriptRenderablePostgresMigration } from "./planner-produced-postgres-migration-
|
|
37
|
-
import { t as createPostgresMigrationPlanner } from "./planner-
|
|
36
|
+
import { t as TypeScriptRenderablePostgresMigration } from "./planner-produced-postgres-migration-BRGqjq30-3uFr1J4_.mjs";
|
|
37
|
+
import { t as createPostgresMigrationPlanner } from "./planner-DnjJIgvS-YnoVZc2N.mjs";
|
|
38
38
|
import { n as MARKER_LOCK_SQL, t as MARKER_LOCK_KEY } from "./marker-lock-DFc1Tfv5-QMJSzMIa.mjs";
|
|
39
39
|
import { c as toTsquery, l as websearchToTsquery, n as fullTextDocument, o as phrasetoTsquery, s as plaintoTsquery, t as FullTextDocument } from "./full-text-parsers-CFFxiOrp-BmiwdZ21.mjs";
|
|
40
40
|
import { t as tsquery } from "./full-text-8PmilGkW.mjs";
|
|
41
41
|
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";
|
|
42
42
|
import { t as introspectedTypeText } from "./native-type-normalizer-B7L7_uaK.mjs";
|
|
43
43
|
import { i as hasUniqueConstraint, n as hasForeignKey, r as hasIndex, t as buildSchemaLookupMap } from "./planner-schema-lookup-CdgWer9s.mjs";
|
|
44
|
-
import { t as prisma7PostgresBinding } from "./prisma7-binding-
|
|
45
|
-
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_RAW_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, pgJsonbEnumRefusal, 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,
|
|
44
|
+
import { t as prisma7PostgresBinding } from "./prisma7-binding-DsXmgX4b.mjs";
|
|
45
|
+
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_RAW_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, pgJsonbEnumRefusal, 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, postgresRenderCheckExpressions, postgresResolveDefault, postgresScalarAndNativeTypeConstructors, postgresScalarAuthoringTypes, postgresTextDataTypes, 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-
|
|
1
|
+
import { t as postgresAggregateDescriptors } from "./aggregates-BjiTuckw.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
|
|
4
|
-
export { decodePostgresListText, postgresTargetDescriptor as default, parsePostgresListText, postgresNativeAuthoringTypes, postgresNowGeneratorControlDescriptors,
|
|
3
|
+
import { i as postgresTargetDescriptor, n as postgresScalarAndNativeTypeConstructors, r as postgresScalarAuthoringTypes, t as postgresNativeAuthoringTypes } from "./control-Cu-SPW3N.mjs";
|
|
4
|
+
export { decodePostgresListText, postgresTargetDescriptor as default, parsePostgresListText, postgresNativeAuthoringTypes, postgresNowGeneratorControlDescriptors, postgresScalarAndNativeTypeConstructors, postgresScalarAuthoringTypes };
|
package/dist/target__control.mjs
CHANGED
|
@@ -7,25 +7,25 @@ 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-C6w1rzOF-bzaF5PIS.mjs";
|
|
9
9
|
import { r as computeContentHash } from "./canonicalize-RdxoUHao-DK_M6HU-.mjs";
|
|
10
|
-
import { c as postgresNativeAuthoringTypes, f as
|
|
10
|
+
import { c as postgresNativeAuthoringTypes, f as postgresScalarAndNativeTypeConstructors, l as postgresNowGeneratorControlDescriptors, p as postgresScalarAuthoringTypes, t as POLICY_BLOCK_KEYWORDS } from "./authoring-VPJEKQsx-B3xbnZ0h.mjs";
|
|
11
11
|
import { t as postgresRenderCheckExpressions } from "./check-expressions-7uCCP01t-WtUqfqkP.mjs";
|
|
12
|
-
import { t as postgresTargetDescriptorMeta } from "./descriptor-meta-
|
|
12
|
+
import { t as postgresTargetDescriptorMeta } from "./descriptor-meta-BC8Pg1Bl-BHgZYJCX.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-DJ9RWk0S-DpNK0_as.mjs";
|
|
16
|
-
import { r as diffPostgresSchema } from "./diff-database-schema-
|
|
17
|
-
import { t as PostgresContractSerializer } from "./postgres-contract-view-
|
|
18
|
-
import { o as postgresContractToSchema } from "./postgres-migration-
|
|
19
|
-
import { t as createPostgresMigrationPlanner } from "./planner-
|
|
16
|
+
import { r as diffPostgresSchema } from "./diff-database-schema-BIPAJn7W-DhU2uiVA.mjs";
|
|
17
|
+
import { t as PostgresContractSerializer } from "./postgres-contract-view-DRppzflo-DxrBP7Tj.mjs";
|
|
18
|
+
import { o as postgresContractToSchema } from "./postgres-migration-B46jBuCV-ByXR4shS.mjs";
|
|
19
|
+
import { t as createPostgresMigrationPlanner } from "./planner-DnjJIgvS-YnoVZc2N.mjs";
|
|
20
20
|
import { n as MARKER_LOCK_SQL, t as MARKER_LOCK_KEY } from "./marker-lock-DFc1Tfv5-QMJSzMIa.mjs";
|
|
21
|
-
import { 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 } from "./infer-psl-contract-
|
|
21
|
+
import { 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 } from "./infer-psl-contract-DEHEkYxP-D1nRXaLH.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 { InternalError } from "@prisma/orm-framework/utils/internal-error";
|
|
25
25
|
import { isSqlDataType, sqlCodecColumnLength, unquotedSqlBaseName } from "@prisma/orm-family-sql/contract/data-type";
|
|
26
26
|
import { escapePslString } from "@prisma/orm-family-sql/contract/data-type-support";
|
|
27
27
|
import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
|
|
28
|
-
import { StorageColumn,
|
|
28
|
+
import { StorageColumn, nonEmptyTypeParams } from "@prisma/orm-family-sql/contract/types";
|
|
29
29
|
import { APP_SPACE_ID, failedPrecheckWhy, schemaCheckWhy, withFailingSpace } from "@prisma/orm-framework/components/control";
|
|
30
30
|
import { assertDefined, invariant } from "@prisma/orm-framework/utils/assertions";
|
|
31
31
|
import { composeCheckWirePrefix, computeCheckContentHash, computeIndexContentHash, formatWireName, parseNaming } from "@prisma/orm-family-sql/schema-ir/naming";
|
|
@@ -706,7 +706,7 @@ function refuseFieldColumnMismatch(input) {
|
|
|
706
706
|
if (input.singleTableVariant && !column.nullable) throw unsupported(`column ${coordinate} of single-table variant "${input.modelName}" is not nullable, which cannot be written in Prisma 8 PSL.`, "The PSL source makes every column of a single-table variant nullable, because the base's other rows leave it empty.", fix, { coordinate });
|
|
707
707
|
if (!input.singleTableVariant && field.nullable !== column.nullable) throw unsupported(`field ${coordinate} is ${field.nullable ? "optional" : "required"} but its column is ${column.nullable ? "nullable" : "not nullable"}, which cannot be written in Prisma 8 PSL.`, "PSL writes `?` once, and the PSL source derives the column from the field.", fix, { coordinate });
|
|
708
708
|
if ((field.type.kind === "scalar" && !!field.many) !== (column.many !== false)) throw unsupported(`field ${coordinate} is ${field.many ? "a list" : "not a list"} but its column is ${column.many !== false ? "a list" : "not a list"}, which cannot be written in Prisma 8 PSL.`, "PSL writes `[]` once: the PSL source stores a list of scalars in a list column, and a list of value objects in one JSON column.", fix, { coordinate });
|
|
709
|
-
if (field.type.kind === "scalar" && (field.type.codecId !== column.codecId || !sameJson(
|
|
709
|
+
if (field.type.kind === "scalar" && (field.type.codecId !== column.codecId || !sameJson(nonEmptyTypeParams(field.type.typeParams), nonEmptyTypeParams(column.typeParams)))) throw unsupported(`field ${coordinate} has a different codec or type parameters from its column, which cannot be written in Prisma 8 PSL.`, "The PSL source derives a scalar field's codec and type parameters from its column.", fixForEarlierRelease, { coordinate });
|
|
710
710
|
if (field.type.kind !== "scalar" || column.codecId === "pg/enum@1") return;
|
|
711
711
|
const enumName = column.valueSet?.entityName;
|
|
712
712
|
const derived = derivedValueSetRefs(enumName);
|
|
@@ -756,19 +756,6 @@ function refuseStorageOfUndeclaredField(input) {
|
|
|
756
756
|
field: fieldName
|
|
757
757
|
});
|
|
758
758
|
}
|
|
759
|
-
/**
|
|
760
|
-
* Refuses a column typed by a named type when the contract declares no such type, or when the
|
|
761
|
-
* column's data type or codec is not the named type's. PSL writes the column as the name of the
|
|
762
|
-
* type, and the PSL source copies both from the named type.
|
|
763
|
-
*/
|
|
764
|
-
function refuseColumnDifferingFromNamedType(input) {
|
|
765
|
-
const { column, typeRef, namedType, coordinate } = input;
|
|
766
|
-
if (namedType?.dataType === column.dataType && namedType.codecId === column.codecId) return;
|
|
767
|
-
throw unsupported(namedType === void 0 ? `column ${coordinate} is typed by the named type "${typeRef}", which the contract does not declare, so it cannot be written in Prisma 8 PSL.` : `column ${coordinate} is typed by the named type "${typeRef}" but has a different data type or codec from it, which cannot be written in Prisma 8 PSL.`, "PSL writes such a column as the name of its named type, and the PSL source gives the column the data type and codec of that named type.", "Make the column and its named type agree, or keep authoring this contract in its current source.", {
|
|
768
|
-
coordinate,
|
|
769
|
-
typeRef
|
|
770
|
-
});
|
|
771
|
-
}
|
|
772
759
|
function refuseColumnControl(column, coordinate) {
|
|
773
760
|
if (column.control === void 0) return;
|
|
774
761
|
throw unsupported(`column ${coordinate} carries its own control policy "${column.control}", which cannot be written in Prisma 8 PSL.`, "PSL declares a control policy per model with `@@control`; a field has no control attribute.", "Move the policy to the model, or keep authoring this contract in its current source.", {
|
|
@@ -825,8 +812,7 @@ function refuseUnderivedVariantLink(entry, variant) {
|
|
|
825
812
|
dataType: base.dataType,
|
|
826
813
|
codecId: base.codecId,
|
|
827
814
|
nullable: false,
|
|
828
|
-
...ifDefined("typeParams", base.typeParams)
|
|
829
|
-
...ifDefined("typeRef", base.typeRef)
|
|
815
|
+
...ifDefined("typeParams", base.typeParams)
|
|
830
816
|
});
|
|
831
817
|
return sameJson(entry.table.columns[column], expected);
|
|
832
818
|
});
|
|
@@ -1099,6 +1085,12 @@ function refuseNamespaceNamedUnbound(namespaceId) {
|
|
|
1099
1085
|
throw unsupported(`namespace "${namespaceId}" cannot be written in Prisma 8 PSL, because \`namespace ${UNBOUND_PSL_NAMESPACE_NAME}\` is how PSL writes the late-binding namespace.`, `The PSL source reads \`namespace ${UNBOUND_PSL_NAMESPACE_NAME}\` as the late-binding namespace "${UNBOUND_NAMESPACE_ID}", so everything in this namespace would move there.`, "Rename the namespace, or keep authoring this contract in its current source.", { namespaceId });
|
|
1100
1086
|
}
|
|
1101
1087
|
/** Refuses top-level `meta` entries: the PSL source reads back an empty `meta`. */
|
|
1088
|
+
/** Refuses a contract that registers database types in `storage.types`: only an extension's contract space does, and PSL has no syntax to declare one. */
|
|
1089
|
+
function refuseRegisteredDatabaseTypes(contract) {
|
|
1090
|
+
const types = Object.keys(contract.storage.types ?? {}).sort();
|
|
1091
|
+
if (types.length === 0) return;
|
|
1092
|
+
throw unsupported(`This contract registers the database types ${types.join(", ")}, which PSL cannot declare. It is an extension's contract space, written in TypeScript.`, "Printing it would drop the registered types and change its storage hash.", "Keep authoring this contract space in TypeScript.", { types });
|
|
1093
|
+
}
|
|
1102
1094
|
function refuseContractMeta(contract) {
|
|
1103
1095
|
const keys = Object.keys(contract.meta);
|
|
1104
1096
|
if (keys.length === 0) return;
|
|
@@ -1194,7 +1186,7 @@ function refuseUnwritableMappedName(kind, name) {
|
|
|
1194
1186
|
}
|
|
1195
1187
|
/**
|
|
1196
1188
|
* Refuses a name the printer writes where PSL reads an identifier: a namespace, model, field, value
|
|
1197
|
-
* object, enum, enum member, native enum,
|
|
1189
|
+
* object, enum, enum member, native enum, policy, role or index option key.
|
|
1198
1190
|
*/
|
|
1199
1191
|
function refuseUnwritableName(kind, name) {
|
|
1200
1192
|
refuseNameThePslSourceLoses(kind, name);
|
|
@@ -1308,7 +1300,7 @@ function dataTypeOfMember(type, coordinate, context) {
|
|
|
1308
1300
|
if (descriptor === void 0) refuseMemberCodecWithoutNativeType(codecId, coordinate);
|
|
1309
1301
|
const dataType = context.dataTypes.lookup.get(descriptor.dataType);
|
|
1310
1302
|
if (dataType === void 0 || !isSqlDataType(dataType)) refuseMemberCodecWithoutNativeType(codecId, coordinate);
|
|
1311
|
-
const typeParams =
|
|
1303
|
+
const typeParams = nonEmptyTypeParams(type.typeParams);
|
|
1312
1304
|
if (typeParams === void 0) {
|
|
1313
1305
|
if (requiredParamKeys(dataType).length > 0) refuseMemberCodecNeedingTypeParameters(codecId, coordinate);
|
|
1314
1306
|
return dataType.id;
|
|
@@ -1389,38 +1381,6 @@ function buildCompositeTypes(input) {
|
|
|
1389
1381
|
};
|
|
1390
1382
|
});
|
|
1391
1383
|
}
|
|
1392
|
-
/** The document's `types { … }` block, one declaration per named storage type. */
|
|
1393
|
-
function buildTypesBlock(contract, inferredConstructors, context) {
|
|
1394
|
-
const declarations = [];
|
|
1395
|
-
for (const [name, instance] of Object.entries(contract.storage.types ?? {})) {
|
|
1396
|
-
refuseUnwritableName("named type", name);
|
|
1397
|
-
const { typeName, typeConstructor } = buildColumnType({
|
|
1398
|
-
column: new StorageColumn({
|
|
1399
|
-
dataType: instance.dataType,
|
|
1400
|
-
codecId: instance.codecId,
|
|
1401
|
-
nullable: false,
|
|
1402
|
-
...ifDefined("typeParams", instance.typeParams)
|
|
1403
|
-
}),
|
|
1404
|
-
inferredConstructors,
|
|
1405
|
-
authoringTypes: context.authoringContributions.type,
|
|
1406
|
-
dataTypes: context.dataTypes,
|
|
1407
|
-
enumBlockNames: /* @__PURE__ */ new Map(),
|
|
1408
|
-
coordinate: `types.${name}`
|
|
1409
|
-
});
|
|
1410
|
-
declarations.push({
|
|
1411
|
-
kind: "namedType",
|
|
1412
|
-
name,
|
|
1413
|
-
...typeConstructor === void 0 ? { baseType: typeName } : { typeConstructor },
|
|
1414
|
-
attributes: [],
|
|
1415
|
-
span: SYNTHETIC_SPAN
|
|
1416
|
-
});
|
|
1417
|
-
}
|
|
1418
|
-
return declarations.length === 0 ? void 0 : {
|
|
1419
|
-
kind: "types",
|
|
1420
|
-
declarations,
|
|
1421
|
-
span: SYNTHETIC_SPAN
|
|
1422
|
-
};
|
|
1423
|
-
}
|
|
1424
1384
|
/**
|
|
1425
1385
|
* One `enum <name> { … }` block per domain enum, each member written as `Name = <value>` under
|
|
1426
1386
|
* `@@type`. The PSL source reads a member as a written value of the enum codec's data type, so each
|
|
@@ -2076,7 +2036,7 @@ function buildColumnDefault(input) {
|
|
|
2076
2036
|
const result = mapDefault(columnDefault, {
|
|
2077
2037
|
dataTypes: context.dataTypes,
|
|
2078
2038
|
columnCodec: context.codecLookup.descriptorFor(input.isEnum ? PG_TEXT_CODEC_ID : input.column.codecId),
|
|
2079
|
-
typeParams:
|
|
2039
|
+
typeParams: nonEmptyTypeParams(input.column.typeParams),
|
|
2080
2040
|
list: input.column.many !== false
|
|
2081
2041
|
});
|
|
2082
2042
|
if (result === void 0) refuseUnwritableLiteralDefault({
|
|
@@ -2150,8 +2110,7 @@ function scalarFieldAttributes(input) {
|
|
|
2150
2110
|
namespaceId: input.namespaceId,
|
|
2151
2111
|
tableName: input.tableName,
|
|
2152
2112
|
columnName: input.columnName,
|
|
2153
|
-
context: input.context
|
|
2154
|
-
namedTypes: input.namedTypes
|
|
2113
|
+
context: input.context
|
|
2155
2114
|
});
|
|
2156
2115
|
if (columnDefault !== void 0) attributes.push(columnDefault);
|
|
2157
2116
|
attributes.push(...input.generatorAttributes);
|
|
@@ -2187,19 +2146,9 @@ function buildScalarFields(input) {
|
|
|
2187
2146
|
coordinate,
|
|
2188
2147
|
modelName: entry.name,
|
|
2189
2148
|
singleTableVariant: variant?.singleTable === true,
|
|
2190
|
-
domainEnumNames: input.defaultDomainEnumNames
|
|
2191
|
-
namedTypes: input.namedTypes
|
|
2192
|
-
});
|
|
2193
|
-
if (column.typeRef !== void 0) refuseColumnDifferingFromNamedType({
|
|
2194
|
-
column,
|
|
2195
|
-
typeRef: column.typeRef,
|
|
2196
|
-
namedType: input.namedTypes[column.typeRef],
|
|
2197
|
-
coordinate
|
|
2149
|
+
domainEnumNames: input.defaultDomainEnumNames
|
|
2198
2150
|
});
|
|
2199
|
-
const columnType =
|
|
2200
|
-
kind: "namedType",
|
|
2201
|
-
typeName: column.typeRef
|
|
2202
|
-
} : field.type.kind === "valueObject" ? {
|
|
2151
|
+
const columnType = field.type.kind === "valueObject" ? {
|
|
2203
2152
|
kind: "valueObject",
|
|
2204
2153
|
typeName: field.type.name
|
|
2205
2154
|
} : buildColumnType({
|
|
@@ -2221,7 +2170,7 @@ function buildScalarFields(input) {
|
|
|
2221
2170
|
executionDefault: execution,
|
|
2222
2171
|
codecId: column.codecId,
|
|
2223
2172
|
list: !!field.many,
|
|
2224
|
-
typeParams:
|
|
2173
|
+
typeParams: nonEmptyTypeParams(column.typeParams),
|
|
2225
2174
|
coordinate,
|
|
2226
2175
|
context
|
|
2227
2176
|
});
|
|
@@ -2245,8 +2194,7 @@ function buildScalarFields(input) {
|
|
|
2245
2194
|
isEnum: column.codecId === PG_ENUM_CODEC_ID,
|
|
2246
2195
|
domainEnum: column.codecId === "pg/enum@1" || column.valueSet === void 0 ? void 0 : domainEnums[column.valueSet.entityName],
|
|
2247
2196
|
generatorAttributes,
|
|
2248
|
-
context
|
|
2249
|
-
namedTypes: input.namedTypes
|
|
2197
|
+
context
|
|
2250
2198
|
}),
|
|
2251
2199
|
span: SYNTHETIC_SPAN
|
|
2252
2200
|
});
|
|
@@ -2289,8 +2237,7 @@ function buildModel(all, entry, enums, rlsTables) {
|
|
|
2289
2237
|
inferredConstructors: all.inferredConstructors,
|
|
2290
2238
|
context: all.context,
|
|
2291
2239
|
executionDefaults: all.executionDefaults,
|
|
2292
|
-
defaultDomainEnumNames: new Set(Object.keys(all.defaultDomainEnums))
|
|
2293
|
-
namedTypes: all.contract.storage.types ?? {}
|
|
2240
|
+
defaultDomainEnumNames: new Set(Object.keys(all.defaultDomainEnums))
|
|
2294
2241
|
}), ...buildRelationFields({
|
|
2295
2242
|
entry,
|
|
2296
2243
|
variant,
|
|
@@ -2384,8 +2331,7 @@ function refuseUnwritableTableNames(contract) {
|
|
|
2384
2331
|
}
|
|
2385
2332
|
/**
|
|
2386
2333
|
* Builds the Prisma 8 PSL document a Postgres contract was, or would have been, authored as: every
|
|
2387
|
-
* model with its columns, keys, indexes and relations, every value object
|
|
2388
|
-
* every native enum, in the namespace block that carries it.
|
|
2334
|
+
* model with its columns, keys, indexes and relations, every value object and every native enum, in the namespace block that carries it.
|
|
2389
2335
|
*
|
|
2390
2336
|
* Read back by the PSL contract source with the same stack, the document yields the contract it was
|
|
2391
2337
|
* built from. Anything the language cannot carry is refused by name. `contract` must be one the
|
|
@@ -2440,11 +2386,11 @@ function buildPostgresPslContract(contract, context) {
|
|
|
2440
2386
|
});
|
|
2441
2387
|
refuseContractMeta(contract);
|
|
2442
2388
|
refuseUnderivedRoots(contract, models, all.variants);
|
|
2389
|
+
refuseRegisteredDatabaseTypes(contract);
|
|
2443
2390
|
return {
|
|
2444
2391
|
kind: "document",
|
|
2445
2392
|
sourceId: "<contract>",
|
|
2446
2393
|
namespaces,
|
|
2447
|
-
...ifDefined("types", buildTypesBlock(contract, all.inferredConstructors, context)),
|
|
2448
2394
|
span: SYNTHETIC_SPAN
|
|
2449
2395
|
};
|
|
2450
2396
|
}
|
|
@@ -2501,6 +2447,6 @@ function createPostgresTargetDescriptor() {
|
|
|
2501
2447
|
}
|
|
2502
2448
|
const postgresTargetDescriptor = createPostgresTargetDescriptor();
|
|
2503
2449
|
//#endregion
|
|
2504
|
-
export { decodePostgresListText, postgresTargetDescriptor as default, parsePostgresListText, postgresNativeAuthoringTypes, postgresNowGeneratorControlDescriptors,
|
|
2450
|
+
export { decodePostgresListText, postgresTargetDescriptor as default, parsePostgresListText, postgresNativeAuthoringTypes, postgresNowGeneratorControlDescriptors, postgresScalarAndNativeTypeConstructors, postgresScalarAuthoringTypes };
|
|
2505
2451
|
|
|
2506
2452
|
//# sourceMappingURL=target__control.mjs.map
|