@prisma-next/family-sql 0.15.0-dev.2 → 0.15.0-dev.21
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/control.d.mts +124 -1
- package/dist/control.d.mts.map +1 -1
- package/dist/control.mjs +70 -18
- package/dist/control.mjs.map +1 -1
- package/dist/diff.mjs +1 -1
- package/dist/psl-infer.d.mts.map +1 -1
- package/dist/psl-infer.mjs +2 -3
- package/dist/psl-infer.mjs.map +1 -1
- package/dist/runtime.mjs +1 -1
- package/dist/{schema-verify-W3r631Jh.mjs → schema-verify-3sOPsdn_.mjs} +7 -7
- package/dist/schema-verify-3sOPsdn_.mjs.map +1 -0
- package/dist/{timestamp-now-generator-CloimujU.mjs → timestamp-now-generator-DRXygu32.mjs} +88 -2
- package/dist/timestamp-now-generator-DRXygu32.mjs.map +1 -0
- package/package.json +24 -22
- package/src/core/diff/schema-verify.ts +4 -4
- package/src/core/diff/verifier-disposition.ts +3 -3
- package/src/core/migrations/contract-to-schema-ir.ts +95 -10
- package/src/core/psl-contract-infer/name-transforms.ts +3 -13
- package/src/core/timestamp-now-generator.ts +88 -0
- package/src/exports/control.ts +3 -0
- package/dist/schema-verify-W3r631Jh.mjs.map +0 -1
- package/dist/timestamp-now-generator-CloimujU.mjs.map +0 -1
package/dist/control.d.mts
CHANGED
|
@@ -489,6 +489,16 @@ type NativeTypeExpander = (input: {
|
|
|
489
489
|
* `contractToSchemaIR`, keeping the family layer target-agnostic.
|
|
490
490
|
*/
|
|
491
491
|
type DefaultRenderer = (def: ColumnDefault, column: StorageColumn) => string;
|
|
492
|
+
/**
|
|
493
|
+
* Target-supplied hook (same IoC seam as `NativeTypeExpander`/`DefaultRenderer`)
|
|
494
|
+
* that normalizes a contract-declared `ColumnDefault` into the resolved shape
|
|
495
|
+
* the target's introspection parses from the live database — e.g. a
|
|
496
|
+
* `dbgenerated("'{}'::jsonb")` function call and the literal Postgres reports
|
|
497
|
+
* are the same value in different shapes, and `resolvedDefaultsEqual`
|
|
498
|
+
* compares `kind` before content. When omitted, the contract's raw default
|
|
499
|
+
* is the resolved default unchanged.
|
|
500
|
+
*/
|
|
501
|
+
type DefaultResolver = (def: ColumnDefault, resolvedNativeType: string) => ColumnDefault;
|
|
492
502
|
/**
|
|
493
503
|
* Target-supplied callback that resolves a contract namespace to the live
|
|
494
504
|
* database schema its enums are stored under.
|
|
@@ -521,6 +531,7 @@ interface ContractToSchemaIROptions {
|
|
|
521
531
|
readonly annotationNamespace: string;
|
|
522
532
|
readonly expandNativeType?: NativeTypeExpander;
|
|
523
533
|
readonly renderDefault?: DefaultRenderer;
|
|
534
|
+
readonly resolveDefault?: DefaultResolver;
|
|
524
535
|
/**
|
|
525
536
|
* Target-supplied resolver mapping a namespace to the live database schema
|
|
526
537
|
* its enums are stored under. When provided (Postgres), namespace-scoped
|
|
@@ -805,9 +816,121 @@ declare function temporalAuthoringPresets<const CodecId extends string, const Na
|
|
|
805
816
|
};
|
|
806
817
|
};
|
|
807
818
|
};
|
|
819
|
+
/**
|
|
820
|
+
* Builds a `temporal.<codec>` field preset for a codec that takes a precision
|
|
821
|
+
* parameter (`pg/timestamp@1`, `pg/timestamptz@1`). Arguments change field
|
|
822
|
+
* properties only — never the codec, which the caller fixes here.
|
|
823
|
+
*
|
|
824
|
+
* All three arguments are optional: omitting `precision` omits `typeParams`
|
|
825
|
+
* entirely, and omitting a phase omits that phase (both omitted omits
|
|
826
|
+
* `executionDefaults`).
|
|
827
|
+
*/
|
|
828
|
+
declare function temporalCodecPresetWithPrecision<const CodecId extends string, const NativeType extends string>(input: {
|
|
829
|
+
readonly codecId: CodecId;
|
|
830
|
+
readonly nativeType: NativeType;
|
|
831
|
+
}): {
|
|
832
|
+
readonly kind: "fieldPreset";
|
|
833
|
+
readonly args: readonly [{
|
|
834
|
+
readonly name: "precision";
|
|
835
|
+
readonly kind: "number";
|
|
836
|
+
readonly optional: true;
|
|
837
|
+
readonly integer: true;
|
|
838
|
+
readonly minimum: 0;
|
|
839
|
+
}, {
|
|
840
|
+
readonly name: "onCreate";
|
|
841
|
+
readonly kind: "option";
|
|
842
|
+
readonly values: readonly ["now"];
|
|
843
|
+
readonly optional: true;
|
|
844
|
+
}, {
|
|
845
|
+
readonly name: "onUpdate";
|
|
846
|
+
readonly kind: "option";
|
|
847
|
+
readonly values: readonly ["now"];
|
|
848
|
+
readonly optional: true;
|
|
849
|
+
}];
|
|
850
|
+
readonly output: {
|
|
851
|
+
readonly codecId: CodecId;
|
|
852
|
+
readonly nativeType: NativeType;
|
|
853
|
+
readonly typeParams: {
|
|
854
|
+
readonly precision: {
|
|
855
|
+
readonly kind: "arg";
|
|
856
|
+
readonly index: 0;
|
|
857
|
+
};
|
|
858
|
+
};
|
|
859
|
+
readonly executionDefaults: {
|
|
860
|
+
readonly onCreate: {
|
|
861
|
+
readonly kind: "select";
|
|
862
|
+
readonly index: 1;
|
|
863
|
+
readonly cases: {
|
|
864
|
+
readonly now: {
|
|
865
|
+
readonly kind: "generator";
|
|
866
|
+
readonly id: "timestampNow";
|
|
867
|
+
};
|
|
868
|
+
};
|
|
869
|
+
};
|
|
870
|
+
readonly onUpdate: {
|
|
871
|
+
readonly kind: "select";
|
|
872
|
+
readonly index: 2;
|
|
873
|
+
readonly cases: {
|
|
874
|
+
readonly now: {
|
|
875
|
+
readonly kind: "generator";
|
|
876
|
+
readonly id: "timestampNow";
|
|
877
|
+
};
|
|
878
|
+
};
|
|
879
|
+
};
|
|
880
|
+
};
|
|
881
|
+
};
|
|
882
|
+
};
|
|
883
|
+
/**
|
|
884
|
+
* Builds a `temporal.<codec>` field preset for a codec with no type
|
|
885
|
+
* parameters (`sqlite/datetime@1`). As with the precision-bearing variant,
|
|
886
|
+
* both phase arguments are optional and omitting one omits that phase.
|
|
887
|
+
*/
|
|
888
|
+
declare function temporalCodecPreset<const CodecId extends string, const NativeType extends string>(input: {
|
|
889
|
+
readonly codecId: CodecId;
|
|
890
|
+
readonly nativeType: NativeType;
|
|
891
|
+
}): {
|
|
892
|
+
readonly kind: "fieldPreset";
|
|
893
|
+
readonly args: readonly [{
|
|
894
|
+
readonly name: "onCreate";
|
|
895
|
+
readonly kind: "option";
|
|
896
|
+
readonly values: readonly ["now"];
|
|
897
|
+
readonly optional: true;
|
|
898
|
+
}, {
|
|
899
|
+
readonly name: "onUpdate";
|
|
900
|
+
readonly kind: "option";
|
|
901
|
+
readonly values: readonly ["now"];
|
|
902
|
+
readonly optional: true;
|
|
903
|
+
}];
|
|
904
|
+
readonly output: {
|
|
905
|
+
readonly codecId: CodecId;
|
|
906
|
+
readonly nativeType: NativeType;
|
|
907
|
+
readonly executionDefaults: {
|
|
908
|
+
readonly onCreate: {
|
|
909
|
+
readonly kind: "select";
|
|
910
|
+
readonly index: 0;
|
|
911
|
+
readonly cases: {
|
|
912
|
+
readonly now: {
|
|
913
|
+
readonly kind: "generator";
|
|
914
|
+
readonly id: "timestampNow";
|
|
915
|
+
};
|
|
916
|
+
};
|
|
917
|
+
};
|
|
918
|
+
readonly onUpdate: {
|
|
919
|
+
readonly kind: "select";
|
|
920
|
+
readonly index: 1;
|
|
921
|
+
readonly cases: {
|
|
922
|
+
readonly now: {
|
|
923
|
+
readonly kind: "generator";
|
|
924
|
+
readonly id: "timestampNow";
|
|
925
|
+
};
|
|
926
|
+
};
|
|
927
|
+
};
|
|
928
|
+
};
|
|
929
|
+
};
|
|
930
|
+
};
|
|
808
931
|
//#endregion
|
|
809
932
|
//#region src/exports/control.d.ts
|
|
810
933
|
declare const _default: SqlFamilyDescriptor;
|
|
811
934
|
//#endregion
|
|
812
|
-
export { type CodecControlHooks, type ContractToSchemaIROptions, type ControlPolicySubject, type CreateSqlMigrationPlanOptions, type DefaultRenderer, type EnumNamespaceSchemaResolver, type ExpandNativeTypeInput, type FieldEvent, type FieldEventContext, INIT_ADDITIVE_POLICY, type MigrationOperationClass, type MigrationOperationPolicy, type MigrationPlan, type MigrationPlanOperation, type MigrationPlanner, type MigrationPlannerConflict, type MigrationPlannerResult, type NativeTypeExpander, type PlanFieldEventOperationsOptions, type ResolveIdentityValueInput, 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 SqlSchemaDiffFn, type SqlSchemaDiffInput, type SqlSchemaDiffResult, type StorageTypePlanResult, type SuppressionRecord, type TargetMigrationsCapability, assembleAuthoringContributions, buildNativeTypeExpander, contractNamespaceToSchemaIR, contractToSchemaIR, controlPolicyForCall, createMigrationPlan, _default as default, detectDestructiveChanges, extractCodecControlHooks, partitionCallsByControlPolicy, partitionIssuesByControlPolicy, planFieldEventOperations, plannerFailure, plannerSuccess, resolveValueSetValues, runnerFailure, runnerSuccess, temporalAuthoringPresets, timestampNowControlDescriptor };
|
|
935
|
+
export { type CodecControlHooks, type ContractToSchemaIROptions, type ControlPolicySubject, type CreateSqlMigrationPlanOptions, type DefaultRenderer, type DefaultResolver, type EnumNamespaceSchemaResolver, type ExpandNativeTypeInput, type FieldEvent, type FieldEventContext, INIT_ADDITIVE_POLICY, type MigrationOperationClass, type MigrationOperationPolicy, type MigrationPlan, type MigrationPlanOperation, type MigrationPlanner, type MigrationPlannerConflict, type MigrationPlannerResult, type NativeTypeExpander, type PlanFieldEventOperationsOptions, type ResolveIdentityValueInput, 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 SqlSchemaDiffFn, type SqlSchemaDiffInput, type SqlSchemaDiffResult, type StorageTypePlanResult, type SuppressionRecord, type TargetMigrationsCapability, assembleAuthoringContributions, buildNativeTypeExpander, contractNamespaceToSchemaIR, contractToSchemaIR, controlPolicyForCall, createMigrationPlan, _default as default, detectDestructiveChanges, extractCodecControlHooks, partitionCallsByControlPolicy, partitionIssuesByControlPolicy, planFieldEventOperations, plannerFailure, plannerSuccess, resolveValueSetValues, runnerFailure, runnerSuccess, temporalAuthoringPresets, temporalCodecPreset, temporalCodecPresetWithPrecision, timestampNowControlDescriptor };
|
|
813
936
|
//# sourceMappingURL=control.d.mts.map
|
package/dist/control.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control.d.mts","names":[],"sources":["../src/core/control-instance.ts","../src/core/control-descriptor.ts","../src/core/assembly.ts","../src/core/control-target-descriptor.ts","../src/core/migrations/contract-to-schema-ir.ts","../src/core/migrations/control-policy.ts","../src/core/migrations/field-event-planner.ts","../src/core/migrations/native-type-expander.ts","../src/core/migrations/plan-helpers.ts","../src/core/migrations/policies.ts","../src/core/timestamp-now-generator.ts","../src/exports/control.ts"],"mappings":";;;;;;;;;;;;;;;UAwLU,eAAA;E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,EAAO,YAAA,QAAoB,SAAA,IAC1B,wBAAA;AAAA;;;iBCNW,wBAAA,CACd,WAAA,EAAa,aAAA,CAAc,8BAAA,mBAC1B,GAAA,SAAY,iBAAA;;;;;;;;AFoBqE;;;;;UGlBnE,yBAAA;EAAA,SACN,OAAA;EAAA,SACA,QAAA,EAAU,QAAQ,CAAC,UAAA;AAAA;AAAA,UAGb,0BAAA,6DAGG,QAAA,CAAS,UAAA,IAAc,QAAA,CAAS,UAAA,WAC1C,0BAAA,QAAkC,SAAA,EAAW,wBAAA;EAAA,SAC5C,eAAA,SAAwB,uBAAA;EH2JP;;;AAA8B;AAAA;;EAA9B,SGpJjB,kBAAA,EAAoB,kBAAA,CAAmB,SAAA;EHuJP;;;;;;EAAA,SGhJhC,cAAA,EAAgB,cAAA,CAAe,SAAA,EAAW,WAAA;EHgJxB;;;;;;;AAE2B;AAGxD;EAL6B,SGtIlB,gBAAA,IACP,MAAA,EAAQ,eAAA,EACR,kBAAA,YAA8B,yBAAA,OAC3B,cAAA;;;;;;;;WAQI,UAAA,EAAY,eAAA;EHmKF;;;;;;;;;;EAAA,SGxJV,0BAAA,GAA6B,QAAA,aAAqB,sBAAA;EH2L/C;;;;;;;;;;;EAAA,SG/KH,kBAAA,GAAqB,QAAA;EAC9B,aAAA,CAAc,OAAA,EAAS,iBAAA,CAAkB,SAAA,IAAa,mBAAA,CAAoB,cAAA;EAC1E,YAAA,CAAa,MAAA,EAAQ,wBAAA,GAA2B,kBAAA,CAAmB,cAAA;AAAA;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"control.d.mts","names":[],"sources":["../src/core/control-instance.ts","../src/core/control-descriptor.ts","../src/core/assembly.ts","../src/core/control-target-descriptor.ts","../src/core/migrations/contract-to-schema-ir.ts","../src/core/migrations/control-policy.ts","../src/core/migrations/field-event-planner.ts","../src/core/migrations/native-type-expander.ts","../src/core/migrations/plan-helpers.ts","../src/core/migrations/policies.ts","../src/core/timestamp-now-generator.ts","../src/exports/control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,KAAuB,uBAAuB;;;;iBAoBjF,aAAA,CAAc,KAAA;EAC5B,iBAAA;EACA,kBAAA;AAAA,IACE,EAAE,CAAC,8BAAA;;;;iBAYS,aAAA,CACd,IAAA,EAAM,2BAAA,EACN,OAAA,UACA,OAAA;EAAY,GAAA;EAAc,IAAA,GAAO,SAAA;AAAA,IAChC,KAAA,CAAM,yBAAA;;;;;;cC1KI,oBAAA,EAAsB,0BAEjC;;;;;ATqCkF;;;;;;;;;iBUjBpE,6BAAA,IAAiC,kCAAkC;AViK9D;;;;AAGqC;AAAA;;;;;AAHrC,iBU5IL,wBAAA,gEAGd,KAAA;EAAA,SAAkB,OAAA,EAAS,OAAA;EAAA,SAAkB,UAAA,EAAY,UAAA;AAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAsE3C,gCAAA,gEAGd,KAAA;EAAA,SAAkB,OAAA,EAAS,OAAA;EAAA,SAAkB,UAAA,EAAY,UAAA;AAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAsB3C,mBAAA,gEAGd,KAAA;EAAA,SAAkB,OAAA,EAAS,OAAA;EAAA,SAAkB,UAAA,EAAY,UAAA;AAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCxDlB,QAAA"}
|
package/dist/control.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { i as sqlFamilyPslBlockDescriptors, n as sqlFamilyAuthoringFieldPresets, r as sqlFamilyEntityTypes, t as sqlFamilyAuthoringTypes } from "./authoring-type-constructors-CXd-8ydc.mjs";
|
|
2
|
-
import { n as classifyDiffSubjectGranularity, o as verifySqlSchemaByDiff, s as extractCodecControlHooks, t as classifyDiffEntityKind } from "./schema-verify-
|
|
2
|
+
import { n as classifyDiffSubjectGranularity, o as verifySqlSchemaByDiff, s as extractCodecControlHooks, t as classifyDiffEntityKind } from "./schema-verify-3sOPsdn_.mjs";
|
|
3
3
|
import { t as SqlContractSerializer } from "./sql-contract-serializer-C75cfMSS.mjs";
|
|
4
4
|
import { t as collectSupportedCodecTypeIds } from "./verify-C-G0obRm.mjs";
|
|
5
|
-
import { n as temporalAuthoringPresets, r as
|
|
5
|
+
import { a as timestampNowControlDescriptor, i as temporalCodecPresetWithPrecision, n as temporalAuthoringPresets, r as temporalCodecPreset } from "./timestamp-now-generator-DRXygu32.mjs";
|
|
6
6
|
import { sqlEmission } from "@prisma-next/sql-contract-emitter";
|
|
7
7
|
import { blindCast } from "@prisma-next/utils/casts";
|
|
8
8
|
import { APP_SPACE_ID, SchemaTreeNode, VERIFY_CODE_HASH_MISMATCH, VERIFY_CODE_MARKER_MISSING, VERIFY_CODE_TARGET_MISMATCH, assembleAuthoringContributions } from "@prisma-next/framework-components/control";
|
|
@@ -13,7 +13,7 @@ import { defaultIndexName } from "@prisma-next/sql-schema-ir/naming";
|
|
|
13
13
|
import { ifDefined } from "@prisma-next/utils/defined";
|
|
14
14
|
import { effectiveControlPolicy } from "@prisma-next/contract/types";
|
|
15
15
|
import { StorageTable, isStorageTypeInstance } from "@prisma-next/sql-contract/types";
|
|
16
|
-
import { SqlSchemaIR, SqlTableIR } from "@prisma-next/sql-schema-ir/types";
|
|
16
|
+
import { RelationalSchemaNodeKind, SqlSchemaIR, SqlTableIR } from "@prisma-next/sql-schema-ir/types";
|
|
17
17
|
import { notOk, ok } from "@prisma-next/utils/result";
|
|
18
18
|
//#region src/core/operation-preview.ts
|
|
19
19
|
function isDdlStatement(sqlStatement) {
|
|
@@ -575,7 +575,7 @@ var SqlFamilyDescriptor = class {
|
|
|
575
575
|
};
|
|
576
576
|
//#endregion
|
|
577
577
|
//#region src/core/migrations/contract-to-schema-ir.ts
|
|
578
|
-
function convertColumn(name, column, storageTypes, expandNativeType, renderDefault) {
|
|
578
|
+
function convertColumn(name, column, storageTypes, expandNativeType, renderDefault, resolveDefault) {
|
|
579
579
|
const resolved = resolveColumnTypeMetadata(column, storageTypes);
|
|
580
580
|
const baseNativeType = expandNativeType ? expandNativeType({
|
|
581
581
|
nativeType: resolved.nativeType,
|
|
@@ -584,6 +584,8 @@ function convertColumn(name, column, storageTypes, expandNativeType, renderDefau
|
|
|
584
584
|
}) : resolved.nativeType;
|
|
585
585
|
const nativeType = baseNativeType;
|
|
586
586
|
const resolvedNativeType = column.many ? `${baseNativeType}[]` : baseNativeType;
|
|
587
|
+
const rawColumnDefault = column.default ?? void 0;
|
|
588
|
+
const resolvedColumnDefault = rawColumnDefault !== void 0 && resolveDefault ? resolveDefault(rawColumnDefault, resolvedNativeType) : rawColumnDefault;
|
|
587
589
|
return {
|
|
588
590
|
name,
|
|
589
591
|
nativeType,
|
|
@@ -591,7 +593,7 @@ function convertColumn(name, column, storageTypes, expandNativeType, renderDefau
|
|
|
591
593
|
...ifDefined("many", column.many),
|
|
592
594
|
...ifDefined("default", column.default != null && renderDefault ? renderDefault(column.default, column) : void 0),
|
|
593
595
|
resolvedNativeType,
|
|
594
|
-
...ifDefined("resolvedDefault",
|
|
596
|
+
...ifDefined("resolvedDefault", resolvedColumnDefault),
|
|
595
597
|
codecRef: buildColumnCodecRef(resolved, column.many),
|
|
596
598
|
codecBaseNativeType: resolved.nativeType,
|
|
597
599
|
...column.typeRef !== void 0 ? { codecNamedType: true } : {}
|
|
@@ -663,22 +665,63 @@ function convertCheck(check, storage) {
|
|
|
663
665
|
permittedValues
|
|
664
666
|
};
|
|
665
667
|
}
|
|
666
|
-
function convertUnique(unique) {
|
|
668
|
+
function convertUnique(unique, tableName) {
|
|
667
669
|
return {
|
|
668
670
|
columns: unique.columns,
|
|
669
|
-
...ifDefined("name", unique.name)
|
|
671
|
+
...ifDefined("name", unique.name),
|
|
672
|
+
dependsOn: flatColumnDependsOn(tableName, unique.columns)
|
|
670
673
|
};
|
|
671
674
|
}
|
|
672
|
-
function convertIndex(index) {
|
|
675
|
+
function convertIndex(index, tableName) {
|
|
673
676
|
return {
|
|
674
677
|
columns: index.columns,
|
|
675
678
|
unique: false,
|
|
676
679
|
...ifDefined("name", index.name),
|
|
677
680
|
...ifDefined("type", index.type),
|
|
678
|
-
...ifDefined("options", index.options)
|
|
681
|
+
...ifDefined("options", index.options),
|
|
682
|
+
dependsOn: flatColumnDependsOn(tableName, index.columns)
|
|
679
683
|
};
|
|
680
684
|
}
|
|
681
685
|
/**
|
|
686
|
+
* The referenced table's chain in the flat (single-schema) tree
|
|
687
|
+
* `contractToSchemaIR`/`contractNamespaceToSchemaIR` build: the root
|
|
688
|
+
* (`SqlSchemaIR`, fixed `'database'` id) followed by the table's own id.
|
|
689
|
+
* Postgres discards this when it re-derives the FK against its own
|
|
690
|
+
* multi-schema tree shape (`contractToPostgresDatabaseSchemaNode`); SQLite's
|
|
691
|
+
* flat tree uses it as-is.
|
|
692
|
+
*/
|
|
693
|
+
function flatSchemaDependsOn(tableName) {
|
|
694
|
+
return [{
|
|
695
|
+
nodeKind: RelationalSchemaNodeKind.schema,
|
|
696
|
+
id: "database"
|
|
697
|
+
}, {
|
|
698
|
+
nodeKind: RelationalSchemaNodeKind.table,
|
|
699
|
+
id: tableName
|
|
700
|
+
}];
|
|
701
|
+
}
|
|
702
|
+
/**
|
|
703
|
+
* The chains from a table-child object (foreign key, index, unique, primary
|
|
704
|
+
* key) to each of the own columns it is built on, in the flat tree. Dropping
|
|
705
|
+
* a covered column auto-drops the object, so the object's drop must precede
|
|
706
|
+
* the column's; the graph derives that direction from these edges.
|
|
707
|
+
*/
|
|
708
|
+
function flatColumnDependsOn(tableName, columns) {
|
|
709
|
+
return columns.map((column) => [
|
|
710
|
+
{
|
|
711
|
+
nodeKind: RelationalSchemaNodeKind.schema,
|
|
712
|
+
id: "database"
|
|
713
|
+
},
|
|
714
|
+
{
|
|
715
|
+
nodeKind: RelationalSchemaNodeKind.table,
|
|
716
|
+
id: tableName
|
|
717
|
+
},
|
|
718
|
+
{
|
|
719
|
+
nodeKind: RelationalSchemaNodeKind.column,
|
|
720
|
+
id: `column:${column}`
|
|
721
|
+
}
|
|
722
|
+
]);
|
|
723
|
+
}
|
|
724
|
+
/**
|
|
682
725
|
* The FK's referenced-namespace identity comes from the target's namespace
|
|
683
726
|
* node, not the raw namespace-id string. An unbound target namespace stamps
|
|
684
727
|
* no `referencedSchema` at all — the FK node's id renders the absence as the
|
|
@@ -687,6 +730,10 @@ function convertIndex(index) {
|
|
|
687
730
|
* cross-space target whose namespace lives in another contract's storage)
|
|
688
731
|
* stamps its coordinate verbatim; namespaced targets (Postgres) resolve the
|
|
689
732
|
* real DDL schema downstream.
|
|
733
|
+
*
|
|
734
|
+
* `dependsOn` carries the referenced table (created before the FK, dropped
|
|
735
|
+
* after it) plus the FK's own columns (dropped after the FK, since dropping a
|
|
736
|
+
* column auto-drops the FK built on it).
|
|
690
737
|
*/
|
|
691
738
|
function convertForeignKey(fk, storage) {
|
|
692
739
|
const targetIsUnbound = storage.namespaces[fk.target.namespaceId]?.isUnbound === true;
|
|
@@ -697,20 +744,25 @@ function convertForeignKey(fk, storage) {
|
|
|
697
744
|
referencedColumns: fk.target.columns,
|
|
698
745
|
...ifDefined("name", fk.name),
|
|
699
746
|
...ifDefined("onDelete", fk.onDelete),
|
|
700
|
-
...ifDefined("onUpdate", fk.onUpdate)
|
|
747
|
+
...ifDefined("onUpdate", fk.onUpdate),
|
|
748
|
+
dependsOn: [flatSchemaDependsOn(fk.target.tableName), ...flatColumnDependsOn(fk.source.tableName, fk.source.columns)]
|
|
701
749
|
};
|
|
702
750
|
}
|
|
703
|
-
function convertTable(name, table, storageTypes, expandNativeType, renderDefault, storage) {
|
|
751
|
+
function convertTable(name, table, storageTypes, expandNativeType, renderDefault, resolveDefault, storage) {
|
|
704
752
|
const columns = {};
|
|
705
|
-
for (const [colName, colDef] of Object.entries(table.columns)) columns[colName] = convertColumn(colName, colDef, storageTypes, expandNativeType, renderDefault);
|
|
753
|
+
for (const [colName, colDef] of Object.entries(table.columns)) columns[colName] = convertColumn(colName, colDef, storageTypes, expandNativeType, renderDefault, resolveDefault);
|
|
706
754
|
const checks = table.checks && table.checks.length > 0 ? table.checks.map((c) => convertCheck(c, storage)) : void 0;
|
|
707
755
|
return new SqlTableIR({
|
|
708
756
|
name,
|
|
709
757
|
columns,
|
|
710
|
-
...ifDefined("primaryKey", table.primaryKey
|
|
758
|
+
...ifDefined("primaryKey", table.primaryKey !== void 0 ? {
|
|
759
|
+
columns: table.primaryKey.columns,
|
|
760
|
+
...ifDefined("name", table.primaryKey.name),
|
|
761
|
+
dependsOn: flatColumnDependsOn(name, table.primaryKey.columns)
|
|
762
|
+
} : void 0),
|
|
711
763
|
foreignKeys: table.foreignKeys.map((fk) => convertForeignKey(fk, storage)),
|
|
712
|
-
uniques: table.uniques.map(convertUnique),
|
|
713
|
-
indexes: table.indexes.map(convertIndex),
|
|
764
|
+
uniques: table.uniques.map((u) => convertUnique(u, name)),
|
|
765
|
+
indexes: table.indexes.map((i) => convertIndex(i, name)),
|
|
714
766
|
...ifDefined("checks", checks)
|
|
715
767
|
});
|
|
716
768
|
}
|
|
@@ -790,7 +842,7 @@ function contractNamespaceToSchemaIR(storage, namespaceId, options) {
|
|
|
790
842
|
const tables = {};
|
|
791
843
|
for (const [tableName, tableDefRaw] of Object.entries(namespace.entries.table ?? {})) {
|
|
792
844
|
StorageTable.assert(tableDefRaw, `namespaces.${namespaceId}.entries.table.${tableName}`);
|
|
793
|
-
tables[tableName] = convertTable(tableName, tableDefRaw, storageTypes, options.expandNativeType, options.renderDefault, storage);
|
|
845
|
+
tables[tableName] = convertTable(tableName, tableDefRaw, storageTypes, options.expandNativeType, options.renderDefault, options.resolveDefault, storage);
|
|
794
846
|
}
|
|
795
847
|
return new SqlSchemaIR({ tables });
|
|
796
848
|
}
|
|
@@ -804,7 +856,7 @@ function contractToSchemaIR(contract, options) {
|
|
|
804
856
|
StorageTable.assert(tableDefRaw, `namespaces.${ns.id}.entries.table.${tableName}`);
|
|
805
857
|
const tableDef = tableDefRaw;
|
|
806
858
|
if (tables[tableName] !== void 0) throw new Error(`contractToSchemaIR: duplicate SQL table name "${tableName}" across namespaces (ambiguous for flat SqlSchemaIR.tables).`);
|
|
807
|
-
tables[tableName] = convertTable(tableName, tableDef, storageTypes, options.expandNativeType, options.renderDefault, storage);
|
|
859
|
+
tables[tableName] = convertTable(tableName, tableDef, storageTypes, options.expandNativeType, options.renderDefault, options.resolveDefault, storage);
|
|
808
860
|
}
|
|
809
861
|
return new SqlSchemaIR({
|
|
810
862
|
tables,
|
|
@@ -1212,6 +1264,6 @@ const INIT_ADDITIVE_POLICY = Object.freeze({ allowedOperationClasses: Object.fre
|
|
|
1212
1264
|
//#region src/exports/control.ts
|
|
1213
1265
|
var control_default = new SqlFamilyDescriptor();
|
|
1214
1266
|
//#endregion
|
|
1215
|
-
export { INIT_ADDITIVE_POLICY, assembleAuthoringContributions, buildNativeTypeExpander, contractNamespaceToSchemaIR, contractToSchemaIR, controlPolicyForCall, createMigrationPlan, control_default as default, detectDestructiveChanges, extractCodecControlHooks, partitionCallsByControlPolicy, partitionIssuesByControlPolicy, planFieldEventOperations, plannerFailure, plannerSuccess, resolveValueSetValues, runnerFailure, runnerSuccess, temporalAuthoringPresets, timestampNowControlDescriptor };
|
|
1267
|
+
export { INIT_ADDITIVE_POLICY, assembleAuthoringContributions, buildNativeTypeExpander, contractNamespaceToSchemaIR, contractToSchemaIR, controlPolicyForCall, createMigrationPlan, control_default as default, detectDestructiveChanges, extractCodecControlHooks, partitionCallsByControlPolicy, partitionIssuesByControlPolicy, planFieldEventOperations, plannerFailure, plannerSuccess, resolveValueSetValues, runnerFailure, runnerSuccess, temporalAuthoringPresets, temporalCodecPreset, temporalCodecPresetWithPrecision, timestampNowControlDescriptor };
|
|
1216
1268
|
|
|
1217
1269
|
//# sourceMappingURL=control.mjs.map
|