@prisma-next/family-sql 0.12.0-dev.20 → 0.12.0-dev.22

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.
@@ -38,11 +38,10 @@ interface SqlControlAdapter<TTarget extends string = string> extends ControlAdap
38
38
  */
39
39
  readAllMarkers(driver: ControlDriverInstance<'sql', TTarget>): Promise<ReadonlyMap<string, ContractMarkerRecord>>;
40
40
  /**
41
- * Reads the per-migration ledger journal for `space` in apply order.
42
- * Returns an empty array when the ledger store does not yet exist or
43
- * has no rows for that space.
41
+ * Reads the per-migration ledger journal in apply order. When `space` is
42
+ * omitted, returns rows for every space.
44
43
  */
45
- readLedger(driver: ControlDriverInstance<'sql', TTarget>, space: string): Promise<readonly LedgerEntryRecord[]>;
44
+ readLedger(driver: ControlDriverInstance<'sql', TTarget>, space?: string): Promise<readonly LedgerEntryRecord[]>;
46
45
  /**
47
46
  * Introspects a database schema and returns a raw SqlSchemaIR.
48
47
  *
@@ -131,4 +130,4 @@ interface SqlControlAdapterDescriptor<TTarget extends string = string> {
131
130
  }
132
131
  //#endregion
133
132
  export { SqlControlAdapterDescriptor as n, SqlControlAdapter as t };
134
- //# sourceMappingURL=control-adapter-8tV9WgWK.d.mts.map
133
+ //# sourceMappingURL=control-adapter-CKCfVhTd.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"control-adapter-CKCfVhTd.d.mts","names":[],"sources":["../src/core/control-adapter.ts"],"mappings":";;;;;;;;;;AA8BA;;;;UAAiB,iBAAA,0CACP,sBAAA,QAA8B,OAAA;EAiB5B;;;;;;;;;;;;;;;EADV,UAAA,CACE,MAAA,EAAQ,qBAAA,QAA6B,OAAA,GACrC,KAAA,WACC,OAAA,CAAQ,oBAAA;EA6CiB;;;;;;;EApC5B,cAAA,CACE,MAAA,EAAQ,qBAAA,QAA6B,OAAA,IACpC,OAAA,CAAQ,WAAA,SAAoB,oBAAA;EA4EnB;;;;EAtEZ,UAAA,CACE,MAAA,EAAQ,qBAAA,QAA6B,OAAA,GACrC,KAAA,YACC,OAAA,UAAiB,iBAAA;EA4FuB;;;;;;;;;;;;EA9E3C,UAAA,CACE,MAAA,EAAQ,qBAAA,QAA6B,OAAA,GACrC,QAAA,YACA,MAAA,YACC,OAAA,CAAQ,WAAA;EAtCR;;;;;EAAA,SA6CM,gBAAA,GAAmB,iBAAA;EAlCzB;;;;;EAAA,SAyCM,mBAAA,GAAsB,oBAAA;EAlC7B;;;;;;;;EAAA,SA4CO,iBAAA,GAAoB,iBAAA;EAzB3B;;;;;;;;EAAA,SAmCO,yBAAA,IACP,MAAA,EAAQ,WAAA,EACR,QAAA,EAAU,wBAAA,EACV,WAAA;EAHO;;;;;;EAAA,SAWA,oCAAA,IACP,QAAA,EAAU,QAAA,CAAS,UAAA,OAEnB,MAAA,EAAQ,WAAA,EACR,QAAA,EAAU,wBAAA,EACV,WAAA;EAJU;;;;EAWZ,4BAAA,aAAyC,OAAA;EAR7B;;;;EAcZ,0BAAA,aAAuC,OAAA;EAAvC;;;;;;;;;EAWA,KAAA,CAAM,GAAA,EAAK,WAAA,GAAc,OAAA,EAAS,OAAA,EAAS,cAAA,YAA0B,gBAAA;AAAA;AASvE;;;;;;AAAA,UAAiB,2BAAA;EAO+C;;;;;;EAA9D,MAAA,CAAO,KAAA,EAAO,YAAA,QAAoB,OAAA,IAAW,iBAAA,CAAkB,OAAA;AAAA"}
@@ -1,2 +1,2 @@
1
- import { n as SqlControlAdapterDescriptor, t as SqlControlAdapter } from "./control-adapter-8tV9WgWK.mjs";
1
+ import { n as SqlControlAdapterDescriptor, t as SqlControlAdapter } from "./control-adapter-CKCfVhTd.mjs";
2
2
  export { type SqlControlAdapter, type SqlControlAdapterDescriptor };
@@ -1,4 +1,4 @@
1
- import { A as SqlPlannerResult, C as SqlMigrationRunnerResult, D as SqlPlannerConflictKind, E as SqlPlannerConflict, M as StorageTypePlanResult, N as SqlControlFamilyInstance, O as SqlPlannerConflictLocation, S as SqlMigrationRunnerFailure, T as SqlPlanTargetDetails, _ as SqlMigrationPlannerPlanOptions, a as FieldEvent, b as SqlMigrationRunnerExecuteCallbacks, c as SqlControlAdapterDescriptor, d as SqlMigrationPlan, f as SqlMigrationPlanContractInfo, g as SqlMigrationPlanner, h as SqlMigrationPlanOperationTarget, i as ExpandNativeTypeInput, j as SqlPlannerSuccessResult, k as SqlPlannerFailureResult, l as SqlControlExtensionDescriptor, m as SqlMigrationPlanOperationStep, n as CodecControlHooks, o as FieldEventContext, p as SqlMigrationPlanOperation, r as CreateSqlMigrationPlanOptions, s as ResolveIdentityValueInput, t as AnyRecord, u as SqlControlTargetDescriptor, v as SqlMigrationRunner, w as SqlMigrationRunnerSuccessValue, x as SqlMigrationRunnerExecuteOptions, y as SqlMigrationRunnerErrorCode } from "./types-BQiqw6kR.mjs";
1
+ import { A as SqlPlannerResult, C as SqlMigrationRunnerResult, D as SqlPlannerConflictKind, E as SqlPlannerConflict, M as StorageTypePlanResult, N as SqlControlFamilyInstance, O as SqlPlannerConflictLocation, S as SqlMigrationRunnerFailure, T as SqlPlanTargetDetails, _ as SqlMigrationPlannerPlanOptions, a as FieldEvent, b as SqlMigrationRunnerExecuteCallbacks, c as SqlControlAdapterDescriptor, d as SqlMigrationPlan, f as SqlMigrationPlanContractInfo, g as SqlMigrationPlanner, h as SqlMigrationPlanOperationTarget, i as ExpandNativeTypeInput, j as SqlPlannerSuccessResult, k as SqlPlannerFailureResult, l as SqlControlExtensionDescriptor, m as SqlMigrationPlanOperationStep, n as CodecControlHooks, o as FieldEventContext, p as SqlMigrationPlanOperation, r as CreateSqlMigrationPlanOptions, s as ResolveIdentityValueInput, t as AnyRecord, u as SqlControlTargetDescriptor, v as SqlMigrationRunner, w as SqlMigrationRunnerSuccessValue, x as SqlMigrationRunnerExecuteOptions, y as SqlMigrationRunnerErrorCode } from "./types-DsdKvKFN.mjs";
2
2
  import { ControlFamilyDescriptor, ControlStack, MigrationOperationClass, MigrationOperationPolicy, MigrationOperationPolicy as MigrationOperationPolicy$1, MigrationPlan, MigrationPlanOperation, MigrationPlanner, MigrationPlannerConflict, MigrationPlannerConflict as MigrationPlannerConflict$1, MigrationPlannerResult, MutationDefaultGeneratorDescriptor, OpFactoryCall, TargetMigrationsCapability, assembleAuthoringContributions } from "@prisma-next/framework-components/control";
3
3
  import { SqlStorage, StorageColumn } from "@prisma-next/sql-contract/types";
4
4
  import { ColumnDefault, Contract, ControlPolicy } from "@prisma-next/contract/types";
package/dist/control.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { n as sqlFamilyAuthoringFieldPresets, t as sqlFamilyAuthoringTypes } from "./authoring-type-constructors-F4JpCJl7.mjs";
2
2
  import { t as SqlContractSerializer } from "./sql-contract-serializer-8axtK4lg.mjs";
3
- import { a as extractCodecControlHooks, t as verifySqlSchema } from "./verify-sql-schema-CXW_D9dW.mjs";
3
+ import { a as extractCodecControlHooks, t as verifySqlSchema } from "./verify-sql-schema-fljAiO-C.mjs";
4
4
  import { t as collectSupportedCodecTypeIds } from "./verify-Crewz6hG.mjs";
5
5
  import { n as temporalAuthoringPresets, r as timestampNowControlDescriptor } from "./timestamp-now-generator-BkjCQIde.mjs";
6
6
  import { sqlEmission } from "@prisma-next/sql-contract-emitter";
@@ -1632,9 +1632,9 @@ function deriveAnnotations(storage, annotationNamespace, resolveEnumStorageKey)
1632
1632
  * policy is forced to `external` regardless of the node's own declaration.
1633
1633
  * Every other default defers to the node's effective control policy.
1634
1634
  */
1635
- function controlPolicyForCall(subject, defaultControl) {
1636
- if (defaultControl === "external") return "external";
1637
- return effectiveControlPolicy(subject?.explicitNodeControlPolicy, defaultControl);
1635
+ function controlPolicyForCall(subject, defaultControlPolicy) {
1636
+ if (defaultControlPolicy === "external") return "external";
1637
+ return effectiveControlPolicy(subject?.explicitNodeControlPolicy, defaultControlPolicy);
1638
1638
  }
1639
1639
  /**
1640
1640
  * Whether a call is allowed to emit under a given control policy.
@@ -1655,11 +1655,11 @@ function callAllowedUnderControlPolicy(policy, subject) {
1655
1655
  }
1656
1656
  }
1657
1657
  function filterCallsByControlPolicy(options) {
1658
- const defaultControl = options.contract.defaultControl;
1658
+ const defaultControlPolicy = options.contract.defaultControlPolicy;
1659
1659
  const kept = [];
1660
1660
  for (const call of options.calls) {
1661
1661
  const subject = options.resolveControlPolicySubject(call);
1662
- if (callAllowedUnderControlPolicy(controlPolicyForCall(subject, defaultControl), subject)) kept.push(call);
1662
+ if (callAllowedUnderControlPolicy(controlPolicyForCall(subject, defaultControlPolicy), subject)) kept.push(call);
1663
1663
  }
1664
1664
  return Object.freeze(kept);
1665
1665
  }