@prisma/orm-family-sql 8.0.0-rc.18-dev.24 → 8.0.0-rc.18-dev.26
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/{attribute-specs-BaasqvID.d.mts → attribute-specs-D9QcPJpj.d.mts} +3 -3
- package/dist/{attribute-specs-BaasqvID.d.mts.map → attribute-specs-D9QcPJpj.d.mts.map} +1 -1
- package/dist/{authoring-entity-types-CZ-vdwYS-CLLXZPhj.d.mts → authoring-entity-types-CZ-vdwYS-CSU65LVs.d.mts} +2 -2
- package/dist/{authoring-entity-types-CZ-vdwYS-CLLXZPhj.d.mts.map → authoring-entity-types-CZ-vdwYS-CSU65LVs.d.mts.map} +1 -1
- package/dist/{authoring-type-constructors-0Iv2zdwS-CJbLWgCh.mjs → authoring-type-constructors-0Iv2zdwS-D4LlP1q2.mjs} +2 -2
- package/dist/{authoring-type-constructors-0Iv2zdwS-CJbLWgCh.mjs.map → authoring-type-constructors-0Iv2zdwS-D4LlP1q2.mjs.map} +1 -1
- package/dist/{config-types-BFS-ivzi.mjs → config-types-BJxHMPGt.mjs} +2 -2
- package/dist/{config-types-BFS-ivzi.mjs.map → config-types-BJxHMPGt.mjs.map} +1 -1
- package/dist/{contract-builder-CKO_xspE.mjs → contract-builder-CrWbrtE4.mjs} +3 -3
- package/dist/{contract-builder-CKO_xspE.mjs.map → contract-builder-CrWbrtE4.mjs.map} +1 -1
- package/dist/{contract-builder-DkaXfJoe.d.mts → contract-builder-D-RSOsnc.d.mts} +3 -10
- package/dist/contract-builder-D-RSOsnc.d.mts.map +1 -0
- package/dist/contract-prisma7__provider.mjs +6 -6
- package/dist/contract-psl.d.mts +1 -1
- package/dist/contract-psl.mjs +1 -1
- package/dist/contract-psl__attribute-specs.d.mts +1 -1
- package/dist/contract-psl__attribute-specs.mjs +1 -1
- package/dist/contract-psl__provider.mjs +2 -2
- package/dist/contract-psl__provider.mjs.map +1 -1
- package/dist/contract-ts.d.mts +1 -1
- package/dist/contract-ts.mjs +3 -3
- package/dist/contract-ts__config-types.mjs +1 -1
- package/dist/contract-ts__contract-builder.d.mts +1 -1
- package/dist/contract-ts__contract-builder.mjs +2 -2
- package/dist/contract.d.mts +3 -3
- package/dist/contract.mjs +5 -5
- package/dist/contract__data-type.d.mts +2 -2
- package/dist/contract__data-type.mjs +2 -2
- package/dist/contract__foreign-key-materialization.d.mts +1 -1
- package/dist/contract__foreign-key-materialization.mjs +2 -2
- package/dist/contract__validators.mjs +1 -1
- package/dist/{control-ZtRWQJi1.mjs → control-D7jPD-Tk.mjs} +27 -22
- package/dist/control-D7jPD-Tk.mjs.map +1 -0
- package/dist/{control-DpPGeOJY.d.mts → control-D9zFmpo0.d.mts} +18 -14
- package/dist/control-D9zFmpo0.d.mts.map +1 -0
- package/dist/{control-adapter-BCopdpsT-BpC5YbAf.d.mts → control-adapter-BCopdpsT-BPHa2Frw.d.mts} +3 -3
- package/dist/{control-adapter-BCopdpsT-BpC5YbAf.d.mts.map → control-adapter-BCopdpsT-BPHa2Frw.d.mts.map} +1 -1
- package/dist/control-adapter-ChJhp5vV.d.mts +13 -0
- package/dist/control-adapter-ChJhp5vV.d.mts.map +1 -0
- package/dist/control-adapter-DhX77V61.mjs +16 -0
- package/dist/control-adapter-DhX77V61.mjs.map +1 -0
- package/dist/{data-type-pNwyyJpr.d.mts → data-type-C84xngfv.d.mts} +22 -15
- package/dist/data-type-C84xngfv.d.mts.map +1 -0
- package/dist/data-type-DKk8Unnz.mjs.map +1 -1
- package/dist/{derived-checks-sRZp_gTF-Dvk3wkm9.mjs → derived-checks-sRZp_gTF-ermwhVGQ.mjs} +4 -4
- package/dist/{derived-checks-sRZp_gTF-Dvk3wkm9.mjs.map → derived-checks-sRZp_gTF-ermwhVGQ.mjs.map} +1 -1
- package/dist/{diff-BScSarWr.d.mts → diff-ClZvIVOl.d.mts} +5 -5
- package/dist/{diff-BScSarWr.d.mts.map → diff-ClZvIVOl.d.mts.map} +1 -1
- package/dist/{exports-DVsHk8HP-DrH_2a-H.mjs → exports-DVsHk8HP-M-qeQrkz.mjs} +2 -2
- package/dist/{exports-DVsHk8HP-DrH_2a-H.mjs.map → exports-DVsHk8HP-M-qeQrkz.mjs.map} +1 -1
- package/dist/family.d.mts +11 -11
- package/dist/family.mjs +8 -7
- package/dist/family__control-adapter.d.mts +3 -3
- package/dist/family__control-adapter.mjs +2 -1
- package/dist/family__control.d.mts +4 -4
- package/dist/family__control.mjs +3 -3
- package/dist/family__diff.d.mts +1 -1
- package/dist/family__diff.mjs +1 -1
- package/dist/family__ir.mjs +1 -1
- package/dist/family__migration.d.mts +1 -1
- package/dist/family__pack.d.mts +1 -1
- package/dist/family__pack.mjs +2 -2
- package/dist/family__psl-build.d.mts +1 -1
- package/dist/family__psl-build.mjs +1 -1
- package/dist/family__psl-infer.d.mts +1 -1
- package/dist/family__psl-infer.mjs +1 -1
- package/dist/{foreign-key-materialization-BiWTp2vi.d.mts → foreign-key-materialization-3vQnPT_D.d.mts} +3 -3
- package/dist/{foreign-key-materialization-BiWTp2vi.d.mts.map → foreign-key-materialization-3vQnPT_D.d.mts.map} +1 -1
- package/dist/{foreign-key-materialization-BIvQTfz8.mjs → foreign-key-materialization-C_FPLzj3.mjs} +2 -2
- package/dist/{foreign-key-materialization-BIvQTfz8.mjs.map → foreign-key-materialization-C_FPLzj3.mjs.map} +1 -1
- package/dist/{index-equivalence-DswCiq5l-Cp2V5nhL.mjs → index-equivalence-DswCiq5l-C6SAs-Yz.mjs} +2 -2
- package/dist/{index-equivalence-DswCiq5l-Cp2V5nhL.mjs.map → index-equivalence-DswCiq5l-C6SAs-Yz.mjs.map} +1 -1
- package/dist/{interpreter-B9wNACvu-Bk0vkYDs.mjs → interpreter-kQuqdyeP-B-rzJDWE.mjs} +5 -5
- package/dist/{interpreter-B9wNACvu-Bk0vkYDs.mjs.map → interpreter-kQuqdyeP-B-rzJDWE.mjs.map} +1 -1
- package/dist/{migration-lr0tqLnS.d.mts → migration-RrhpTP1o.d.mts} +2 -2
- package/dist/{migration-lr0tqLnS.d.mts.map → migration-RrhpTP1o.d.mts.map} +1 -1
- package/dist/orm-client.mjs +1 -1
- package/dist/{pack-mrYskO6T.d.mts → pack-DNdZwm5w.d.mts} +3 -3
- package/dist/{pack-mrYskO6T.d.mts.map → pack-DNdZwm5w.d.mts.map} +1 -1
- package/dist/{psl-build-DB-x01oH.mjs → psl-build-BT8Ue6gd.mjs} +4 -4
- package/dist/psl-build-BT8Ue6gd.mjs.map +1 -0
- package/dist/{psl-build-CTj6JAX3.d.mts → psl-build-DU55bjfu.d.mts} +4 -4
- package/dist/{psl-build-CTj6JAX3.d.mts.map → psl-build-DU55bjfu.d.mts.map} +1 -1
- package/dist/{psl-column-resolution-BCkhNzOK-DOvdhSCj.d.mts → psl-column-resolution-BCkhNzOK-DyfXnB-9.d.mts} +2 -2
- package/dist/{psl-column-resolution-BCkhNzOK-DOvdhSCj.d.mts.map → psl-column-resolution-BCkhNzOK-DyfXnB-9.d.mts.map} +1 -1
- package/dist/{psl-field-resolution-BOJPyV5I-CQ7I2lbC.mjs → psl-field-resolution-C1E-_fQq-VUYD8cnS.mjs} +18 -13
- package/dist/psl-field-resolution-C1E-_fQq-VUYD8cnS.mjs.map +1 -0
- package/dist/{psl-infer-CvUWefHM.mjs → psl-infer-Bz34csvN.mjs} +2 -2
- package/dist/{psl-infer-CvUWefHM.mjs.map → psl-infer-Bz34csvN.mjs.map} +1 -1
- package/dist/{psl-infer-1C9FqGO2.d.mts → psl-infer-I75woGr4.d.mts} +4 -4
- package/dist/{psl-infer-1C9FqGO2.d.mts.map → psl-infer-I75woGr4.d.mts.map} +1 -1
- package/dist/runtime.mjs +1 -1
- package/dist/{schema-differ-DmP74bB8-Dn53wZD1.d.mts → schema-differ-DmP74bB8-CIQ17HTk.d.mts} +3 -3
- package/dist/{schema-differ-DmP74bB8-Dn53wZD1.d.mts.map → schema-differ-DmP74bB8-CIQ17HTk.d.mts.map} +1 -1
- package/dist/schema-ir.d.mts +2 -2
- package/dist/schema-ir.mjs +2 -2
- package/dist/schema-ir__types.d.mts +3 -3
- package/dist/schema-ir__types.mjs +2 -2
- package/dist/{schema-verify-BwRdzbHb-CxnJN-Lm.mjs → schema-verify-BwRdzbHb-nDeE75xa.mjs} +2 -2
- package/dist/{schema-verify-BwRdzbHb-CxnJN-Lm.mjs.map → schema-verify-BwRdzbHb-nDeE75xa.mjs.map} +1 -1
- package/dist/{sql-contract-serializer-sMY3prTx-BDTNHOOy.mjs → sql-contract-serializer-sMY3prTx-BT6HdXAE.mjs} +2 -2
- package/dist/{sql-contract-serializer-sMY3prTx-BDTNHOOy.mjs.map → sql-contract-serializer-sMY3prTx-BT6HdXAE.mjs.map} +1 -1
- package/dist/{sql-data-type-DwLa_dK9-2eTvrYhA.mjs → sql-data-type-BSi0X331-OXbBFXDh.mjs} +40 -12
- package/dist/sql-data-type-BSi0X331-OXbBFXDh.mjs.map +1 -0
- package/dist/{types-Bqe0AXuw-xqQnkIj4.d.mts → types-B3AHHPDh-BHh-89fY.d.mts} +33 -48
- package/dist/types-B3AHHPDh-BHh-89fY.d.mts.map +1 -0
- package/dist/types-BGERR8XF.d.mts +1 -0
- package/dist/{types-DKU4GeqD-DUVn8zcv.d.mts → types-DKU4GeqD-CUClXCme.d.mts} +4 -4
- package/dist/{types-DKU4GeqD-DUVn8zcv.d.mts.map → types-DKU4GeqD-CUClXCme.d.mts.map} +1 -1
- package/dist/{types-CfPB-Kz_-ByWDfwMj.mjs → types-egs_vme1-DRhYFwIT.mjs} +50 -22
- package/dist/types-egs_vme1-DRhYFwIT.mjs.map +1 -0
- package/dist/{validators-Uim8vh59.mjs → validators-BCRydDG7.mjs} +6 -13
- package/dist/validators-BCRydDG7.mjs.map +1 -0
- package/package.json +18 -18
- package/dist/contract-builder-DkaXfJoe.d.mts.map +0 -1
- package/dist/control-DpPGeOJY.d.mts.map +0 -1
- package/dist/control-ZtRWQJi1.mjs.map +0 -1
- package/dist/control-adapter-DVjkUph8.d.mts +0 -1
- package/dist/data-type-pNwyyJpr.d.mts.map +0 -1
- package/dist/psl-build-DB-x01oH.mjs.map +0 -1
- package/dist/psl-field-resolution-BOJPyV5I-CQ7I2lbC.mjs.map +0 -1
- package/dist/sql-data-type-DwLa_dK9-2eTvrYhA.mjs.map +0 -1
- package/dist/types-Bqe0AXuw-xqQnkIj4.d.mts.map +0 -1
- package/dist/types-CTdsm45r.d.mts +0 -1
- package/dist/types-CfPB-Kz_-ByWDfwMj.mjs.map +0 -1
- package/dist/validators-Uim8vh59.mjs.map +0 -1
package/dist/family.d.mts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { n as resolveStorageTable, t as ResolvedStorageTable } from "./resolve-storage-table-8N2xelSh.mjs";
|
|
2
2
|
import { h as checkSqlDefaultText } from "./validators-CTZ-hU2l.mjs";
|
|
3
|
-
import { n as Lowerer, r as SqlControlAdapter, t as ExecuteRequestLowerer } from "./control-adapter-BCopdpsT-
|
|
4
|
-
import { A as StorageTypePlanResult, C as SqlPlanTargetDetails, D as SqlPlannerFailureResult, E as SqlPlannerConflictLocation, O as SqlPlannerResult, S as SqlMigrationRunnerSuccessValue, T as SqlPlannerConflictKind, _ as SqlMigrationRunnerErrorCode, a as FieldEventContext, b as SqlMigrationRunnerFailure, c as SqlControlExtensionDescriptor, d as SqlMigrationPlanOperation, f as SqlMigrationPlanOperationStep, g as SqlMigrationRunner, h as SqlMigrationPlannerPlanOptions, i as FieldEvent, k as SqlPlannerSuccessResult, l as SqlMigrationPlan, m as SqlMigrationPlanner, n as CodecControlHooks, o as ResolveIdentityValueInput, p as SqlMigrationPlanOperationTarget, r as CreateSqlMigrationPlanOptions, s as SqlControlAdapterDescriptor, u as SqlMigrationPlanContractInfo, v as SqlMigrationRunnerExecuteCallbacks, w as SqlPlannerConflict, x as SqlMigrationRunnerResult, y as SqlMigrationRunnerExecuteOptions } from "./types-DKU4GeqD-
|
|
5
|
-
import { n as SqlSchemaDiffInput, r as SqlSchemaDiffResult, t as SqlSchemaDiffFn } from "./schema-differ-DmP74bB8-
|
|
6
|
-
import { $ as
|
|
7
|
-
import "./control-adapter-
|
|
8
|
-
import { a as VerifySqlSchemaByDiffInput, c as classifySqlDiffIssue, d as verifySqlSchemaByDiff, i as StorageTypeVerdictInput, l as computeSqlDiffVerdict, n as SqlDiffVerdictInput, o as arraysEqual, r as StorageTypeVerdict, s as classifyDiffSubjectGranularity, t as SqlDiffVerdict, u as computeStorageTypeVerdict } from "./diff-
|
|
3
|
+
import { n as Lowerer, r as SqlControlAdapter, t as ExecuteRequestLowerer } from "./control-adapter-BCopdpsT-BPHa2Frw.mjs";
|
|
4
|
+
import { A as StorageTypePlanResult, C as SqlPlanTargetDetails, D as SqlPlannerFailureResult, E as SqlPlannerConflictLocation, O as SqlPlannerResult, S as SqlMigrationRunnerSuccessValue, T as SqlPlannerConflictKind, _ as SqlMigrationRunnerErrorCode, a as FieldEventContext, b as SqlMigrationRunnerFailure, c as SqlControlExtensionDescriptor, d as SqlMigrationPlanOperation, f as SqlMigrationPlanOperationStep, g as SqlMigrationRunner, h as SqlMigrationPlannerPlanOptions, i as FieldEvent, k as SqlPlannerSuccessResult, l as SqlMigrationPlan, m as SqlMigrationPlanner, n as CodecControlHooks, o as ResolveIdentityValueInput, p as SqlMigrationPlanOperationTarget, r as CreateSqlMigrationPlanOptions, s as SqlControlAdapterDescriptor, u as SqlMigrationPlanContractInfo, v as SqlMigrationRunnerExecuteCallbacks, w as SqlPlannerConflict, x as SqlMigrationRunnerResult, y as SqlMigrationRunnerExecuteOptions } from "./types-DKU4GeqD-CUClXCme.mjs";
|
|
5
|
+
import { n as SqlSchemaDiffInput, r as SqlSchemaDiffResult, t as SqlSchemaDiffFn } from "./schema-differ-DmP74bB8-CIQ17HTk.mjs";
|
|
6
|
+
import { $ as TableRenameByHand, $t as unmatchedTableRename, A as ReadColumnDefault, At as plannerFailure, B as SqlDescribedContractSpace, Bt as rowsWithoutValueSummary, C as MigrationPlannerConflict, Ct as isUnfilledSlot, D as NoTable, Dt as planFieldEventCalls, E as ModelTable, Et as partitionIssuesByControlPolicy, F as RequiredColumnMark, Ft as requiredColumnOf, G as SqlTextSources, Gt as sqlTypeLookupsOf, H as SqlQuote, Ht as runnerSuccess, I as SchemaTables, It as requiredColumnsOfMigration, J as SubjectStorage, Jt as temporalCodecPresetWithPrecision, K as StatementColumn, Kt as storageNameOfOperation, L as SingleOperationCall, Lt as resolveColumnRenameAgainst, M as ReportedBody, Mt as readColumnDefault, N as ReportedLiteralDefault, Nt as readReportedDefault, O as PlanFieldEventOperationsOptions, Ot as planFieldEventOperations, P as RequiredColumn, Pt as requiredColumnMeta, Q as TableRename, Qt as unmatchedColumnRename, R as SqlControlFamilyInstance, Rt as resolveTableRenameAgainst, S as MigrationPlanner, St as fieldStatementColumns, T as ModelStorageEffect, Tt as partitionCallsByControlPolicy, U as SqlQuotingRules, Ut as slotSource, V as SqlPslBuildContext, Vt as runnerFailure, W as SqlSlot, Wt as sqlOfSlot, X as TABLE_NAME_CASE_CHANGED_CODE, Xt as unconvertedFieldOf, Y as SuppressionRecord, Yt as temporalStringAuthoringPresets, Z as TableNameCaseGuardTable, Zt as unknownCallNames, _ as INIT_ADDITIVE_POLICY, _t as detectTableNameCaseChanges, a as ColumnRename, at as backfillOfDefaultedField, b as MigrationPlan, bt as fieldOfColumn, c as ContractColumns, ct as contractColumns, d as ConvertedColumn, dt as controlPolicyForCall, et as TableRenameRequest, f as DefaultResolver, ft as convertedColumnMeta, g as FieldStorageEffect, gt as detectDestructiveChanges, h as FieldStatementColumns, ht as createSqlTextSources, i as ColumnOnOneSide, it as assembleAuthoringContributions, j as ReadReportedDefault, jt as plannerSuccess, k as PlannedStatements, kt as planStatements, l as ContractToSchemaIROptions, lt as contractNamespaceToSchemaIR, m as FieldEventCall, mt as createMigrationPlan, n as CallSubjects, o as ColumnRenameRequest, ot as checkSqlExpressionText, p as DefaultResolverColumn, pt as convertedColumnOf, q as StatementPlanningTarget, qt as subjectsOfCalls, r as CallWithCompanions, rt as appliedStatementsInOrder, s as ContractColumn, st as columnTakesTemporaryValue, t as COLUMN_RENAME_UNMATCHED_CODE, tt as TargetMigrationsCapability, u as ControlPolicySubject, ut as contractToSchemaIR, v as MigrationOperationClass, vt as extractCodecControlHooks, w as MigrationPlannerResult, wt as modelRenameStorageEffect, x as MigrationPlanOperation, xt as fieldRenameStorageEffect, y as MigrationOperationPolicy, yt as fieldEventStorage, z as SqlControlTargetDescriptor, zt as rowsWithoutValueFailure } from "./control-D9zFmpo0.mjs";
|
|
7
|
+
import { t as resolveIntrospectedColumnType } from "./control-adapter-ChJhp5vV.mjs";
|
|
8
|
+
import { a as VerifySqlSchemaByDiffInput, c as classifySqlDiffIssue, d as verifySqlSchemaByDiff, i as StorageTypeVerdictInput, l as computeSqlDiffVerdict, n as SqlDiffVerdictInput, o as arraysEqual, r as StorageTypeVerdict, s as classifyDiffSubjectGranularity, t as SqlDiffVerdict, u as computeStorageTypeVerdict } from "./diff-ClZvIVOl.mjs";
|
|
9
9
|
import { i as SqlSchemaVerifierBase, n as SqlContractSerializerBase, r as SqlEntityHydrationFactory, t as SqlContractSerializer } from "./ir-qK4wX3D3.mjs";
|
|
10
|
-
import { t as SqlMigration } from "./migration-
|
|
11
|
-
import "./pack-
|
|
10
|
+
import { t as SqlMigration } from "./migration-RrhpTP1o.mjs";
|
|
11
|
+
import "./pack-DNdZwm5w.mjs";
|
|
12
12
|
import { n as DefaultMappingResult, r as mapDefault, t as DefaultMappingOptions } from "./default-mapping-CEISdj2g-DF1LzGBR.mjs";
|
|
13
|
-
import { _ as pslTypeArgumentText, a as FieldPresetUnwritableReason, c as IntrospectedTable, d as PslTypeCall, f as defaultFunctionCallFor, g as inferredTypeConstructors, h as inferColumnTypes, i as FieldPresetReadBackDifference, l as PslColumnTypeKind, m as fieldPresetCallFor, n as FieldPresetArgument, o as InferredTypeConstructor, p as fewestArgumentsCall, r as FieldPresetCallChoice, s as InferredTypeConstructors, t as ColumnTypeOf, u as PslColumnTypeRef, v as toEnumMemberName } from "./psl-build-
|
|
14
|
-
import { a as buildChildRelationField, c as inferRelations, d as toFieldName, f as toModelName, i as RelationField, l as pluralize, n as InferredRelations, o as deriveBackRelationFieldName, r as PslPrinterOptions, s as deriveRelationFieldName, t as EnumInfo, u as toEnumName } from "./psl-infer-
|
|
13
|
+
import { _ as pslTypeArgumentText, a as FieldPresetUnwritableReason, c as IntrospectedTable, d as PslTypeCall, f as defaultFunctionCallFor, g as inferredTypeConstructors, h as inferColumnTypes, i as FieldPresetReadBackDifference, l as PslColumnTypeKind, m as fieldPresetCallFor, n as FieldPresetArgument, o as InferredTypeConstructor, p as fewestArgumentsCall, r as FieldPresetCallChoice, s as InferredTypeConstructors, t as ColumnTypeOf, u as PslColumnTypeRef, v as toEnumMemberName } from "./psl-build-DU55bjfu.mjs";
|
|
14
|
+
import { a as buildChildRelationField, c as inferRelations, d as toFieldName, f as toModelName, i as RelationField, l as pluralize, n as InferredRelations, o as deriveBackRelationFieldName, r as PslPrinterOptions, s as deriveRelationFieldName, t as EnumInfo, u as toEnumName } from "./psl-infer-I75woGr4.mjs";
|
|
15
15
|
import { a as timestampNowRuntimeGenerator, n as UNBOUND_DOMAIN_NAMESPACE_ID, r as resolveDomainModel, t as ResolvedDomainModel } from "./runtime-BlUQqGCH.mjs";
|
|
16
16
|
import { n as parseContractMarkerRow, t as ContractMarkerRow } from "./verify-zDRnw0Rn.mjs";
|
|
17
|
-
export { COLUMN_RENAME_UNMATCHED_CODE, type CallSubjects, type CallWithCompanions, type CodecControlHooks, type ColumnOnOneSide, type ColumnRename, type ColumnRenameRequest, type ColumnTypeOf, type ContractColumn, type ContractColumns, type ContractMarkerRow, type ContractToSchemaIROptions, type ControlPolicySubject, type ConvertedColumn, type CreateSqlMigrationPlanOptions, type DefaultMappingOptions, type DefaultMappingResult, type DefaultResolver, type EnumInfo, type ExecuteRequestLowerer, type FieldEvent, type FieldEventCall, type FieldEventContext, type FieldPresetArgument, type FieldPresetCallChoice, type FieldPresetReadBackDifference, type FieldPresetUnwritableReason, type FieldStatementColumns, type FieldStorageEffect, INIT_ADDITIVE_POLICY, type InferredRelations, type InferredTypeConstructor, type InferredTypeConstructors, type IntrospectedTable, type Lowerer, SqlMigration as Migration, type MigrationOperationClass, type MigrationOperationPolicy, type MigrationPlan, type MigrationPlanOperation, type MigrationPlanner, type MigrationPlannerConflict, type MigrationPlannerResult, type ModelStorageEffect, type ModelTable, type NoTable, type PlanFieldEventOperationsOptions, type PlannedStatements, type PslColumnTypeKind, type PslColumnTypeRef, type PslPrinterOptions, type PslTypeCall, type ReadColumnDefault, type ReadReportedDefault, type RelationField, type ReportedBody, type ReportedLiteralDefault, type RequiredColumn, type RequiredColumnMark, type ResolveIdentityValueInput, type ResolvedDomainModel, type ResolvedStorageTable, type SchemaTables, type SingleOperationCall, SqlContractSerializer, SqlContractSerializerBase, type SqlControlAdapter, type SqlControlExtensionDescriptor, type SqlControlFamilyInstance, type SqlControlTargetDescriptor, type SqlDescribedContractSpace, type SqlDiffVerdict, type SqlDiffVerdictInput, type SqlEntityHydrationFactory, type SqlMigrationPlan, type SqlMigrationPlanContractInfo, type SqlMigrationPlanOperation, type SqlMigrationPlanOperationStep, type SqlMigrationPlanOperationTarget, type SqlMigrationPlanner, type SqlMigrationPlannerPlanOptions, type SqlMigrationRunner, type SqlMigrationRunnerErrorCode, type SqlMigrationRunnerExecuteCallbacks, type SqlMigrationRunnerExecuteOptions, type SqlMigrationRunnerFailure, type SqlMigrationRunnerResult, type SqlMigrationRunnerSuccessValue, type SqlPlanTargetDetails, type SqlPlannerConflict, type SqlPlannerConflictKind, type SqlPlannerConflictLocation, type SqlPlannerFailureResult, type SqlPlannerResult, type SqlPlannerSuccessResult, type SqlPslBuildContext, type SqlQuote, type SqlQuotingRules, type SqlSchemaDiffFn, type SqlSchemaDiffInput, type SqlSchemaDiffResult, SqlSchemaVerifierBase, type SqlSlot, type SqlTextSources, type StatementColumn, type StatementPlanningTarget, type StorageTypePlanResult, type StorageTypeVerdict, type StorageTypeVerdictInput, type SubjectStorage, type SuppressionRecord, TABLE_NAME_CASE_CHANGED_CODE, type TableNameCaseGuardTable, type TableRename, type TableRenameByHand, type TableRenameRequest, type TargetMigrationsCapability, UNBOUND_DOMAIN_NAMESPACE_ID, type VerifySqlSchemaByDiffInput, appliedStatementsInOrder, arraysEqual, assembleAuthoringContributions, backfillOfDefaultedField, buildChildRelationField, checkSqlDefaultText, checkSqlExpressionText, classifyDiffSubjectGranularity, classifySqlDiffIssue, columnTakesTemporaryValue, computeSqlDiffVerdict, computeStorageTypeVerdict, contractColumns, contractNamespaceToSchemaIR, contractToSchemaIR, controlPolicyForCall, convertedColumnMeta, convertedColumnOf, createMigrationPlan, createSqlTextSources, defaultFunctionCallFor, deriveBackRelationFieldName, deriveRelationFieldName, detectDestructiveChanges, detectTableNameCaseChanges, extractCodecControlHooks, fewestArgumentsCall, fieldEventStorage, fieldOfColumn, fieldPresetCallFor, fieldRenameStorageEffect, fieldStatementColumns, inferColumnTypes, inferRelations, inferredTypeConstructors, isUnfilledSlot, mapDefault, modelRenameStorageEffect, parseContractMarkerRow, partitionCallsByControlPolicy, partitionIssuesByControlPolicy, planFieldEventCalls, planFieldEventOperations, planStatements, plannerFailure, plannerSuccess, pluralize, pslTypeArgumentText, readColumnDefault, readReportedDefault, requiredColumnMeta, requiredColumnOf, requiredColumnsOfMigration, resolveColumnRenameAgainst, resolveDomainModel, resolveStorageTable, resolveTableRenameAgainst, rowsWithoutValueFailure, rowsWithoutValueSummary, runnerFailure, runnerSuccess, slotSource, sqlOfSlot, sqlTypeLookupsOf, storageNameOfOperation, subjectsOfCalls, temporalCodecPresetWithPrecision, temporalStringAuthoringPresets, timestampNowRuntimeGenerator, toEnumMemberName, toEnumName, toFieldName, toModelName, unconvertedFieldOf, unknownCallNames, unmatchedColumnRename, unmatchedTableRename, verifySqlSchemaByDiff };
|
|
17
|
+
export { COLUMN_RENAME_UNMATCHED_CODE, type CallSubjects, type CallWithCompanions, type CodecControlHooks, type ColumnOnOneSide, type ColumnRename, type ColumnRenameRequest, type ColumnTypeOf, type ContractColumn, type ContractColumns, type ContractMarkerRow, type ContractToSchemaIROptions, type ControlPolicySubject, type ConvertedColumn, type CreateSqlMigrationPlanOptions, type DefaultMappingOptions, type DefaultMappingResult, type DefaultResolver, type DefaultResolverColumn, type EnumInfo, type ExecuteRequestLowerer, type FieldEvent, type FieldEventCall, type FieldEventContext, type FieldPresetArgument, type FieldPresetCallChoice, type FieldPresetReadBackDifference, type FieldPresetUnwritableReason, type FieldStatementColumns, type FieldStorageEffect, INIT_ADDITIVE_POLICY, type InferredRelations, type InferredTypeConstructor, type InferredTypeConstructors, type IntrospectedTable, type Lowerer, SqlMigration as Migration, type MigrationOperationClass, type MigrationOperationPolicy, type MigrationPlan, type MigrationPlanOperation, type MigrationPlanner, type MigrationPlannerConflict, type MigrationPlannerResult, type ModelStorageEffect, type ModelTable, type NoTable, type PlanFieldEventOperationsOptions, type PlannedStatements, type PslColumnTypeKind, type PslColumnTypeRef, type PslPrinterOptions, type PslTypeCall, type ReadColumnDefault, type ReadReportedDefault, type RelationField, type ReportedBody, type ReportedLiteralDefault, type RequiredColumn, type RequiredColumnMark, type ResolveIdentityValueInput, type ResolvedDomainModel, type ResolvedStorageTable, type SchemaTables, type SingleOperationCall, SqlContractSerializer, SqlContractSerializerBase, type SqlControlAdapter, type SqlControlExtensionDescriptor, type SqlControlFamilyInstance, type SqlControlTargetDescriptor, type SqlDescribedContractSpace, type SqlDiffVerdict, type SqlDiffVerdictInput, type SqlEntityHydrationFactory, type SqlMigrationPlan, type SqlMigrationPlanContractInfo, type SqlMigrationPlanOperation, type SqlMigrationPlanOperationStep, type SqlMigrationPlanOperationTarget, type SqlMigrationPlanner, type SqlMigrationPlannerPlanOptions, type SqlMigrationRunner, type SqlMigrationRunnerErrorCode, type SqlMigrationRunnerExecuteCallbacks, type SqlMigrationRunnerExecuteOptions, type SqlMigrationRunnerFailure, type SqlMigrationRunnerResult, type SqlMigrationRunnerSuccessValue, type SqlPlanTargetDetails, type SqlPlannerConflict, type SqlPlannerConflictKind, type SqlPlannerConflictLocation, type SqlPlannerFailureResult, type SqlPlannerResult, type SqlPlannerSuccessResult, type SqlPslBuildContext, type SqlQuote, type SqlQuotingRules, type SqlSchemaDiffFn, type SqlSchemaDiffInput, type SqlSchemaDiffResult, SqlSchemaVerifierBase, type SqlSlot, type SqlTextSources, type StatementColumn, type StatementPlanningTarget, type StorageTypePlanResult, type StorageTypeVerdict, type StorageTypeVerdictInput, type SubjectStorage, type SuppressionRecord, TABLE_NAME_CASE_CHANGED_CODE, type TableNameCaseGuardTable, type TableRename, type TableRenameByHand, type TableRenameRequest, type TargetMigrationsCapability, UNBOUND_DOMAIN_NAMESPACE_ID, type VerifySqlSchemaByDiffInput, appliedStatementsInOrder, arraysEqual, assembleAuthoringContributions, backfillOfDefaultedField, buildChildRelationField, checkSqlDefaultText, checkSqlExpressionText, classifyDiffSubjectGranularity, classifySqlDiffIssue, columnTakesTemporaryValue, computeSqlDiffVerdict, computeStorageTypeVerdict, contractColumns, contractNamespaceToSchemaIR, contractToSchemaIR, controlPolicyForCall, convertedColumnMeta, convertedColumnOf, createMigrationPlan, createSqlTextSources, defaultFunctionCallFor, deriveBackRelationFieldName, deriveRelationFieldName, detectDestructiveChanges, detectTableNameCaseChanges, extractCodecControlHooks, fewestArgumentsCall, fieldEventStorage, fieldOfColumn, fieldPresetCallFor, fieldRenameStorageEffect, fieldStatementColumns, inferColumnTypes, inferRelations, inferredTypeConstructors, isUnfilledSlot, mapDefault, modelRenameStorageEffect, parseContractMarkerRow, partitionCallsByControlPolicy, partitionIssuesByControlPolicy, planFieldEventCalls, planFieldEventOperations, planStatements, plannerFailure, plannerSuccess, pluralize, pslTypeArgumentText, readColumnDefault, readReportedDefault, requiredColumnMeta, requiredColumnOf, requiredColumnsOfMigration, resolveColumnRenameAgainst, resolveDomainModel, resolveIntrospectedColumnType, resolveStorageTable, resolveTableRenameAgainst, rowsWithoutValueFailure, rowsWithoutValueSummary, runnerFailure, runnerSuccess, slotSource, sqlOfSlot, sqlTypeLookupsOf, storageNameOfOperation, subjectsOfCalls, temporalCodecPresetWithPrecision, temporalStringAuthoringPresets, timestampNowRuntimeGenerator, toEnumMemberName, toEnumName, toFieldName, toModelName, unconvertedFieldOf, unknownCallNames, unmatchedColumnRename, unmatchedTableRename, verifySqlSchemaByDiff };
|
package/dist/family.mjs
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { t as resolveStorageTable } from "./resolve-storage-table-DZsfnzeW.mjs";
|
|
2
|
-
import { n as checkSqlDefaultText } from "./validators-
|
|
3
|
-
import { a as computeStorageTypeVerdict, c as verifySqlSchemaByDiff, i as computeSqlDiffVerdict, n as classifyDiffSubjectGranularity, r as classifySqlDiffIssue, s as extractCodecControlHooks } from "./schema-verify-BwRdzbHb-
|
|
4
|
-
import { n as SqlContractSerializerBase, t as SqlContractSerializer } from "./sql-contract-serializer-sMY3prTx-
|
|
2
|
+
import { n as checkSqlDefaultText } from "./validators-BCRydDG7.mjs";
|
|
3
|
+
import { a as computeStorageTypeVerdict, c as verifySqlSchemaByDiff, i as computeSqlDiffVerdict, n as classifyDiffSubjectGranularity, r as classifySqlDiffIssue, s as extractCodecControlHooks } from "./schema-verify-BwRdzbHb-nDeE75xa.mjs";
|
|
4
|
+
import { n as SqlContractSerializerBase, t as SqlContractSerializer } from "./sql-contract-serializer-sMY3prTx-BT6HdXAE.mjs";
|
|
5
5
|
import { n as parseContractMarkerRow } from "./verify-BVk5bjdH-dq5M4iIh.mjs";
|
|
6
|
-
import { $ as unmatchedColumnRename, A as planStatements, B as rowsWithoutValueFailure, C as fieldStatementColumns, D as partitionIssuesByControlPolicy, E as partitionCallsByControlPolicy, F as requiredColumnMeta, G as sqlOfSlot, H as runnerFailure, I as requiredColumnOf, J as subjectsOfCalls, K as sqlTypeLookupsOf, L as requiredColumnsOfMigration, M as plannerSuccess, N as readColumnDefault, O as planFieldEventCalls, P as readReportedDefault, Q as unknownCallNames, R as resolveColumnRenameAgainst, S as fieldRenameStorageEffect, T as modelRenameStorageEffect, U as runnerSuccess, V as rowsWithoutValueSummary, W as slotSource, X as temporalStringAuthoringPresets, Y as temporalCodecPresetWithPrecision, Z as unconvertedFieldOf, _ as createSqlTextSources, a as assembleAuthoringContributions, b as fieldEventStorage, c as columnTakesTemporaryValue, d as contractToSchemaIR, et as unmatchedTableRename, f as controlPolicyForCall, g as createMigrationPlan, h as convertedColumnOf, i as appliedStatementsInOrder, j as plannerFailure, k as planFieldEventOperations, l as contractColumns, m as convertedColumnMeta, n as INIT_ADDITIVE_POLICY, o as backfillOfDefaultedField, q as storageNameOfOperation, r as TABLE_NAME_CASE_CHANGED_CODE, s as checkSqlExpressionText, t as COLUMN_RENAME_UNMATCHED_CODE, u as contractNamespaceToSchemaIR, v as detectDestructiveChanges, w as isUnfilledSlot, x as fieldOfColumn, y as detectTableNameCaseChanges, z as resolveTableRenameAgainst } from "./control-
|
|
6
|
+
import { $ as unmatchedColumnRename, A as planStatements, B as rowsWithoutValueFailure, C as fieldStatementColumns, D as partitionIssuesByControlPolicy, E as partitionCallsByControlPolicy, F as requiredColumnMeta, G as sqlOfSlot, H as runnerFailure, I as requiredColumnOf, J as subjectsOfCalls, K as sqlTypeLookupsOf, L as requiredColumnsOfMigration, M as plannerSuccess, N as readColumnDefault, O as planFieldEventCalls, P as readReportedDefault, Q as unknownCallNames, R as resolveColumnRenameAgainst, S as fieldRenameStorageEffect, T as modelRenameStorageEffect, U as runnerSuccess, V as rowsWithoutValueSummary, W as slotSource, X as temporalStringAuthoringPresets, Y as temporalCodecPresetWithPrecision, Z as unconvertedFieldOf, _ as createSqlTextSources, a as assembleAuthoringContributions, b as fieldEventStorage, c as columnTakesTemporaryValue, d as contractToSchemaIR, et as unmatchedTableRename, f as controlPolicyForCall, g as createMigrationPlan, h as convertedColumnOf, i as appliedStatementsInOrder, j as plannerFailure, k as planFieldEventOperations, l as contractColumns, m as convertedColumnMeta, n as INIT_ADDITIVE_POLICY, o as backfillOfDefaultedField, q as storageNameOfOperation, r as TABLE_NAME_CASE_CHANGED_CODE, s as checkSqlExpressionText, t as COLUMN_RENAME_UNMATCHED_CODE, u as contractNamespaceToSchemaIR, v as detectDestructiveChanges, w as isUnfilledSlot, x as fieldOfColumn, y as detectTableNameCaseChanges, z as resolveTableRenameAgainst } from "./control-D7jPD-Tk.mjs";
|
|
7
|
+
import { t as resolveIntrospectedColumnType } from "./control-adapter-DhX77V61.mjs";
|
|
7
8
|
import { t as arraysEqual } from "./diff-DZ82XaGR.mjs";
|
|
8
9
|
import { t as SqlSchemaVerifierBase } from "./ir-I-xciGUH.mjs";
|
|
9
10
|
import { t as SqlMigration } from "./migration-Dy_4Wmiy.mjs";
|
|
10
11
|
import { s as toEnumMemberName } from "./psl-names-C3cwe0rg-CsuHOV7E.mjs";
|
|
11
|
-
import { a as inferredTypeConstructors, i as inferColumnTypes, n as fewestArgumentsCall, o as mapDefault, r as fieldPresetCallFor, s as pslTypeArgumentText, t as defaultFunctionCallFor } from "./psl-build-
|
|
12
|
-
import { a as pluralize, c as toModelName, i as inferRelations, n as deriveBackRelationFieldName, o as toEnumName, r as deriveRelationFieldName, s as toFieldName, t as buildChildRelationField } from "./psl-infer-
|
|
12
|
+
import { a as inferredTypeConstructors, i as inferColumnTypes, n as fewestArgumentsCall, o as mapDefault, r as fieldPresetCallFor, s as pslTypeArgumentText, t as defaultFunctionCallFor } from "./psl-build-BT8Ue6gd.mjs";
|
|
13
|
+
import { a as pluralize, c as toModelName, i as inferRelations, n as deriveBackRelationFieldName, o as toEnumName, r as deriveRelationFieldName, s as toFieldName, t as buildChildRelationField } from "./psl-infer-Bz34csvN.mjs";
|
|
13
14
|
import { i as timestampNowRuntimeGenerator, n as resolveDomainModel, t as UNBOUND_DOMAIN_NAMESPACE_ID } from "./runtime-Z3nD7ix1.mjs";
|
|
14
|
-
export { COLUMN_RENAME_UNMATCHED_CODE, INIT_ADDITIVE_POLICY, SqlMigration as Migration, SqlContractSerializer, SqlContractSerializerBase, SqlSchemaVerifierBase, TABLE_NAME_CASE_CHANGED_CODE, UNBOUND_DOMAIN_NAMESPACE_ID, appliedStatementsInOrder, arraysEqual, assembleAuthoringContributions, backfillOfDefaultedField, buildChildRelationField, checkSqlDefaultText, checkSqlExpressionText, classifyDiffSubjectGranularity, classifySqlDiffIssue, columnTakesTemporaryValue, computeSqlDiffVerdict, computeStorageTypeVerdict, contractColumns, contractNamespaceToSchemaIR, contractToSchemaIR, controlPolicyForCall, convertedColumnMeta, convertedColumnOf, createMigrationPlan, createSqlTextSources, defaultFunctionCallFor, deriveBackRelationFieldName, deriveRelationFieldName, detectDestructiveChanges, detectTableNameCaseChanges, extractCodecControlHooks, fewestArgumentsCall, fieldEventStorage, fieldOfColumn, fieldPresetCallFor, fieldRenameStorageEffect, fieldStatementColumns, inferColumnTypes, inferRelations, inferredTypeConstructors, isUnfilledSlot, mapDefault, modelRenameStorageEffect, parseContractMarkerRow, partitionCallsByControlPolicy, partitionIssuesByControlPolicy, planFieldEventCalls, planFieldEventOperations, planStatements, plannerFailure, plannerSuccess, pluralize, pslTypeArgumentText, readColumnDefault, readReportedDefault, requiredColumnMeta, requiredColumnOf, requiredColumnsOfMigration, resolveColumnRenameAgainst, resolveDomainModel, resolveStorageTable, resolveTableRenameAgainst, rowsWithoutValueFailure, rowsWithoutValueSummary, runnerFailure, runnerSuccess, slotSource, sqlOfSlot, sqlTypeLookupsOf, storageNameOfOperation, subjectsOfCalls, temporalCodecPresetWithPrecision, temporalStringAuthoringPresets, timestampNowRuntimeGenerator, toEnumMemberName, toEnumName, toFieldName, toModelName, unconvertedFieldOf, unknownCallNames, unmatchedColumnRename, unmatchedTableRename, verifySqlSchemaByDiff };
|
|
15
|
+
export { COLUMN_RENAME_UNMATCHED_CODE, INIT_ADDITIVE_POLICY, SqlMigration as Migration, SqlContractSerializer, SqlContractSerializerBase, SqlSchemaVerifierBase, TABLE_NAME_CASE_CHANGED_CODE, UNBOUND_DOMAIN_NAMESPACE_ID, appliedStatementsInOrder, arraysEqual, assembleAuthoringContributions, backfillOfDefaultedField, buildChildRelationField, checkSqlDefaultText, checkSqlExpressionText, classifyDiffSubjectGranularity, classifySqlDiffIssue, columnTakesTemporaryValue, computeSqlDiffVerdict, computeStorageTypeVerdict, contractColumns, contractNamespaceToSchemaIR, contractToSchemaIR, controlPolicyForCall, convertedColumnMeta, convertedColumnOf, createMigrationPlan, createSqlTextSources, defaultFunctionCallFor, deriveBackRelationFieldName, deriveRelationFieldName, detectDestructiveChanges, detectTableNameCaseChanges, extractCodecControlHooks, fewestArgumentsCall, fieldEventStorage, fieldOfColumn, fieldPresetCallFor, fieldRenameStorageEffect, fieldStatementColumns, inferColumnTypes, inferRelations, inferredTypeConstructors, isUnfilledSlot, mapDefault, modelRenameStorageEffect, parseContractMarkerRow, partitionCallsByControlPolicy, partitionIssuesByControlPolicy, planFieldEventCalls, planFieldEventOperations, planStatements, plannerFailure, plannerSuccess, pluralize, pslTypeArgumentText, readColumnDefault, readReportedDefault, requiredColumnMeta, requiredColumnOf, requiredColumnsOfMigration, resolveColumnRenameAgainst, resolveDomainModel, resolveIntrospectedColumnType, resolveStorageTable, resolveTableRenameAgainst, rowsWithoutValueFailure, rowsWithoutValueSummary, runnerFailure, runnerSuccess, slotSource, sqlOfSlot, sqlTypeLookupsOf, storageNameOfOperation, subjectsOfCalls, temporalCodecPresetWithPrecision, temporalStringAuthoringPresets, timestampNowRuntimeGenerator, toEnumMemberName, toEnumName, toFieldName, toModelName, unconvertedFieldOf, unknownCallNames, unmatchedColumnRename, unmatchedTableRename, verifySqlSchemaByDiff };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { i as SqlControlAdapterDescriptor, n as Lowerer, r as SqlControlAdapter, t as ExecuteRequestLowerer } from "./control-adapter-BCopdpsT-
|
|
2
|
-
import "./control-adapter-
|
|
3
|
-
export type
|
|
1
|
+
import { i as SqlControlAdapterDescriptor, n as Lowerer, r as SqlControlAdapter, t as ExecuteRequestLowerer } from "./control-adapter-BCopdpsT-BPHa2Frw.mjs";
|
|
2
|
+
import { t as resolveIntrospectedColumnType } from "./control-adapter-ChJhp5vV.mjs";
|
|
3
|
+
export { type ExecuteRequestLowerer, type Lowerer, type SqlControlAdapter, type SqlControlAdapterDescriptor, resolveIntrospectedColumnType };
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { t as resolveIntrospectedColumnType } from "./control-adapter-DhX77V61.mjs";
|
|
2
|
+
export { resolveIntrospectedColumnType };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h as checkSqlDefaultText } from "./validators-CTZ-hU2l.mjs";
|
|
2
|
-
import { A as StorageTypePlanResult, C as SqlPlanTargetDetails, D as SqlPlannerFailureResult, E as SqlPlannerConflictLocation, O as SqlPlannerResult, S as SqlMigrationRunnerSuccessValue, T as SqlPlannerConflictKind, _ as SqlMigrationRunnerErrorCode, a as FieldEventContext, b as SqlMigrationRunnerFailure, c as SqlControlExtensionDescriptor, d as SqlMigrationPlanOperation, f as SqlMigrationPlanOperationStep, g as SqlMigrationRunner, h as SqlMigrationPlannerPlanOptions, i as FieldEvent, k as SqlPlannerSuccessResult, l as SqlMigrationPlan, m as SqlMigrationPlanner, n as CodecControlHooks, o as ResolveIdentityValueInput, p as SqlMigrationPlanOperationTarget, r as CreateSqlMigrationPlanOptions, s as SqlControlAdapterDescriptor, u as SqlMigrationPlanContractInfo, v as SqlMigrationRunnerExecuteCallbacks, w as SqlPlannerConflict, x as SqlMigrationRunnerResult, y as SqlMigrationRunnerExecuteOptions } from "./types-DKU4GeqD-
|
|
3
|
-
import { n as SqlSchemaDiffInput, r as SqlSchemaDiffResult, t as SqlSchemaDiffFn } from "./schema-differ-DmP74bB8-
|
|
4
|
-
import { $ as
|
|
5
|
-
export { COLUMN_RENAME_UNMATCHED_CODE, type CallSubjects, type CallWithCompanions, type CodecControlHooks, type ColumnOnOneSide, type ColumnRename, type ColumnRenameRequest, type ContractColumn, type ContractColumns, type ContractToSchemaIROptions, type ControlPolicySubject, type ConvertedColumn, type CreateSqlMigrationPlanOptions, type DefaultResolver, type FieldEvent, type FieldEventCall, type FieldEventContext, type FieldStatementColumns, type FieldStorageEffect, INIT_ADDITIVE_POLICY, type MigrationOperationClass, type MigrationOperationPolicy, type MigrationPlan, type MigrationPlanOperation, type MigrationPlanner, type MigrationPlannerConflict, type MigrationPlannerResult, type ModelStorageEffect, type ModelTable, type NoTable, type PlanFieldEventOperationsOptions, type PlannedStatements, type ReadColumnDefault, type ReadReportedDefault, type ReportedBody, type ReportedLiteralDefault, type RequiredColumn, type RequiredColumnMark, type ResolveIdentityValueInput, type SchemaTables, type SingleOperationCall, type SqlControlAdapterDescriptor, type SqlControlExtensionDescriptor, type SqlControlFamilyInstance, type SqlControlTargetDescriptor, type SqlDescribedContractSpace, type SqlMigrationPlan, type SqlMigrationPlanContractInfo, type SqlMigrationPlanOperation, type SqlMigrationPlanOperationStep, type SqlMigrationPlanOperationTarget, type SqlMigrationPlanner, type SqlMigrationPlannerPlanOptions, type SqlMigrationRunner, type SqlMigrationRunnerErrorCode, type SqlMigrationRunnerExecuteCallbacks, type SqlMigrationRunnerExecuteOptions, type SqlMigrationRunnerFailure, type SqlMigrationRunnerResult, type SqlMigrationRunnerSuccessValue, type SqlPlanTargetDetails, type SqlPlannerConflict, type SqlPlannerConflictKind, type SqlPlannerConflictLocation, type SqlPlannerFailureResult, type SqlPlannerResult, type SqlPlannerSuccessResult, type SqlPslBuildContext, type SqlQuote, type SqlQuotingRules, type SqlSchemaDiffFn, type SqlSchemaDiffInput, type SqlSchemaDiffResult, type SqlSlot, type SqlTextSources, type StatementColumn, type StatementPlanningTarget, type StorageTypePlanResult, type SubjectStorage, type SuppressionRecord, TABLE_NAME_CASE_CHANGED_CODE, type TableNameCaseGuardTable, type TableRename, type TableRenameByHand, type TableRenameRequest, type TargetMigrationsCapability, appliedStatementsInOrder, assembleAuthoringContributions, backfillOfDefaultedField, checkSqlDefaultText, checkSqlExpressionText, columnTakesTemporaryValue, contractColumns, contractNamespaceToSchemaIR, contractToSchemaIR, controlPolicyForCall, convertedColumnMeta, convertedColumnOf, createMigrationPlan, createSqlTextSources, _default as default, detectDestructiveChanges, detectTableNameCaseChanges, extractCodecControlHooks, fieldEventStorage, fieldOfColumn, fieldRenameStorageEffect, fieldStatementColumns, isUnfilledSlot, modelRenameStorageEffect, partitionCallsByControlPolicy, partitionIssuesByControlPolicy, planFieldEventCalls, planFieldEventOperations, planStatements, plannerFailure, plannerSuccess, readColumnDefault, readReportedDefault, requiredColumnMeta, requiredColumnOf, requiredColumnsOfMigration, resolveColumnRenameAgainst, resolveTableRenameAgainst, rowsWithoutValueFailure, rowsWithoutValueSummary, runnerFailure, runnerSuccess, slotSource, sqlOfSlot, sqlTypeLookupsOf, storageNameOfOperation, subjectsOfCalls, temporalCodecPresetWithPrecision, temporalStringAuthoringPresets, unconvertedFieldOf, unknownCallNames, unmatchedColumnRename, unmatchedTableRename };
|
|
2
|
+
import { A as StorageTypePlanResult, C as SqlPlanTargetDetails, D as SqlPlannerFailureResult, E as SqlPlannerConflictLocation, O as SqlPlannerResult, S as SqlMigrationRunnerSuccessValue, T as SqlPlannerConflictKind, _ as SqlMigrationRunnerErrorCode, a as FieldEventContext, b as SqlMigrationRunnerFailure, c as SqlControlExtensionDescriptor, d as SqlMigrationPlanOperation, f as SqlMigrationPlanOperationStep, g as SqlMigrationRunner, h as SqlMigrationPlannerPlanOptions, i as FieldEvent, k as SqlPlannerSuccessResult, l as SqlMigrationPlan, m as SqlMigrationPlanner, n as CodecControlHooks, o as ResolveIdentityValueInput, p as SqlMigrationPlanOperationTarget, r as CreateSqlMigrationPlanOptions, s as SqlControlAdapterDescriptor, u as SqlMigrationPlanContractInfo, v as SqlMigrationRunnerExecuteCallbacks, w as SqlPlannerConflict, x as SqlMigrationRunnerResult, y as SqlMigrationRunnerExecuteOptions } from "./types-DKU4GeqD-CUClXCme.mjs";
|
|
3
|
+
import { n as SqlSchemaDiffInput, r as SqlSchemaDiffResult, t as SqlSchemaDiffFn } from "./schema-differ-DmP74bB8-CIQ17HTk.mjs";
|
|
4
|
+
import { $ as TableRenameByHand, $t as unmatchedTableRename, A as ReadColumnDefault, At as plannerFailure, B as SqlDescribedContractSpace, Bt as rowsWithoutValueSummary, C as MigrationPlannerConflict, Ct as isUnfilledSlot, D as NoTable, Dt as planFieldEventCalls, E as ModelTable, Et as partitionIssuesByControlPolicy, F as RequiredColumnMark, Ft as requiredColumnOf, G as SqlTextSources, Gt as sqlTypeLookupsOf, H as SqlQuote, Ht as runnerSuccess, I as SchemaTables, It as requiredColumnsOfMigration, J as SubjectStorage, Jt as temporalCodecPresetWithPrecision, K as StatementColumn, Kt as storageNameOfOperation, L as SingleOperationCall, Lt as resolveColumnRenameAgainst, M as ReportedBody, Mt as readColumnDefault, N as ReportedLiteralDefault, Nt as readReportedDefault, O as PlanFieldEventOperationsOptions, Ot as planFieldEventOperations, P as RequiredColumn, Pt as requiredColumnMeta, Q as TableRename, Qt as unmatchedColumnRename, R as SqlControlFamilyInstance, Rt as resolveTableRenameAgainst, S as MigrationPlanner, St as fieldStatementColumns, T as ModelStorageEffect, Tt as partitionCallsByControlPolicy, U as SqlQuotingRules, Ut as slotSource, V as SqlPslBuildContext, Vt as runnerFailure, W as SqlSlot, Wt as sqlOfSlot, X as TABLE_NAME_CASE_CHANGED_CODE, Xt as unconvertedFieldOf, Y as SuppressionRecord, Yt as temporalStringAuthoringPresets, Z as TableNameCaseGuardTable, Zt as unknownCallNames, _ as INIT_ADDITIVE_POLICY, _t as detectTableNameCaseChanges, a as ColumnRename, at as backfillOfDefaultedField, b as MigrationPlan, bt as fieldOfColumn, c as ContractColumns, ct as contractColumns, d as ConvertedColumn, dt as controlPolicyForCall, et as TableRenameRequest, f as DefaultResolver, ft as convertedColumnMeta, g as FieldStorageEffect, gt as detectDestructiveChanges, h as FieldStatementColumns, ht as createSqlTextSources, i as ColumnOnOneSide, it as assembleAuthoringContributions, j as ReadReportedDefault, jt as plannerSuccess, k as PlannedStatements, kt as planStatements, l as ContractToSchemaIROptions, lt as contractNamespaceToSchemaIR, m as FieldEventCall, mt as createMigrationPlan, n as CallSubjects, nt as _default, o as ColumnRenameRequest, ot as checkSqlExpressionText, p as DefaultResolverColumn, pt as convertedColumnOf, q as StatementPlanningTarget, qt as subjectsOfCalls, r as CallWithCompanions, rt as appliedStatementsInOrder, s as ContractColumn, st as columnTakesTemporaryValue, t as COLUMN_RENAME_UNMATCHED_CODE, tt as TargetMigrationsCapability, u as ControlPolicySubject, ut as contractToSchemaIR, v as MigrationOperationClass, vt as extractCodecControlHooks, w as MigrationPlannerResult, wt as modelRenameStorageEffect, x as MigrationPlanOperation, xt as fieldRenameStorageEffect, y as MigrationOperationPolicy, yt as fieldEventStorage, z as SqlControlTargetDescriptor, zt as rowsWithoutValueFailure } from "./control-D9zFmpo0.mjs";
|
|
5
|
+
export { COLUMN_RENAME_UNMATCHED_CODE, type CallSubjects, type CallWithCompanions, type CodecControlHooks, type ColumnOnOneSide, type ColumnRename, type ColumnRenameRequest, type ContractColumn, type ContractColumns, type ContractToSchemaIROptions, type ControlPolicySubject, type ConvertedColumn, type CreateSqlMigrationPlanOptions, type DefaultResolver, type DefaultResolverColumn, type FieldEvent, type FieldEventCall, type FieldEventContext, type FieldStatementColumns, type FieldStorageEffect, INIT_ADDITIVE_POLICY, type MigrationOperationClass, type MigrationOperationPolicy, type MigrationPlan, type MigrationPlanOperation, type MigrationPlanner, type MigrationPlannerConflict, type MigrationPlannerResult, type ModelStorageEffect, type ModelTable, type NoTable, type PlanFieldEventOperationsOptions, type PlannedStatements, type ReadColumnDefault, type ReadReportedDefault, type ReportedBody, type ReportedLiteralDefault, type RequiredColumn, type RequiredColumnMark, type ResolveIdentityValueInput, type SchemaTables, type SingleOperationCall, type SqlControlAdapterDescriptor, type SqlControlExtensionDescriptor, type SqlControlFamilyInstance, type SqlControlTargetDescriptor, type SqlDescribedContractSpace, type SqlMigrationPlan, type SqlMigrationPlanContractInfo, type SqlMigrationPlanOperation, type SqlMigrationPlanOperationStep, type SqlMigrationPlanOperationTarget, type SqlMigrationPlanner, type SqlMigrationPlannerPlanOptions, type SqlMigrationRunner, type SqlMigrationRunnerErrorCode, type SqlMigrationRunnerExecuteCallbacks, type SqlMigrationRunnerExecuteOptions, type SqlMigrationRunnerFailure, type SqlMigrationRunnerResult, type SqlMigrationRunnerSuccessValue, type SqlPlanTargetDetails, type SqlPlannerConflict, type SqlPlannerConflictKind, type SqlPlannerConflictLocation, type SqlPlannerFailureResult, type SqlPlannerResult, type SqlPlannerSuccessResult, type SqlPslBuildContext, type SqlQuote, type SqlQuotingRules, type SqlSchemaDiffFn, type SqlSchemaDiffInput, type SqlSchemaDiffResult, type SqlSlot, type SqlTextSources, type StatementColumn, type StatementPlanningTarget, type StorageTypePlanResult, type SubjectStorage, type SuppressionRecord, TABLE_NAME_CASE_CHANGED_CODE, type TableNameCaseGuardTable, type TableRename, type TableRenameByHand, type TableRenameRequest, type TargetMigrationsCapability, appliedStatementsInOrder, assembleAuthoringContributions, backfillOfDefaultedField, checkSqlDefaultText, checkSqlExpressionText, columnTakesTemporaryValue, contractColumns, contractNamespaceToSchemaIR, contractToSchemaIR, controlPolicyForCall, convertedColumnMeta, convertedColumnOf, createMigrationPlan, createSqlTextSources, _default as default, detectDestructiveChanges, detectTableNameCaseChanges, extractCodecControlHooks, fieldEventStorage, fieldOfColumn, fieldRenameStorageEffect, fieldStatementColumns, isUnfilledSlot, modelRenameStorageEffect, partitionCallsByControlPolicy, partitionIssuesByControlPolicy, planFieldEventCalls, planFieldEventOperations, planStatements, plannerFailure, plannerSuccess, readColumnDefault, readReportedDefault, requiredColumnMeta, requiredColumnOf, requiredColumnsOfMigration, resolveColumnRenameAgainst, resolveTableRenameAgainst, rowsWithoutValueFailure, rowsWithoutValueSummary, runnerFailure, runnerSuccess, slotSource, sqlOfSlot, sqlTypeLookupsOf, storageNameOfOperation, subjectsOfCalls, temporalCodecPresetWithPrecision, temporalStringAuthoringPresets, unconvertedFieldOf, unknownCallNames, unmatchedColumnRename, unmatchedTableRename };
|
package/dist/family__control.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as checkSqlDefaultText } from "./validators-
|
|
2
|
-
import { s as extractCodecControlHooks } from "./schema-verify-BwRdzbHb-
|
|
3
|
-
import { $ as unmatchedColumnRename, A as planStatements, B as rowsWithoutValueFailure, C as fieldStatementColumns, D as partitionIssuesByControlPolicy, E as partitionCallsByControlPolicy, F as requiredColumnMeta, G as sqlOfSlot, H as runnerFailure, I as requiredColumnOf, J as subjectsOfCalls, K as sqlTypeLookupsOf, L as requiredColumnsOfMigration, M as plannerSuccess, N as readColumnDefault, O as planFieldEventCalls, P as readReportedDefault, Q as unknownCallNames, R as resolveColumnRenameAgainst, S as fieldRenameStorageEffect, T as modelRenameStorageEffect, U as runnerSuccess, V as rowsWithoutValueSummary, W as slotSource, X as temporalStringAuthoringPresets, Y as temporalCodecPresetWithPrecision, Z as unconvertedFieldOf, _ as createSqlTextSources, a as assembleAuthoringContributions, b as fieldEventStorage, c as columnTakesTemporaryValue, d as contractToSchemaIR, et as unmatchedTableRename, f as controlPolicyForCall, g as createMigrationPlan, h as convertedColumnOf, i as appliedStatementsInOrder, j as plannerFailure, k as planFieldEventOperations, l as contractColumns, m as convertedColumnMeta, n as INIT_ADDITIVE_POLICY, o as backfillOfDefaultedField, p as control_default, q as storageNameOfOperation, r as TABLE_NAME_CASE_CHANGED_CODE, s as checkSqlExpressionText, t as COLUMN_RENAME_UNMATCHED_CODE, u as contractNamespaceToSchemaIR, v as detectDestructiveChanges, w as isUnfilledSlot, x as fieldOfColumn, y as detectTableNameCaseChanges, z as resolveTableRenameAgainst } from "./control-
|
|
1
|
+
import { n as checkSqlDefaultText } from "./validators-BCRydDG7.mjs";
|
|
2
|
+
import { s as extractCodecControlHooks } from "./schema-verify-BwRdzbHb-nDeE75xa.mjs";
|
|
3
|
+
import { $ as unmatchedColumnRename, A as planStatements, B as rowsWithoutValueFailure, C as fieldStatementColumns, D as partitionIssuesByControlPolicy, E as partitionCallsByControlPolicy, F as requiredColumnMeta, G as sqlOfSlot, H as runnerFailure, I as requiredColumnOf, J as subjectsOfCalls, K as sqlTypeLookupsOf, L as requiredColumnsOfMigration, M as plannerSuccess, N as readColumnDefault, O as planFieldEventCalls, P as readReportedDefault, Q as unknownCallNames, R as resolveColumnRenameAgainst, S as fieldRenameStorageEffect, T as modelRenameStorageEffect, U as runnerSuccess, V as rowsWithoutValueSummary, W as slotSource, X as temporalStringAuthoringPresets, Y as temporalCodecPresetWithPrecision, Z as unconvertedFieldOf, _ as createSqlTextSources, a as assembleAuthoringContributions, b as fieldEventStorage, c as columnTakesTemporaryValue, d as contractToSchemaIR, et as unmatchedTableRename, f as controlPolicyForCall, g as createMigrationPlan, h as convertedColumnOf, i as appliedStatementsInOrder, j as plannerFailure, k as planFieldEventOperations, l as contractColumns, m as convertedColumnMeta, n as INIT_ADDITIVE_POLICY, o as backfillOfDefaultedField, p as control_default, q as storageNameOfOperation, r as TABLE_NAME_CASE_CHANGED_CODE, s as checkSqlExpressionText, t as COLUMN_RENAME_UNMATCHED_CODE, u as contractNamespaceToSchemaIR, v as detectDestructiveChanges, w as isUnfilledSlot, x as fieldOfColumn, y as detectTableNameCaseChanges, z as resolveTableRenameAgainst } from "./control-D7jPD-Tk.mjs";
|
|
4
4
|
export { COLUMN_RENAME_UNMATCHED_CODE, INIT_ADDITIVE_POLICY, TABLE_NAME_CASE_CHANGED_CODE, appliedStatementsInOrder, assembleAuthoringContributions, backfillOfDefaultedField, checkSqlDefaultText, checkSqlExpressionText, columnTakesTemporaryValue, contractColumns, contractNamespaceToSchemaIR, contractToSchemaIR, controlPolicyForCall, convertedColumnMeta, convertedColumnOf, createMigrationPlan, createSqlTextSources, control_default as default, detectDestructiveChanges, detectTableNameCaseChanges, extractCodecControlHooks, fieldEventStorage, fieldOfColumn, fieldRenameStorageEffect, fieldStatementColumns, isUnfilledSlot, modelRenameStorageEffect, partitionCallsByControlPolicy, partitionIssuesByControlPolicy, planFieldEventCalls, planFieldEventOperations, planStatements, plannerFailure, plannerSuccess, readColumnDefault, readReportedDefault, requiredColumnMeta, requiredColumnOf, requiredColumnsOfMigration, resolveColumnRenameAgainst, resolveTableRenameAgainst, rowsWithoutValueFailure, rowsWithoutValueSummary, runnerFailure, runnerSuccess, slotSource, sqlOfSlot, sqlTypeLookupsOf, storageNameOfOperation, subjectsOfCalls, temporalCodecPresetWithPrecision, temporalStringAuthoringPresets, unconvertedFieldOf, unknownCallNames, unmatchedColumnRename, unmatchedTableRename };
|
package/dist/family__diff.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as VerifySqlSchemaByDiffInput, c as classifySqlDiffIssue, d as verifySqlSchemaByDiff, i as StorageTypeVerdictInput, l as computeSqlDiffVerdict, n as SqlDiffVerdictInput, o as arraysEqual, r as StorageTypeVerdict, s as classifyDiffSubjectGranularity, t as SqlDiffVerdict, u as computeStorageTypeVerdict } from "./diff-
|
|
1
|
+
import { a as VerifySqlSchemaByDiffInput, c as classifySqlDiffIssue, d as verifySqlSchemaByDiff, i as StorageTypeVerdictInput, l as computeSqlDiffVerdict, n as SqlDiffVerdictInput, o as arraysEqual, r as StorageTypeVerdict, s as classifyDiffSubjectGranularity, t as SqlDiffVerdict, u as computeStorageTypeVerdict } from "./diff-ClZvIVOl.mjs";
|
|
2
2
|
export { type SqlDiffVerdict, type SqlDiffVerdictInput, type StorageTypeVerdict, type StorageTypeVerdictInput, type VerifySqlSchemaByDiffInput, arraysEqual, classifyDiffSubjectGranularity, classifySqlDiffIssue, computeSqlDiffVerdict, computeStorageTypeVerdict, verifySqlSchemaByDiff };
|
package/dist/family__diff.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as computeStorageTypeVerdict, c as verifySqlSchemaByDiff, i as computeSqlDiffVerdict, n as classifyDiffSubjectGranularity, r as classifySqlDiffIssue } from "./schema-verify-BwRdzbHb-
|
|
1
|
+
import { a as computeStorageTypeVerdict, c as verifySqlSchemaByDiff, i as computeSqlDiffVerdict, n as classifyDiffSubjectGranularity, r as classifySqlDiffIssue } from "./schema-verify-BwRdzbHb-nDeE75xa.mjs";
|
|
2
2
|
import { t as arraysEqual } from "./diff-DZ82XaGR.mjs";
|
|
3
3
|
export { arraysEqual, classifyDiffSubjectGranularity, classifySqlDiffIssue, computeSqlDiffVerdict, computeStorageTypeVerdict, verifySqlSchemaByDiff };
|
package/dist/family__ir.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as SqlContractSerializerBase, t as SqlContractSerializer } from "./sql-contract-serializer-sMY3prTx-
|
|
1
|
+
import { n as SqlContractSerializerBase, t as SqlContractSerializer } from "./sql-contract-serializer-sMY3prTx-BT6HdXAE.mjs";
|
|
2
2
|
import { t as SqlSchemaVerifierBase } from "./ir-I-xciGUH.mjs";
|
|
3
3
|
export { SqlContractSerializer, SqlContractSerializerBase, SqlSchemaVerifierBase };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as SqlMigration } from "./migration-
|
|
1
|
+
import { t as SqlMigration } from "./migration-RrhpTP1o.mjs";
|
|
2
2
|
export { SqlMigration as Migration };
|
package/dist/family__pack.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as sqlFamilyPack } from "./pack-
|
|
1
|
+
import { t as sqlFamilyPack } from "./pack-DNdZwm5w.mjs";
|
|
2
2
|
export { sqlFamilyPack as default };
|
package/dist/family__pack.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { v as sqlAttributeSpecs } from "./psl-field-resolution-
|
|
2
|
-
import { i as sqlFamilyPslBlockDescriptors, n as sqlFamilyAuthoringTypes, r as sqlFamilyEntityTypes, t as sqlFamilyAuthoringFieldPresets } from "./authoring-type-constructors-0Iv2zdwS-
|
|
1
|
+
import { v as sqlAttributeSpecs } from "./psl-field-resolution-C1E-_fQq-VUYD8cnS.mjs";
|
|
2
|
+
import { i as sqlFamilyPslBlockDescriptors, n as sqlFamilyAuthoringTypes, r as sqlFamilyEntityTypes, t as sqlFamilyAuthoringFieldPresets } from "./authoring-type-constructors-0Iv2zdwS-D4LlP1q2.mjs";
|
|
3
3
|
//#region ../../../2-sql/9-family/dist/pack.mjs
|
|
4
4
|
const sqlFamilyPack = {
|
|
5
5
|
kind: "family",
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { n as DefaultMappingResult, r as mapDefault, t as DefaultMappingOptions } from "./default-mapping-CEISdj2g-DF1LzGBR.mjs";
|
|
2
|
-
import { _ as pslTypeArgumentText, a as FieldPresetUnwritableReason, c as IntrospectedTable, d as PslTypeCall, f as defaultFunctionCallFor, g as inferredTypeConstructors, h as inferColumnTypes, i as FieldPresetReadBackDifference, l as PslColumnTypeKind, m as fieldPresetCallFor, n as FieldPresetArgument, o as InferredTypeConstructor, p as fewestArgumentsCall, r as FieldPresetCallChoice, s as InferredTypeConstructors, t as ColumnTypeOf, u as PslColumnTypeRef, v as toEnumMemberName } from "./psl-build-
|
|
2
|
+
import { _ as pslTypeArgumentText, a as FieldPresetUnwritableReason, c as IntrospectedTable, d as PslTypeCall, f as defaultFunctionCallFor, g as inferredTypeConstructors, h as inferColumnTypes, i as FieldPresetReadBackDifference, l as PslColumnTypeKind, m as fieldPresetCallFor, n as FieldPresetArgument, o as InferredTypeConstructor, p as fewestArgumentsCall, r as FieldPresetCallChoice, s as InferredTypeConstructors, t as ColumnTypeOf, u as PslColumnTypeRef, v as toEnumMemberName } from "./psl-build-DU55bjfu.mjs";
|
|
3
3
|
export { type ColumnTypeOf, type DefaultMappingOptions, type DefaultMappingResult, type FieldPresetArgument, type FieldPresetCallChoice, type FieldPresetReadBackDifference, type FieldPresetUnwritableReason, type InferredTypeConstructor, type InferredTypeConstructors, type IntrospectedTable, type PslColumnTypeKind, type PslColumnTypeRef, type PslTypeCall, defaultFunctionCallFor, fewestArgumentsCall, fieldPresetCallFor, inferColumnTypes, inferredTypeConstructors, mapDefault, pslTypeArgumentText, toEnumMemberName };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { s as toEnumMemberName } from "./psl-names-C3cwe0rg-CsuHOV7E.mjs";
|
|
2
|
-
import { a as inferredTypeConstructors, i as inferColumnTypes, n as fewestArgumentsCall, o as mapDefault, r as fieldPresetCallFor, s as pslTypeArgumentText, t as defaultFunctionCallFor } from "./psl-build-
|
|
2
|
+
import { a as inferredTypeConstructors, i as inferColumnTypes, n as fewestArgumentsCall, o as mapDefault, r as fieldPresetCallFor, s as pslTypeArgumentText, t as defaultFunctionCallFor } from "./psl-build-BT8Ue6gd.mjs";
|
|
3
3
|
export { defaultFunctionCallFor, fewestArgumentsCall, fieldPresetCallFor, inferColumnTypes, inferredTypeConstructors, mapDefault, pslTypeArgumentText, toEnumMemberName };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as buildChildRelationField, c as inferRelations, d as toFieldName, f as toModelName, i as RelationField, l as pluralize, n as InferredRelations, o as deriveBackRelationFieldName, r as PslPrinterOptions, s as deriveRelationFieldName, t as EnumInfo, u as toEnumName } from "./psl-infer-
|
|
1
|
+
import { a as buildChildRelationField, c as inferRelations, d as toFieldName, f as toModelName, i as RelationField, l as pluralize, n as InferredRelations, o as deriveBackRelationFieldName, r as PslPrinterOptions, s as deriveRelationFieldName, t as EnumInfo, u as toEnumName } from "./psl-infer-I75woGr4.mjs";
|
|
2
2
|
export { type EnumInfo, type InferredRelations, type PslPrinterOptions, type RelationField, buildChildRelationField, deriveBackRelationFieldName, deriveRelationFieldName, inferRelations, pluralize, toEnumName, toFieldName, toModelName };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as pluralize, c as toModelName, i as inferRelations, n as deriveBackRelationFieldName, o as toEnumName, r as deriveRelationFieldName, s as toFieldName, t as buildChildRelationField } from "./psl-infer-
|
|
1
|
+
import { a as pluralize, c as toModelName, i as inferRelations, n as deriveBackRelationFieldName, o as toEnumName, r as deriveRelationFieldName, s as toFieldName, t as buildChildRelationField } from "./psl-infer-Bz34csvN.mjs";
|
|
2
2
|
export { buildChildRelationField, deriveBackRelationFieldName, deriveRelationFieldName, inferRelations, pluralize, toEnumName, toFieldName, toModelName };
|
|
@@ -2,8 +2,8 @@ import { a as ForeignKeyReferenceInput, n as ForeignKeyIndex, o as ReferentialAc
|
|
|
2
2
|
import { i as UniqueConstraintInput, n as PrimaryKeyInput } from "./unique-constraint-M5TlQnJQ-BiIHJ85k.mjs";
|
|
3
3
|
import { r as IndexInput } from "./sql-index-ByAAE7K8-BpbPBWPD.mjs";
|
|
4
4
|
import { a as IndexTypeRegistry } from "./index-types-H1O43iYT-ONvDbszL.mjs";
|
|
5
|
-
import {
|
|
6
|
-
import "./types-
|
|
5
|
+
import { _ as SqlIndexIR } from "./types-B3AHHPDh-BHh-89fY.mjs";
|
|
6
|
+
import "./types-BGERR8XF.mjs";
|
|
7
7
|
import { AuthoringWarningSink } from "@prisma/orm-framework/components/authoring";
|
|
8
8
|
//#region ../../../2-sql/1-core/contract/dist/foreign-key-materialization.d.mts
|
|
9
9
|
//#region src/index-equivalence.d.ts
|
|
@@ -95,4 +95,4 @@ declare function defaultForeignKeyIndex(tableName: string, columns: readonly str
|
|
|
95
95
|
}): ForeignKeyIndex | undefined;
|
|
96
96
|
//#endregion
|
|
97
97
|
export { declaredBackingObjectName as a, derivedBackingIndexIsRedundant as c, MaterializedTableConstraints as i, leadingBackingObjectName as l, ForeignKeyAuthoringInput as n, declaredIndexesServeForeignKey as o, IndexCandidate as r, defaultForeignKeyIndex as s, FOREIGN_KEY_INDEX_UNRESOLVED as t, materializeForeignKeysAndIndexes as u };
|
|
98
|
-
//# sourceMappingURL=foreign-key-materialization-
|
|
98
|
+
//# sourceMappingURL=foreign-key-materialization-3vQnPT_D.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"foreign-key-materialization-
|
|
1
|
+
{"version":3,"file":"foreign-key-materialization-3vQnPT_D.d.mts","names":[],"sources":["../../../../2-sql/1-core/contract/dist/foreign-key-materialization.d.mts"],"mappings":";;;;;;;;;KAOK;WACM;;UAED,WAAW,QAAQ,gBAAgB,OAAO,oBAAoB;WAC7D,kBAAkB;WAClB,SAAS,OAAO,WAAW;WAC3B,kBAAkB;WAClB,YAAY;;;;;iBAKN,+BAA+B,QAAQ,gBAAgB,OAAO,oBAAoB,OAAO,4BAA4B,OAAO,WAAW,QAAQ,SAAS;KACpK,WAAW;WACL;;;;;iBAKM,yBAAyB,QAAQ,gBAAgB,UAAU,oBAAoB,UAAU,4BAA4B,OAAO,WAAW,QAAQ,SAAS;WAC9J,SAAS,OAAO;;;;;UAKjB;WACC,OAAO;;WAEP;;;;;cAKG;;;;UAIJ;WACC,QAAQ;WACR,QAAQ;WACR;WACA,WAAW;WACX,WAAW;WACX;WACA;;UAED;WACC,sBAAsB;WACtB,kBAAkB;;;;;iBAKZ,iCAAiC;WACvC;WACA,sBAAsB;WACtB,0BAA0B;WAC1B,kBAAkB;WAClB,YAAY;WACZ,UAAU;WACV,YAAY,KAAK;IACxB;;;;iBAIa,+BAA+B,4BAA4B;WACjE,kBAAkB;WAClB,kBAAkB;WAClB,YAAY;;;;;iBAKN,0BAA0B,4BAA4B;WAC5D,kBAAkB;WAClB,kBAAkB;WAClB,YAAY;;;;;iBAKN,uBAAuB,mBAAmB,4BAA4B;WAC5E,kBAAkB;WAClB,kBAAkB;WAClB,YAAY;IACnB"}
|
package/dist/{foreign-key-materialization-BIvQTfz8.mjs → foreign-key-materialization-C_FPLzj3.mjs}
RENAMED
|
@@ -2,7 +2,7 @@ import { t as contractError } from "./contract-errors-BCN6RVI5-5IHBF_lg.mjs";
|
|
|
2
2
|
import { a as rendersIndexBody, t as accessMethodOf } from "./index-types-pC_5vADQ-TTUXAfmL.mjs";
|
|
3
3
|
import { g as truncateToWireNamePrefixBytes, l as nameOf, o as defaultIndexName } from "./naming-bM5qm5PY-DdginUhA.mjs";
|
|
4
4
|
import { r as lowerAuthoredIndex } from "./index-naming-BOcJT1B3-18gQUduD.mjs";
|
|
5
|
-
import { i as leadingBackingObjectName, n as identicalIndexes, o as servingKey, r as indexNodeOf, s as startsWithColumns, t as derivedBackingIndexIsRedundant } from "./index-equivalence-DswCiq5l-
|
|
5
|
+
import { i as leadingBackingObjectName, n as identicalIndexes, o as servingKey, r as indexNodeOf, s as startsWithColumns, t as derivedBackingIndexIsRedundant } from "./index-equivalence-DswCiq5l-C6SAs-Yz.mjs";
|
|
6
6
|
import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
|
|
7
7
|
import { InternalError } from "@prisma/orm-framework/utils/internal-error";
|
|
8
8
|
import { asNamespaceId } from "@prisma/orm-framework/contract/types";
|
|
@@ -284,4 +284,4 @@ function foreignKeyIndexOf(backing) {
|
|
|
284
284
|
//#endregion
|
|
285
285
|
export { materializeForeignKeysAndIndexes as a, defaultForeignKeyIndex as i, declaredBackingObjectName as n, declaredIndexesServeForeignKey as r, FOREIGN_KEY_INDEX_UNRESOLVED as t };
|
|
286
286
|
|
|
287
|
-
//# sourceMappingURL=foreign-key-materialization-
|
|
287
|
+
//# sourceMappingURL=foreign-key-materialization-C_FPLzj3.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"foreign-key-materialization-BIvQTfz8.mjs","names":[],"sources":["../../../../2-sql/1-core/contract/dist/foreign-key-materialization.mjs"],"sourcesContent":["import { t as contractError } from \"./contract-errors-BCN6RVI5.mjs\";\nimport { a as rendersIndexBody, t as accessMethodOf } from \"./index-types-pC_5vADQ.mjs\";\nimport { r as lowerAuthoredIndex } from \"./index-naming-BOcJT1B3.mjs\";\nimport { i as leadingBackingObjectName, n as identicalIndexes, o as servingKey, r as indexNodeOf, s as startsWithColumns, t as derivedBackingIndexIsRedundant } from \"./index-equivalence-DswCiq5l.mjs\";\nimport { defaultIndexName, nameOf, truncateToWireNamePrefixBytes } from \"@internal/sql-schema-ir/naming\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { asNamespaceId } from \"@internal/contract/types\";\n//#region src/index-deduplication.ts\nconst IDENTICAL_DESCRIPTION = \"the planner sees them as the same index. The contract keeps both because each is named.\";\nconst REDUNDANT_DESCRIPTION = \"which already serves the same lookups.\";\n/**\n* Removes the indexes of one table that duplicate another. Two indexes are identical when the planner sees them as the same index apart from their names (see {@link identicalIndexes}); of an identical group the pass keeps the indexes named by the user, or the first one when none is. A plain non-unique index whose columns are those of the primary key, a unique constraint or a unique index without a predicate is redundant (see {@link servingKey}), and the pass removes it unless it is named by the user. Every index named by the user survives; the pass warns about each one that duplicates another, and refuses two identical indexes both named with `name:`, whose wire names the planner could not tell apart.\n*/\nfunction deduplicateIndexes(input) {\n\tconst { tableName, warnings } = input;\n\tconst replacements = /* @__PURE__ */ new Map();\n\tconst nodes = new Map(input.indexes.map((candidate) => [candidate, indexNodeOf(candidate.index)]));\n\tconst nodeOf = (candidate) => {\n\t\tconst node = nodes.get(candidate);\n\t\tif (node === void 0) throw new InternalError(\"every candidate has a node\");\n\t\treturn node;\n\t};\n\tconst groups = [];\n\tfor (const candidate of input.indexes) {\n\t\tconst position = groups.findIndex(([first]) => identicalIndexes(nodeOf(first), nodeOf(candidate)));\n\t\tconst group = groups[position];\n\t\tif (group === void 0) groups.push([candidate]);\n\t\telse groups[position] = [...group, candidate];\n\t}\n\tfor (const group of groups) {\n\t\tconst named = group.filter((candidate) => candidate.namedByUser);\n\t\tconst wireNamed = named.filter((candidate) => candidate.index.naming.kind === \"wire\");\n\t\tif (wireNamed.length > 1) throw identicalWireNamedIndexesError(tableName, wireNamed);\n\t\tconst kept = named[0] ?? group[0];\n\t\tfor (const candidate of group) if (candidate !== kept && !candidate.namedByUser) replacements.set(candidate, {\n\t\t\tkind: \"index\",\n\t\t\tindex: kept\n\t\t});\n\t\tif (named.length > 1) warnings.push(identicalIndexesWarning(tableName, named));\n\t}\n\tconst survivors = input.indexes.filter((candidate) => !replacements.has(candidate));\n\tfor (const candidate of survivors) {\n\t\tconst servedBy = servingKey(nodeOf(candidate), {\n\t\t\tindexes: survivors,\n\t\t\tnodeOf,\n\t\t\tuniques: input.uniques,\n\t\t\tprimaryKey: input.primaryKey\n\t\t});\n\t\tif (servedBy === void 0) continue;\n\t\tif (candidate.namedByUser) warnings.push(redundantIndexWarning(tableName, candidate, servedBy));\n\t\telse replacements.set(candidate, servedBy);\n\t}\n\treturn {\n\t\tindexes: input.indexes.filter((candidate) => !replacements.has(candidate)),\n\t\treplacements\n\t};\n}\nfunction identicalWireNamedIndexesError(tableName, wireNamed) {\n\treturn contractError(\"CONTRACT.ARGUMENT_INVALID\", `Indexes ${quotedList(wireNamed.map((candidate) => writtenName(candidate.index)))} on table \"${tableName}\" are identical and both named with name:; the planner pairs wire-named indexes by their content, so it could not tell them apart.`, {\n\t\tfix: \"Remove one of them, or name one with map: to keep both under exact names.\",\n\t\tmeta: {\n\t\t\ttableName,\n\t\t\tindexes: wireNamed.map((candidate) => writtenName(candidate.index))\n\t\t}\n\t});\n}\n/** The name the source wrote: the prefix of a wire-named index, the whole name of an exact one. */\nfunction writtenName(index) {\n\treturn index.naming.kind === \"wire\" ? index.naming.prefix : index.naming.name;\n}\nfunction quotedList(names) {\n\tconst quoted = names.map((name) => `\"${name}\"`);\n\treturn quoted.length <= 2 ? quoted.join(\" and \") : `${quoted.slice(0, -1).join(\", \")} and ${quoted.at(-1)}`;\n}\nfunction identicalIndexesWarning(tableName, named) {\n\tconst names = quotedList(named.map((candidate) => writtenName(candidate.index)));\n\treturn {\n\t\tcode: \"PN_INDEX_DUPLICATE\",\n\t\tmessage: `Indexes ${names} on table \"${tableName}\" are identical: ${IDENTICAL_DESCRIPTION} Remove one of them.`,\n\t\titem: `table \"${tableName}\": indexes ${names}`,\n\t\tsummary: `tables have named indexes that are identical: ${IDENTICAL_DESCRIPTION} Remove one of each.`\n\t};\n}\nfunction describeReplacement(replacement) {\n\tswitch (replacement.kind) {\n\t\tcase \"primaryKey\": return \"the primary key\";\n\t\tcase \"uniqueConstraint\": return replacement.unique.name === void 0 ? `the unique constraint on (${replacement.unique.columns.join(\", \")})` : `the unique constraint \"${replacement.unique.name}\"`;\n\t\tcase \"index\": return `the unique index \"${writtenName(replacement.index.index)}\"`;\n\t}\n}\nfunction redundantIndexWarning(tableName, candidate, servedBy) {\n\tconst name = writtenName(candidate.index);\n\treturn {\n\t\tcode: \"PN_INDEX_REDUNDANT\",\n\t\tmessage: `Index \"${name}\" on table \"${tableName}\" has the same columns as ${describeReplacement(servedBy)}, ${REDUNDANT_DESCRIPTION} The contract keeps the index because it is named. Remove it.`,\n\t\titem: `table \"${tableName}\": index \"${name}\"`,\n\t\tsummary: `tables have a named index with the same columns as a unique constraint, unique index or primary key, ${REDUNDANT_DESCRIPTION} The contract keeps each index because it is named. Remove them.`\n\t};\n}\n//#endregion\n//#region src/foreign-key-materialization.ts\n/** The `meta.reason` of the refusal of a relation's `index: \"<name>\"`, which a source can report at the relation. */\nconst FOREIGN_KEY_INDEX_UNRESOLVED = \"foreign-key-index-unresolved\";\n/**\n* Lowers a table's authored foreign keys and indexes into the entities `contract.json` persists. A `constraint: false` foreign key contributes no `foreignKeys[]` entry. A foreign key with `index: true` gets a derived backing index; one with `index: \"<name>\"` uses what the table declares under that name. The table's indexes then pass through {@link deduplicateIndexes}, and each foreign key states what backs it in the result: an index by name, or the primary key or a unique constraint by kind.\n*/\nfunction materializeForeignKeysAndIndexes(input) {\n\tconst { tableName, declaredIndexes, uniques, primaryKey, indexTypes } = input;\n\tconst derivedIndexes = [];\n\tconst intents = input.foreignKeys.map((foreignKey) => {\n\t\tconst { constraint, index, ...reference } = foreignKey;\n\t\tif (index !== true) return {\n\t\t\tconstraint,\n\t\t\treference,\n\t\t\tindex\n\t\t};\n\t\tconst derived = derivedBackingIndex(tableName, reference.source.columns);\n\t\tderivedIndexes.push(derived);\n\t\treturn {\n\t\t\tconstraint,\n\t\t\treference,\n\t\t\tindex: derived\n\t\t};\n\t});\n\tconst deduplicated = deduplicateIndexes({\n\t\ttableName,\n\t\tindexes: [...declaredIndexes, ...derivedIndexes],\n\t\tuniques,\n\t\tprimaryKey,\n\t\twarnings: input.warnings\n\t});\n\tconst resolve = (backing) => foreignKeyIndexOf(resolveReplacement(backing, deduplicated.replacements));\n\treturn {\n\t\tforeignKeys: intents.flatMap(({ constraint, reference, index }) => {\n\t\t\tconst backing = index === false ? void 0 : typeof index === \"string\" ? namedBackingObject(reference.source, index, {\n\t\t\t\tdeclaredIndexes,\n\t\t\t\tuniques,\n\t\t\t\tprimaryKey,\n\t\t\t\tindexTypes,\n\t\t\t\tresolve\n\t\t\t}) : resolve({\n\t\t\t\tkind: \"index\",\n\t\t\t\tindex\n\t\t\t});\n\t\t\tif (!constraint) return [];\n\t\t\treturn [backing === void 0 ? reference : {\n\t\t\t\t...reference,\n\t\t\t\tindex: backing\n\t\t\t}];\n\t\t}),\n\t\tindexes: deduplicated.indexes.map((candidate) => candidate.index)\n\t};\n}\n/**\n* Whether a table's declared indexes, unique constraints or primary key already serve a foreign key on `columns`, so the build would drop a derived backing index again. A source that writes no backing index of its own, such as a Prisma 7 schema, leaves the foreign key's `index` to the build where this holds, so the stored foreign key states what backs it.\n*/\nfunction declaredIndexesServeForeignKey(columns, table) {\n\treturn derivedBackingIndexIsRedundant(columns, {\n\t\tindexes: table.indexes,\n\t\tnodeOf: indexNodeOf,\n\t\tuniques: table.uniques,\n\t\tprimaryKey: table.primaryKey\n\t});\n}\n/**\n* The name to give a relation's `index` argument when the table's declared indexes and keys serve a foreign key on `columns` although the build would keep a derived backing index beside them (see {@link leadingBackingObjectName}).\n*/\nfunction declaredBackingObjectName(columns, table) {\n\treturn leadingBackingObjectName(columns, {\n\t\tindexes: table.indexes,\n\t\tnodeOf: indexNodeOf,\n\t\tnameOf: (index) => nameOf(index.naming),\n\t\tuniques: table.uniques,\n\t\tprimaryKey: table.primaryKey\n\t});\n}\n/**\n* What a foreign key on `columns` states it is backed by when its relation says nothing, beside a table whose indexes all carry the `name` or `map` the source gave them, as a printed contract's do. A printer writes a relation's `index` argument only where the stored foreign key differs from this.\n*/\nfunction defaultForeignKeyIndex(tableName, columns, table) {\n\tconst reference = {\n\t\tnamespaceId: asNamespaceId(UNBOUND_NAMESPACE_ID),\n\t\ttableName,\n\t\tcolumns\n\t};\n\tconst [foreignKey] = materializeForeignKeysAndIndexes({\n\t\ttableName,\n\t\tforeignKeys: [{\n\t\t\tsource: reference,\n\t\t\ttarget: reference,\n\t\t\tconstraint: true,\n\t\t\tindex: true\n\t\t}],\n\t\tdeclaredIndexes: table.indexes.map((index) => ({\n\t\t\tindex,\n\t\t\tnamedByUser: true\n\t\t})),\n\t\tuniques: table.uniques,\n\t\tprimaryKey: table.primaryKey,\n\t\twarnings: [],\n\t\tindexTypes: void 0\n\t}).foreignKeys;\n\treturn typeof foreignKey?.index === \"object\" ? foreignKey.index : void 0;\n}\nfunction derivedBackingIndex(tableName, columns) {\n\treturn {\n\t\tindex: lowerAuthoredIndex(tableName, {\n\t\t\tcolumns,\n\t\t\twhere: void 0,\n\t\t\tunique: void 0,\n\t\t\tmap: void 0,\n\t\t\tname: truncateToWireNamePrefixBytes(defaultIndexName(tableName, columns)),\n\t\t\ttype: void 0,\n\t\t\toptions: void 0\n\t\t}),\n\t\tnamedByUser: false\n\t};\n}\n/**\n* What a relation's `index: \"<name>\"` points at. The name is the `name` or `map` the source gave an index, unique constraint or primary key, or an index's stored name; an unnamed index's default name does not count. Identical indexes count as one, so the name is resolved after they merge. The object must start with the foreign key's columns, in order, or it would not serve the foreign key's lookups. An index of a type whose body is rendered from its options (see {@link rendersIndexBody}) is refused too: its columns are not its key.\n*/\nfunction namedBackingObject(source, name, table) {\n\tconst { namespaceId, tableName, columns } = source;\n\tconst subject = `The foreign key on table \"${tableName}\" columns (${columns.join(\", \")}) names \"${name}\" as its index`;\n\tconst meta = {\n\t\treason: FOREIGN_KEY_INDEX_UNRESOLVED,\n\t\tnamespaceId,\n\t\ttableName,\n\t\tcolumns,\n\t\tindex: name\n\t};\n\tconst indexes = table.declaredIndexes.filter((candidate) => candidate.namedByUser && writtenName(candidate.index) === name || nameOf(candidate.index.naming) === name);\n\tconst keys = [...table.uniques.filter((unique) => unique.name === name), ...table.primaryKey?.name === name ? [table.primaryKey] : []];\n\tconst resolvedIndexes = [...new Map(indexes.map((index) => {\n\t\tconst resolved = table.resolve({\n\t\t\tkind: \"index\",\n\t\t\tindex\n\t\t});\n\t\treturn [JSON.stringify(resolved), {\n\t\t\tindex,\n\t\t\tresolved\n\t\t}];\n\t})).values()];\n\tconst matches = resolvedIndexes.length + keys.length;\n\tif (matches === 0) throw contractError(\"CONTRACT.ARGUMENT_INVALID\", `${subject}, but table \"${tableName}\" has no index, unique constraint or primary key with that name.`, {\n\t\tfix: `Declare an index, unique constraint or primary key named \"${name}\" on table \"${tableName}\", or drop the index argument so the foreign key gets its own backing index.`,\n\t\tmeta\n\t});\n\tif (matches > 1) throw contractError(\"CONTRACT.ARGUMENT_INVALID\", `${subject}, but table \"${tableName}\" has more than one index, unique constraint or primary key with that name.`, {\n\t\tfix: `Give the object the foreign key should use a name no other index, unique constraint or primary key of table \"${tableName}\" has, and name that on the relation.`,\n\t\tmeta\n\t});\n\tconst [match] = resolvedIndexes;\n\tconst key = keys[0];\n\tconst matchType = match?.index.index.type;\n\tconst typeEntry = matchType === void 0 ? void 0 : table.indexTypes?.get(matchType);\n\tif (typeEntry !== void 0 && rendersIndexBody(typeEntry)) throw contractError(\"CONTRACT.ARGUMENT_INVALID\", `${subject}, but it is a \"${typeEntry.type}\" index, a \"${accessMethodOf(typeEntry)}\" index whose key is rendered from its options rather than its columns, so it does not serve the foreign key's lookups.`, {\n\t\tfix: `Name an index, unique constraint or primary key whose first columns are (${columns.join(\", \")}), or drop the index argument so the foreign key gets its own backing index beside the \"${typeEntry.type}\" index.`,\n\t\tmeta\n\t});\n\tconst objectColumns = match !== void 0 ? match.index.index.columns : key?.columns;\n\tif (objectColumns === void 0 || !startsWithColumns(objectColumns, columns)) throw contractError(\"CONTRACT.ARGUMENT_INVALID\", `${subject}, but ${objectColumns === void 0 ? \"it indexes an expression, not the foreign key's columns\" : `its columns (${objectColumns.join(\", \")}) do not start with the foreign key's columns`}, so it does not serve the foreign key's lookups.`, {\n\t\tfix: `Name an index, unique constraint or primary key whose first columns are (${columns.join(\", \")}), or drop the index argument so the foreign key gets its own backing index.`,\n\t\tmeta\n\t});\n\tif (match !== void 0) return match.resolved;\n\treturn key === table.primaryKey ? { primaryKey: true } : { unique: objectColumns };\n}\nfunction resolveReplacement(backing, replacements) {\n\tlet current = backing;\n\twhile (current.kind === \"index\") {\n\t\tconst replacement = replacements.get(current.index);\n\t\tif (replacement === void 0) break;\n\t\tcurrent = replacement;\n\t}\n\treturn current;\n}\nfunction foreignKeyIndexOf(backing) {\n\tswitch (backing.kind) {\n\t\tcase \"index\": return { name: nameOf(backing.index.index.naming) };\n\t\tcase \"uniqueConstraint\": return { unique: backing.unique.columns };\n\t\tcase \"primaryKey\": return { primaryKey: true };\n\t}\n}\n//#endregion\nexport { FOREIGN_KEY_INDEX_UNRESOLVED, declaredBackingObjectName, declaredIndexesServeForeignKey, defaultForeignKeyIndex, derivedBackingIndexIsRedundant, leadingBackingObjectName, materializeForeignKeysAndIndexes };\n\n//# sourceMappingURL=foreign-key-materialization.mjs.map"],"mappings":";;;;;;;;;AASA,MAAM,wBAAwB;AAC9B,MAAM,wBAAwB;;;;AAI9B,SAAS,mBAAmB,OAAO;CAClC,MAAM,EAAE,WAAW,aAAa;CAChC,MAAM,+BAA+B,IAAI,IAAI;CAC7C,MAAM,QAAQ,IAAI,IAAI,MAAM,QAAQ,KAAK,cAAc,CAAC,WAAW,YAAY,UAAU,KAAK,CAAC,CAA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OAAO,GAAG,MAAM,cAAc,6BAA6B,GAAG,QAAQ,QAAQ,kBAAkB,KAAK,IAAI,4DAA4D,gBAAgB,cAAc,KAAK,IAAI,EAAE,+CAA+C,oDAAoD;EAClX,KAAK,4EAA4E,QAAQ,KAAK,IAAI,EAAE;EACpG;CACD,CAAC;CACD,IAAI,UAAU,KAAK,GAAG,OAAO,MAAM;CACnC,OAAO,QAAQ,MAAM,aAAa,EAAE,YAAY,KAAK,IAAI,EAAE,QAAQ,cAAc;AAClF;AACA,SAAS,mBAAmB,SAAS,cAAc;CAClD,IAAI,UAAU;CACd,OAAO,QAAQ,SAAS,SAAS;EAChC,MAAM,cAAc,aAAa,IAAI,QAAQ,KAAK;EAClD,IAAI,gBAAgB,KAAK,GAAG;EAC5B,UAAU;CACX;CACA,OAAO;AACR;AACA,SAAS,kBAAkB,SAAS;CACnC,QAAQ,QAAQ,MAAhB;EACC,KAAK,SAAS,OAAO,EAAE,MAAM,OAAO,QAAQ,MAAM,MAAM,MAAM,EAAE;EAChE,KAAK,oBAAoB,OAAO,EAAE,QAAQ,QAAQ,OAAO,QAAQ;EACjE,KAAK,cAAc,OAAO,EAAE,YAAY,KAAK;CAC9C;AACD"}
|
|
1
|
+
{"version":3,"file":"foreign-key-materialization-C_FPLzj3.mjs","names":[],"sources":["../../../../2-sql/1-core/contract/dist/foreign-key-materialization.mjs"],"sourcesContent":["import { t as contractError } from \"./contract-errors-BCN6RVI5.mjs\";\nimport { a as rendersIndexBody, t as accessMethodOf } from \"./index-types-pC_5vADQ.mjs\";\nimport { r as lowerAuthoredIndex } from \"./index-naming-BOcJT1B3.mjs\";\nimport { i as leadingBackingObjectName, n as identicalIndexes, o as servingKey, r as indexNodeOf, s as startsWithColumns, t as derivedBackingIndexIsRedundant } from \"./index-equivalence-DswCiq5l.mjs\";\nimport { defaultIndexName, nameOf, truncateToWireNamePrefixBytes } from \"@internal/sql-schema-ir/naming\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { asNamespaceId } from \"@internal/contract/types\";\n//#region src/index-deduplication.ts\nconst IDENTICAL_DESCRIPTION = \"the planner sees them as the same index. The contract keeps both because each is named.\";\nconst REDUNDANT_DESCRIPTION = \"which already serves the same lookups.\";\n/**\n* Removes the indexes of one table that duplicate another. Two indexes are identical when the planner sees them as the same index apart from their names (see {@link identicalIndexes}); of an identical group the pass keeps the indexes named by the user, or the first one when none is. A plain non-unique index whose columns are those of the primary key, a unique constraint or a unique index without a predicate is redundant (see {@link servingKey}), and the pass removes it unless it is named by the user. Every index named by the user survives; the pass warns about each one that duplicates another, and refuses two identical indexes both named with `name:`, whose wire names the planner could not tell apart.\n*/\nfunction deduplicateIndexes(input) {\n\tconst { tableName, warnings } = input;\n\tconst replacements = /* @__PURE__ */ new Map();\n\tconst nodes = new Map(input.indexes.map((candidate) => [candidate, indexNodeOf(candidate.index)]));\n\tconst nodeOf = (candidate) => {\n\t\tconst node = nodes.get(candidate);\n\t\tif (node === void 0) throw new InternalError(\"every candidate has a node\");\n\t\treturn node;\n\t};\n\tconst groups = [];\n\tfor (const candidate of input.indexes) {\n\t\tconst position = groups.findIndex(([first]) => identicalIndexes(nodeOf(first), nodeOf(candidate)));\n\t\tconst group = groups[position];\n\t\tif (group === void 0) groups.push([candidate]);\n\t\telse groups[position] = [...group, candidate];\n\t}\n\tfor (const group of groups) {\n\t\tconst named = group.filter((candidate) => candidate.namedByUser);\n\t\tconst wireNamed = named.filter((candidate) => candidate.index.naming.kind === \"wire\");\n\t\tif (wireNamed.length > 1) throw identicalWireNamedIndexesError(tableName, wireNamed);\n\t\tconst kept = named[0] ?? group[0];\n\t\tfor (const candidate of group) if (candidate !== kept && !candidate.namedByUser) replacements.set(candidate, {\n\t\t\tkind: \"index\",\n\t\t\tindex: kept\n\t\t});\n\t\tif (named.length > 1) warnings.push(identicalIndexesWarning(tableName, named));\n\t}\n\tconst survivors = input.indexes.filter((candidate) => !replacements.has(candidate));\n\tfor (const candidate of survivors) {\n\t\tconst servedBy = servingKey(nodeOf(candidate), {\n\t\t\tindexes: survivors,\n\t\t\tnodeOf,\n\t\t\tuniques: input.uniques,\n\t\t\tprimaryKey: input.primaryKey\n\t\t});\n\t\tif (servedBy === void 0) continue;\n\t\tif (candidate.namedByUser) warnings.push(redundantIndexWarning(tableName, candidate, servedBy));\n\t\telse replacements.set(candidate, servedBy);\n\t}\n\treturn {\n\t\tindexes: input.indexes.filter((candidate) => !replacements.has(candidate)),\n\t\treplacements\n\t};\n}\nfunction identicalWireNamedIndexesError(tableName, wireNamed) {\n\treturn contractError(\"CONTRACT.ARGUMENT_INVALID\", `Indexes ${quotedList(wireNamed.map((candidate) => writtenName(candidate.index)))} on table \"${tableName}\" are identical and both named with name:; the planner pairs wire-named indexes by their content, so it could not tell them apart.`, {\n\t\tfix: \"Remove one of them, or name one with map: to keep both under exact names.\",\n\t\tmeta: {\n\t\t\ttableName,\n\t\t\tindexes: wireNamed.map((candidate) => writtenName(candidate.index))\n\t\t}\n\t});\n}\n/** The name the source wrote: the prefix of a wire-named index, the whole name of an exact one. */\nfunction writtenName(index) {\n\treturn index.naming.kind === \"wire\" ? index.naming.prefix : index.naming.name;\n}\nfunction quotedList(names) {\n\tconst quoted = names.map((name) => `\"${name}\"`);\n\treturn quoted.length <= 2 ? quoted.join(\" and \") : `${quoted.slice(0, -1).join(\", \")} and ${quoted.at(-1)}`;\n}\nfunction identicalIndexesWarning(tableName, named) {\n\tconst names = quotedList(named.map((candidate) => writtenName(candidate.index)));\n\treturn {\n\t\tcode: \"PN_INDEX_DUPLICATE\",\n\t\tmessage: `Indexes ${names} on table \"${tableName}\" are identical: ${IDENTICAL_DESCRIPTION} Remove one of them.`,\n\t\titem: `table \"${tableName}\": indexes ${names}`,\n\t\tsummary: `tables have named indexes that are identical: ${IDENTICAL_DESCRIPTION} Remove one of each.`\n\t};\n}\nfunction describeReplacement(replacement) {\n\tswitch (replacement.kind) {\n\t\tcase \"primaryKey\": return \"the primary key\";\n\t\tcase \"uniqueConstraint\": return replacement.unique.name === void 0 ? `the unique constraint on (${replacement.unique.columns.join(\", \")})` : `the unique constraint \"${replacement.unique.name}\"`;\n\t\tcase \"index\": return `the unique index \"${writtenName(replacement.index.index)}\"`;\n\t}\n}\nfunction redundantIndexWarning(tableName, candidate, servedBy) {\n\tconst name = writtenName(candidate.index);\n\treturn {\n\t\tcode: \"PN_INDEX_REDUNDANT\",\n\t\tmessage: `Index \"${name}\" on table \"${tableName}\" has the same columns as ${describeReplacement(servedBy)}, ${REDUNDANT_DESCRIPTION} The contract keeps the index because it is named. Remove it.`,\n\t\titem: `table \"${tableName}\": index \"${name}\"`,\n\t\tsummary: `tables have a named index with the same columns as a unique constraint, unique index or primary key, ${REDUNDANT_DESCRIPTION} The contract keeps each index because it is named. Remove them.`\n\t};\n}\n//#endregion\n//#region src/foreign-key-materialization.ts\n/** The `meta.reason` of the refusal of a relation's `index: \"<name>\"`, which a source can report at the relation. */\nconst FOREIGN_KEY_INDEX_UNRESOLVED = \"foreign-key-index-unresolved\";\n/**\n* Lowers a table's authored foreign keys and indexes into the entities `contract.json` persists. A `constraint: false` foreign key contributes no `foreignKeys[]` entry. A foreign key with `index: true` gets a derived backing index; one with `index: \"<name>\"` uses what the table declares under that name. The table's indexes then pass through {@link deduplicateIndexes}, and each foreign key states what backs it in the result: an index by name, or the primary key or a unique constraint by kind.\n*/\nfunction materializeForeignKeysAndIndexes(input) {\n\tconst { tableName, declaredIndexes, uniques, primaryKey, indexTypes } = input;\n\tconst derivedIndexes = [];\n\tconst intents = input.foreignKeys.map((foreignKey) => {\n\t\tconst { constraint, index, ...reference } = foreignKey;\n\t\tif (index !== true) return {\n\t\t\tconstraint,\n\t\t\treference,\n\t\t\tindex\n\t\t};\n\t\tconst derived = derivedBackingIndex(tableName, reference.source.columns);\n\t\tderivedIndexes.push(derived);\n\t\treturn {\n\t\t\tconstraint,\n\t\t\treference,\n\t\t\tindex: derived\n\t\t};\n\t});\n\tconst deduplicated = deduplicateIndexes({\n\t\ttableName,\n\t\tindexes: [...declaredIndexes, ...derivedIndexes],\n\t\tuniques,\n\t\tprimaryKey,\n\t\twarnings: input.warnings\n\t});\n\tconst resolve = (backing) => foreignKeyIndexOf(resolveReplacement(backing, deduplicated.replacements));\n\treturn {\n\t\tforeignKeys: intents.flatMap(({ constraint, reference, index }) => {\n\t\t\tconst backing = index === false ? void 0 : typeof index === \"string\" ? namedBackingObject(reference.source, index, {\n\t\t\t\tdeclaredIndexes,\n\t\t\t\tuniques,\n\t\t\t\tprimaryKey,\n\t\t\t\tindexTypes,\n\t\t\t\tresolve\n\t\t\t}) : resolve({\n\t\t\t\tkind: \"index\",\n\t\t\t\tindex\n\t\t\t});\n\t\t\tif (!constraint) return [];\n\t\t\treturn [backing === void 0 ? reference : {\n\t\t\t\t...reference,\n\t\t\t\tindex: backing\n\t\t\t}];\n\t\t}),\n\t\tindexes: deduplicated.indexes.map((candidate) => candidate.index)\n\t};\n}\n/**\n* Whether a table's declared indexes, unique constraints or primary key already serve a foreign key on `columns`, so the build would drop a derived backing index again. A source that writes no backing index of its own, such as a Prisma 7 schema, leaves the foreign key's `index` to the build where this holds, so the stored foreign key states what backs it.\n*/\nfunction declaredIndexesServeForeignKey(columns, table) {\n\treturn derivedBackingIndexIsRedundant(columns, {\n\t\tindexes: table.indexes,\n\t\tnodeOf: indexNodeOf,\n\t\tuniques: table.uniques,\n\t\tprimaryKey: table.primaryKey\n\t});\n}\n/**\n* The name to give a relation's `index` argument when the table's declared indexes and keys serve a foreign key on `columns` although the build would keep a derived backing index beside them (see {@link leadingBackingObjectName}).\n*/\nfunction declaredBackingObjectName(columns, table) {\n\treturn leadingBackingObjectName(columns, {\n\t\tindexes: table.indexes,\n\t\tnodeOf: indexNodeOf,\n\t\tnameOf: (index) => nameOf(index.naming),\n\t\tuniques: table.uniques,\n\t\tprimaryKey: table.primaryKey\n\t});\n}\n/**\n* What a foreign key on `columns` states it is backed by when its relation says nothing, beside a table whose indexes all carry the `name` or `map` the source gave them, as a printed contract's do. A printer writes a relation's `index` argument only where the stored foreign key differs from this.\n*/\nfunction defaultForeignKeyIndex(tableName, columns, table) {\n\tconst reference = {\n\t\tnamespaceId: asNamespaceId(UNBOUND_NAMESPACE_ID),\n\t\ttableName,\n\t\tcolumns\n\t};\n\tconst [foreignKey] = materializeForeignKeysAndIndexes({\n\t\ttableName,\n\t\tforeignKeys: [{\n\t\t\tsource: reference,\n\t\t\ttarget: reference,\n\t\t\tconstraint: true,\n\t\t\tindex: true\n\t\t}],\n\t\tdeclaredIndexes: table.indexes.map((index) => ({\n\t\t\tindex,\n\t\t\tnamedByUser: true\n\t\t})),\n\t\tuniques: table.uniques,\n\t\tprimaryKey: table.primaryKey,\n\t\twarnings: [],\n\t\tindexTypes: void 0\n\t}).foreignKeys;\n\treturn typeof foreignKey?.index === \"object\" ? foreignKey.index : void 0;\n}\nfunction derivedBackingIndex(tableName, columns) {\n\treturn {\n\t\tindex: lowerAuthoredIndex(tableName, {\n\t\t\tcolumns,\n\t\t\twhere: void 0,\n\t\t\tunique: void 0,\n\t\t\tmap: void 0,\n\t\t\tname: truncateToWireNamePrefixBytes(defaultIndexName(tableName, columns)),\n\t\t\ttype: void 0,\n\t\t\toptions: void 0\n\t\t}),\n\t\tnamedByUser: false\n\t};\n}\n/**\n* What a relation's `index: \"<name>\"` points at. The name is the `name` or `map` the source gave an index, unique constraint or primary key, or an index's stored name; an unnamed index's default name does not count. Identical indexes count as one, so the name is resolved after they merge. The object must start with the foreign key's columns, in order, or it would not serve the foreign key's lookups. An index of a type whose body is rendered from its options (see {@link rendersIndexBody}) is refused too: its columns are not its key.\n*/\nfunction namedBackingObject(source, name, table) {\n\tconst { namespaceId, tableName, columns } = source;\n\tconst subject = `The foreign key on table \"${tableName}\" columns (${columns.join(\", \")}) names \"${name}\" as its index`;\n\tconst meta = {\n\t\treason: FOREIGN_KEY_INDEX_UNRESOLVED,\n\t\tnamespaceId,\n\t\ttableName,\n\t\tcolumns,\n\t\tindex: name\n\t};\n\tconst indexes = table.declaredIndexes.filter((candidate) => candidate.namedByUser && writtenName(candidate.index) === name || nameOf(candidate.index.naming) === name);\n\tconst keys = [...table.uniques.filter((unique) => unique.name === name), ...table.primaryKey?.name === name ? [table.primaryKey] : []];\n\tconst resolvedIndexes = [...new Map(indexes.map((index) => {\n\t\tconst resolved = table.resolve({\n\t\t\tkind: \"index\",\n\t\t\tindex\n\t\t});\n\t\treturn [JSON.stringify(resolved), {\n\t\t\tindex,\n\t\t\tresolved\n\t\t}];\n\t})).values()];\n\tconst matches = resolvedIndexes.length + keys.length;\n\tif (matches === 0) throw contractError(\"CONTRACT.ARGUMENT_INVALID\", `${subject}, but table \"${tableName}\" has no index, unique constraint or primary key with that name.`, {\n\t\tfix: `Declare an index, unique constraint or primary key named \"${name}\" on table \"${tableName}\", or drop the index argument so the foreign key gets its own backing index.`,\n\t\tmeta\n\t});\n\tif (matches > 1) throw contractError(\"CONTRACT.ARGUMENT_INVALID\", `${subject}, but table \"${tableName}\" has more than one index, unique constraint or primary key with that name.`, {\n\t\tfix: `Give the object the foreign key should use a name no other index, unique constraint or primary key of table \"${tableName}\" has, and name that on the relation.`,\n\t\tmeta\n\t});\n\tconst [match] = resolvedIndexes;\n\tconst key = keys[0];\n\tconst matchType = match?.index.index.type;\n\tconst typeEntry = matchType === void 0 ? void 0 : table.indexTypes?.get(matchType);\n\tif (typeEntry !== void 0 && rendersIndexBody(typeEntry)) throw contractError(\"CONTRACT.ARGUMENT_INVALID\", `${subject}, but it is a \"${typeEntry.type}\" index, a \"${accessMethodOf(typeEntry)}\" index whose key is rendered from its options rather than its columns, so it does not serve the foreign key's lookups.`, {\n\t\tfix: `Name an index, unique constraint or primary key whose first columns are (${columns.join(\", \")}), or drop the index argument so the foreign key gets its own backing index beside the \"${typeEntry.type}\" index.`,\n\t\tmeta\n\t});\n\tconst objectColumns = match !== void 0 ? match.index.index.columns : key?.columns;\n\tif (objectColumns === void 0 || !startsWithColumns(objectColumns, columns)) throw contractError(\"CONTRACT.ARGUMENT_INVALID\", `${subject}, but ${objectColumns === void 0 ? \"it indexes an expression, not the foreign key's columns\" : `its columns (${objectColumns.join(\", \")}) do not start with the foreign key's columns`}, so it does not serve the foreign key's lookups.`, {\n\t\tfix: `Name an index, unique constraint or primary key whose first columns are (${columns.join(\", \")}), or drop the index argument so the foreign key gets its own backing index.`,\n\t\tmeta\n\t});\n\tif (match !== void 0) return match.resolved;\n\treturn key === table.primaryKey ? { primaryKey: true } : { unique: objectColumns };\n}\nfunction resolveReplacement(backing, replacements) {\n\tlet current = backing;\n\twhile (current.kind === \"index\") {\n\t\tconst replacement = replacements.get(current.index);\n\t\tif (replacement === void 0) break;\n\t\tcurrent = replacement;\n\t}\n\treturn current;\n}\nfunction foreignKeyIndexOf(backing) {\n\tswitch (backing.kind) {\n\t\tcase \"index\": return { name: nameOf(backing.index.index.naming) };\n\t\tcase \"uniqueConstraint\": return { unique: backing.unique.columns };\n\t\tcase \"primaryKey\": return { primaryKey: true };\n\t}\n}\n//#endregion\nexport { FOREIGN_KEY_INDEX_UNRESOLVED, declaredBackingObjectName, declaredIndexesServeForeignKey, defaultForeignKeyIndex, derivedBackingIndexIsRedundant, leadingBackingObjectName, materializeForeignKeysAndIndexes };\n\n//# sourceMappingURL=foreign-key-materialization.mjs.map"],"mappings":";;;;;;;;;AASA,MAAM,wBAAwB;AAC9B,MAAM,wBAAwB;;;;AAI9B,SAAS,mBAAmB,OAAO;CAClC,MAAM,EAAE,WAAW,aAAa;CAChC,MAAM,+BAA+B,IAAI,IAAI;CAC7C,MAAM,QAAQ,IAAI,IAAI,MAAM,QAAQ,KAAK,cAAc,CAAC,WAAW,YAAY,UAAU,KAAK,CAAC,CAAC,CAAC;CACjG,MAAM,UAAU,cAAc;EAC7B,MAAM,OAAO,MAAM,IAAI,SAAS;EAChC,IAAI,SAAS,KAAK,GAAG,MAAM,IAAI,cAAc,4BAA4B;EACzE,OAAO;CACR;C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EAA4E,QAAQ,KAAK,IAAI,EAAE;EACpG;CACD,CAAC;CACD,IAAI,UAAU,KAAK,GAAG,OAAO,MAAM;CACnC,OAAO,QAAQ,MAAM,aAAa,EAAE,YAAY,KAAK,IAAI,EAAE,QAAQ,cAAc;AAClF;AACA,SAAS,mBAAmB,SAAS,cAAc;CAClD,IAAI,UAAU;CACd,OAAO,QAAQ,SAAS,SAAS;EAChC,MAAM,cAAc,aAAa,IAAI,QAAQ,KAAK;EAClD,IAAI,gBAAgB,KAAK,GAAG;EAC5B,UAAU;CACX;CACA,OAAO;AACR;AACA,SAAS,kBAAkB,SAAS;CACnC,QAAQ,QAAQ,MAAhB;EACC,KAAK,SAAS,OAAO,EAAE,MAAM,OAAO,QAAQ,MAAM,MAAM,MAAM,EAAE;EAChE,KAAK,oBAAoB,OAAO,EAAE,QAAQ,QAAQ,OAAO,QAAQ;EACjE,KAAK,cAAc,OAAO,EAAE,YAAY,KAAK;CAC9C;AACD"}
|
package/dist/{index-equivalence-DswCiq5l-Cp2V5nhL.mjs → index-equivalence-DswCiq5l-C6SAs-Yz.mjs}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { s as SqlIndexIR } from "./types-
|
|
1
|
+
import { s as SqlIndexIR } from "./types-egs_vme1-DRhYFwIT.mjs";
|
|
2
2
|
//#region ../../../2-sql/1-core/contract/dist/index-equivalence-DswCiq5l.mjs
|
|
3
3
|
/** The schema node the planner builds for an index the contract states, which is what it compares. */
|
|
4
4
|
function indexNodeOf(index) {
|
|
@@ -106,4 +106,4 @@ function leadingBackingObjectName(columns, table) {
|
|
|
106
106
|
//#endregion
|
|
107
107
|
export { sameColumns as a, leadingBackingObjectName as i, identicalIndexes as n, servingKey as o, indexNodeOf as r, startsWithColumns as s, derivedBackingIndexIsRedundant as t };
|
|
108
108
|
|
|
109
|
-
//# sourceMappingURL=index-equivalence-DswCiq5l-
|
|
109
|
+
//# sourceMappingURL=index-equivalence-DswCiq5l-C6SAs-Yz.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-equivalence-DswCiq5l-
|
|
1
|
+
{"version":3,"file":"index-equivalence-DswCiq5l-C6SAs-Yz.mjs","names":[],"sources":["../../../../2-sql/1-core/contract/dist/index-equivalence-DswCiq5l.mjs"],"sourcesContent":["import { SqlIndexIR } from \"@internal/sql-schema-ir/types\";\n//#region src/index-equivalence.ts\n/** The schema node the planner builds for an index the contract states, which is what it compares. */\nfunction indexNodeOf(index) {\n\treturn new SqlIndexIR({\n\t\t...index,\n\t\tannotations: void 0,\n\t\tdependsOn: void 0,\n\t\tpartial: index.where !== void 0\n\t});\n}\n/** Whether the planner sees two indexes as the same index apart from their names. */\nfunction identicalIndexes(a, b) {\n\treturn a.contentEquals(b, {\n\t\tcolumnPresence: \"matching\",\n\t\tbodies: \"verbatim\"\n\t});\n}\n/** The index the contract build derives to back a foreign key on `columns`, as the planner sees it. */\nfunction derivedBackingIndexNode(columns) {\n\treturn new SqlIndexIR({\n\t\tnaming: {\n\t\t\tkind: \"exact\",\n\t\t\tname: \"derived backing index\"\n\t\t},\n\t\tcolumns,\n\t\twhere: void 0,\n\t\tunique: false,\n\t\ttype: void 0,\n\t\toptions: void 0,\n\t\tannotations: void 0,\n\t\tdependsOn: void 0,\n\t\tpartial: false\n\t});\n}\nfunction sameColumns(a, b) {\n\treturn a.length === b.length && startsWithColumns(a, b);\n}\n/** Whether `columns` begins with `leading`, in order: an index or key on such columns serves lookups on `leading`. */\nfunction startsWithColumns(columns, leading) {\n\treturn leading.length <= columns.length && leading.every((column, position) => column === columns[position]);\n}\n/**\n* The key that serves every lookup of `index`, when `index` is a plain non-unique index: one the planner sees as identical to an index derived on its columns. A unique index serves only when it has no predicate.\n*/\nfunction servingKey(index, table) {\n\tconst { columns } = index;\n\tif (columns === void 0 || !identicalIndexes(index, derivedBackingIndexNode(columns))) return;\n\tif (table.primaryKey !== void 0 && sameColumns(table.primaryKey.columns, columns)) return {\n\t\tkind: \"primaryKey\",\n\t\tprimaryKey: table.primaryKey\n\t};\n\tconst unique = table.uniques.find((constraint) => sameColumns(constraint.columns, columns));\n\tif (unique !== void 0) return {\n\t\tkind: \"uniqueConstraint\",\n\t\tunique\n\t};\n\tconst uniqueIndex = table.indexes.find((candidate) => {\n\t\tconst node = table.nodeOf(candidate);\n\t\treturn node.unique && node.where === void 0 && node.columns !== void 0 && sameColumns(node.columns, columns);\n\t});\n\treturn uniqueIndex === void 0 ? void 0 : {\n\t\tkind: \"index\",\n\t\tindex: uniqueIndex\n\t};\n}\n/**\n* Whether the contract build would drop the backing index it derives for a foreign key on `columns`, because the table already has an identical index or a key serving its lookups. `contract infer` asks this of a live table to decide whether a relation needs `index: false`.\n*/\nfunction derivedBackingIndexIsRedundant(columns, table) {\n\tconst derived = derivedBackingIndexNode(columns);\n\treturn table.indexes.some((index) => identicalIndexes(table.nodeOf(index), derived)) || servingKey(derived, table) !== void 0;\n}\n/** Whether the planner sees `index` as a plain index: its columns, uniqueness and nothing else. */\nfunction isPlainIndexNode(index) {\n\tif (index.columns === void 0) return false;\n\treturn identicalIndexes(index, new SqlIndexIR({\n\t\tnaming: {\n\t\t\tkind: \"exact\",\n\t\t\tname: \"plain index\"\n\t\t},\n\t\tcolumns: index.columns,\n\t\twhere: void 0,\n\t\tunique: index.unique,\n\t\ttype: void 0,\n\t\toptions: void 0,\n\t\tannotations: void 0,\n\t\tdependsOn: void 0,\n\t\tpartial: false\n\t}));\n}\n/**\n* The name of an object of the table that serves lookups on `columns` although the build would keep a derived backing index beside it: a named primary key or unique constraint, or a plain index, whose first columns are `columns`. A source that derives no backing index of its own names it on the relation instead of writing `index: false`.\n*/\nfunction leadingBackingObjectName(columns, table) {\n\tconst { primaryKey } = table;\n\tif (primaryKey?.name !== void 0 && startsWithColumns(primaryKey.columns, columns)) return primaryKey.name;\n\tconst unique = table.uniques.find((constraint) => constraint.name !== void 0 && startsWithColumns(constraint.columns, columns));\n\tif (unique?.name !== void 0) return unique.name;\n\tconst index = table.indexes.find((candidate) => {\n\t\tconst node = table.nodeOf(candidate);\n\t\treturn node.columns !== void 0 && startsWithColumns(node.columns, columns) && isPlainIndexNode(node);\n\t});\n\treturn index === void 0 ? void 0 : table.nameOf(index);\n}\n//#endregion\nexport { sameColumns as a, leadingBackingObjectName as i, identicalIndexes as n, servingKey as o, indexNodeOf as r, startsWithColumns as s, derivedBackingIndexIsRedundant as t };\n\n//# sourceMappingURL=index-equivalence-DswCiq5l.mjs.map"],"mappings":";;;AAGA,SAAS,YAAY,OAAO;CAC3B,OAAO,IAAI,WAAW;EACrB,GAAG;EACH,aAAa,KAAK;EAClB,WAAW,KAAK;EAChB,SAAS,MAAM,UAAU,KAAK;CAC/B,CAAC;AACF;;AAEA,SAAS,iBAAiB,GAAG,GAAG;CAC/B,OAAO,EAAE,cAAc,GAAG;EACzB,gBAAgB;EAChB,QAAQ;CACT,CAAC;AACF;;AAEA,SAAS,wBAAwB,SAAS;CACzC,OAAO,IAAI,WAAW;EACrB,QAAQ;GACP,MAAM;GACN,MAAM;EACP;EACA;EACA,OAAO,KAAK;EACZ,QAAQ;EACR,MAAM,KAAK;EACX,SAAS,KAAK;EACd,aAAa,KAAK;EAClB,WAAW,KAAK;EAChB,SAAS;CACV,CAAC;AACF;AACA,SAAS,YAAY,GAAG,GAAG;CAC1B,OAAO,EAAE,WAAW,EAAE,UAAU,kBAAkB,GAAG,CAAC;AACvD;;AAEA,SAAS,kBAAkB,SAAS,SAAS;CAC5C,OAAO,QAAQ,UAAU,QAAQ,UAAU,QAAQ,OAAO,QAAQ,aAAa,WAAW,QAAQ,SAAS;AAC5G;;;;AAIA,SAAS,WAAW,OAAO,OAAO;CACjC,MAAM,EAAE,YAAY;CACpB,IAAI,YAAY,KAAK,KAAK,CAAC,iBAAiB,OAAO,wBAAwB,OAAO,CAAC,GAAG;CACtF,IAAI,MAAM,eAAe,KAAK,KAAK,YAAY,MAAM,WAAW,SAAS,OAAO,GAAG,OAAO;EACzF,MAAM;EACN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QAAQ,MAAM,cAAc;EAC/C,MAAM,OAAO,MAAM,OAAO,SAAS;EACnC,OAAO,KAAK,YAAY,KAAK,KAAK,kBAAkB,KAAK,SAAS,OAAO,KAAK,iBAAiB,IAAI;CACpG,CAAC;CACD,OAAO,UAAU,KAAK,IAAI,KAAK,IAAI,MAAM,OAAO,KAAK;AACtD"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { n as isAuthoredIndexInput } from "./index-naming-BOcJT1B3-18gQUduD.mjs";
|
|
2
2
|
import { n as providesPslEntityPlacement } from "./entity-handle-lowering-hook-B3atrRKX.mjs";
|
|
3
|
-
import "./foreign-key-materialization-
|
|
3
|
+
import "./foreign-key-materialization-C_FPLzj3.mjs";
|
|
4
4
|
import { p as sqlTextFromStored } from "./sql-expression-BJCuy-WI.mjs";
|
|
5
5
|
import { d as resolvedTypeParams, t as CODEC_INSTANCE_KIND } from "./types-M_FeBD9w.mjs";
|
|
6
6
|
import { t as deriveValueSetFromEntity } from "./value-set-derivation-hook-Di9JZ0X7.mjs";
|
|
7
|
-
import { n as buildSqlContractFromDefinition } from "./derived-checks-sRZp_gTF-
|
|
7
|
+
import { n as buildSqlContractFromDefinition } from "./derived-checks-sRZp_gTF-ermwhVGQ.mjs";
|
|
8
8
|
import { i as mapFieldNamesToColumns, n as getAttribute, o as storageName, r as getNamedArgument, t as formatDbAttributeMigrationMessage } from "./psl-attribute-parsing-BCsFWsSp-LaNsbcrw.mjs";
|
|
9
|
-
import { _ as resolveFieldTypeDescriptor, d as interpretModelAttribute, f as modelAttributeSpecsFrom, g as readWrittenNumberForCodec, i as contractError, l as instantiatePslTypeConstructor, m as modelSpecContext, n as bareTypeConstructorOf, o as fieldSpecContext, p as modelCoordinateKey, r as collectResolvedFields, s as getAuthoringEntity, t as PSL_CHECK_ON_STI_VARIANT, u as interpretFieldAttribute, v as sqlAttributeSpecs, y as toNamedTypeFieldDescriptor } from "./psl-field-resolution-
|
|
9
|
+
import { _ as resolveFieldTypeDescriptor, d as interpretModelAttribute, f as modelAttributeSpecsFrom, g as readWrittenNumberForCodec, i as contractError, l as instantiatePslTypeConstructor, m as modelSpecContext, n as bareTypeConstructorOf, o as fieldSpecContext, p as modelCoordinateKey, r as collectResolvedFields, s as getAuthoringEntity, t as PSL_CHECK_ON_STI_VARIANT, u as interpretFieldAttribute, v as sqlAttributeSpecs, y as toNamedTypeFieldDescriptor } from "./psl-field-resolution-C1E-_fQq-VUYD8cnS.mjs";
|
|
10
10
|
import { t as defaultTableName } from "./default-table-name-BfFY8qYR-lHNcVmY5.mjs";
|
|
11
11
|
import { isStructuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
12
12
|
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
@@ -21,7 +21,7 @@ import { assertDefined, invariant } from "@prisma/orm-framework/utils/assertions
|
|
|
21
21
|
import { notOk, ok } from "@prisma/orm-framework/utils/result";
|
|
22
22
|
import { contributedTypeOf, createPslDiagnosticCollector, diagnosticSource, findBlockDescriptor, interpretExtensionBlocks, nodePslSpan, typeReferenceNode } from "@prisma/orm-framework/psl-parser";
|
|
23
23
|
import { claimedBlockKeywords, enumMemberAttributeDiagnostics, fkRelationPairKey, requiredOneToOneBackrelationDiagnostic, unsupportedBlockDiagnostic } from "@prisma/orm-framework/psl-parser/interpret";
|
|
24
|
-
//#region ../../../2-sql/2-authoring/contract-psl/dist/interpreter-
|
|
24
|
+
//#region ../../../2-sql/2-authoring/contract-psl/dist/interpreter-kQuqdyeP.mjs
|
|
25
25
|
function baseColumnDescriptor(resolution, enumTypeDescriptors) {
|
|
26
26
|
if (resolution?.kind === "block") return enumTypeDescriptors.get(resolution.symbol);
|
|
27
27
|
const scalar = bareTypeConstructorOf(resolution);
|
|
@@ -2174,4 +2174,4 @@ function interpretPslDocumentToSqlContract(input) {
|
|
|
2174
2174
|
//#endregion
|
|
2175
2175
|
export { normalizeReferentialAction as a, interpretPslDocumentToSqlContract as i, buildEntityTypesByDiscriminator as n, indexFkRelations as r, applyBackrelationCandidates as t };
|
|
2176
2176
|
|
|
2177
|
-
//# sourceMappingURL=interpreter-
|
|
2177
|
+
//# sourceMappingURL=interpreter-kQuqdyeP-B-rzJDWE.mjs.map
|