@prisma-next/family-sql 0.12.0-dev.49 → 0.12.0-dev.50
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-adapter-Dx4XTePx.d.mts → control-adapter-BnNdlGKS.d.mts} +11 -11
- package/dist/control-adapter-BnNdlGKS.d.mts.map +1 -0
- package/dist/control-adapter.d.mts +1 -1
- package/dist/control.d.mts +1 -1
- package/dist/control.mjs.map +1 -1
- package/dist/migration.d.mts +1 -1
- package/dist/{types-DXbK0Pn7.d.mts → types-CfJQKaMJ.d.mts} +13 -13
- package/dist/types-CfJQKaMJ.d.mts.map +1 -0
- package/package.json +21 -21
- package/src/core/control-adapter.ts +13 -10
- package/src/core/control-instance.ts +17 -18
- package/src/core/migrations/types.ts +4 -4
- package/dist/control-adapter-Dx4XTePx.d.mts.map +0 -1
- package/dist/types-DXbK0Pn7.d.mts.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as NativeTypeNormalizer, t as DefaultNormalizer } from "./verify-sql-schema-CN7pPoTC.mjs";
|
|
2
|
-
import { ControlAdapterInstance,
|
|
3
|
-
import { PostgresEnumStorageEntry, SqlStorage } from "@prisma-next/sql-contract/types";
|
|
2
|
+
import { ControlAdapterInstance, ControlStack } from "@prisma-next/framework-components/control";
|
|
3
|
+
import { PostgresEnumStorageEntry, SqlControlDriverInstance, SqlStorage } from "@prisma-next/sql-contract/types";
|
|
4
4
|
import { Contract, ContractMarkerRecord, LedgerEntryRecord } from "@prisma-next/contract/types";
|
|
5
5
|
import { AnyQueryAst, DdlNode, LoweredStatement, LowererContext } from "@prisma-next/sql-relational-core/ast";
|
|
6
6
|
import { SqlSchemaIR } from "@prisma-next/sql-schema-ir/types";
|
|
@@ -28,7 +28,7 @@ interface SqlControlAdapter<TTarget extends string = string> extends ControlAdap
|
|
|
28
28
|
* @param space - Contract space id whose marker row to read (e.g. `'app'`)
|
|
29
29
|
* @returns Resolved marker record, or `null` if not yet stamped.
|
|
30
30
|
*/
|
|
31
|
-
readMarker(driver:
|
|
31
|
+
readMarker(driver: SqlControlDriverInstance<TTarget>, space: string): Promise<ContractMarkerRecord | null>;
|
|
32
32
|
/**
|
|
33
33
|
* Reads every marker row from `prisma_contract.marker` (one per
|
|
34
34
|
* contract space) and returns them keyed by `space`. Used by the
|
|
@@ -36,19 +36,19 @@ interface SqlControlAdapter<TTarget extends string = string> extends ControlAdap
|
|
|
36
36
|
* marker rows. Returns an empty map when the marker table does not
|
|
37
37
|
* yet exist (fresh database / never-signed project).
|
|
38
38
|
*/
|
|
39
|
-
readAllMarkers(driver:
|
|
39
|
+
readAllMarkers(driver: SqlControlDriverInstance<TTarget>): Promise<ReadonlyMap<string, ContractMarkerRecord>>;
|
|
40
40
|
/**
|
|
41
41
|
* Reads the per-migration ledger journal in apply order. When `space` is
|
|
42
42
|
* omitted, returns rows for every space.
|
|
43
43
|
*/
|
|
44
|
-
readLedger(driver:
|
|
44
|
+
readLedger(driver: SqlControlDriverInstance<TTarget>, space?: string): Promise<readonly LedgerEntryRecord[]>;
|
|
45
45
|
/**
|
|
46
46
|
* Inserts the initial marker row for `space` (`INSERT` only). Fails when a
|
|
47
47
|
* row for that space already exists. Used by `sign()` so concurrent first-time
|
|
48
48
|
* stamps cannot silently overwrite each other. `updated_at` is DB-side
|
|
49
49
|
* (`now()` / `datetime('now')`). Mirrors `MongoControlAdapter.initMarker`.
|
|
50
50
|
*/
|
|
51
|
-
insertMarker(driver:
|
|
51
|
+
insertMarker(driver: SqlControlDriverInstance<TTarget>, space: string, destination: {
|
|
52
52
|
readonly storageHash: string;
|
|
53
53
|
readonly profileHash: string;
|
|
54
54
|
readonly invariants?: readonly string[];
|
|
@@ -59,7 +59,7 @@ interface SqlControlAdapter<TTarget extends string = string> extends ControlAdap
|
|
|
59
59
|
* existing row rather than failing. `updated_at` is stamped with a DB-side
|
|
60
60
|
* time expression (`now()` / `datetime('now')`), never an app-side clock.
|
|
61
61
|
*/
|
|
62
|
-
initMarker(driver:
|
|
62
|
+
initMarker(driver: SqlControlDriverInstance<TTarget>, space: string, destination: {
|
|
63
63
|
readonly storageHash: string;
|
|
64
64
|
readonly profileHash: string;
|
|
65
65
|
readonly invariants?: readonly string[];
|
|
@@ -71,7 +71,7 @@ interface SqlControlAdapter<TTarget extends string = string> extends ControlAdap
|
|
|
71
71
|
* is written verbatim when supplied (the union/dedupe policy lives upstream)
|
|
72
72
|
* and left untouched when omitted. Mirrors `MongoControlAdapter.updateMarker`.
|
|
73
73
|
*/
|
|
74
|
-
updateMarker(driver:
|
|
74
|
+
updateMarker(driver: SqlControlDriverInstance<TTarget>, space: string, expectedFrom: string, destination: {
|
|
75
75
|
readonly storageHash: string;
|
|
76
76
|
readonly profileHash: string;
|
|
77
77
|
readonly invariants?: readonly string[];
|
|
@@ -82,7 +82,7 @@ interface SqlControlAdapter<TTarget extends string = string> extends ControlAdap
|
|
|
82
82
|
* by `space`, so `entry.edgeId` carries no dedicated column; `from` / `to`
|
|
83
83
|
* land in `origin_core_hash` / `destination_core_hash`.
|
|
84
84
|
*/
|
|
85
|
-
writeLedgerEntry(driver:
|
|
85
|
+
writeLedgerEntry(driver: SqlControlDriverInstance<TTarget>, space: string, entry: {
|
|
86
86
|
readonly edgeId: string;
|
|
87
87
|
readonly from: string;
|
|
88
88
|
readonly to: string;
|
|
@@ -102,7 +102,7 @@ interface SqlControlAdapter<TTarget extends string = string> extends ControlAdap
|
|
|
102
102
|
* @param schema - Schema name to introspect (defaults to 'public')
|
|
103
103
|
* @returns Promise resolving to SqlSchemaIR representing the live database schema
|
|
104
104
|
*/
|
|
105
|
-
introspect(driver:
|
|
105
|
+
introspect(driver: SqlControlDriverInstance<TTarget>, contract?: unknown, schema?: string): Promise<SqlSchemaIR>;
|
|
106
106
|
/**
|
|
107
107
|
* Optional target-specific normalizer for raw database default expressions.
|
|
108
108
|
* When provided, schema defaults (raw strings) are normalized before comparison
|
|
@@ -169,4 +169,4 @@ interface SqlControlAdapterDescriptor<TTarget extends string = string> {
|
|
|
169
169
|
}
|
|
170
170
|
//#endregion
|
|
171
171
|
export { SqlControlAdapterDescriptor as n, SqlControlAdapter as t };
|
|
172
|
-
//# sourceMappingURL=control-adapter-
|
|
172
|
+
//# sourceMappingURL=control-adapter-BnNdlGKS.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control-adapter-BnNdlGKS.d.mts","names":[],"sources":["../src/core/control-adapter.ts"],"mappings":";;;;;;;;;;AA6BA;;;;UAAiB,iBAAA,0CACP,sBAAA,QAA8B,OAAA;EAiB5B;;;;;;;;;;;;;;;EADV,UAAA,CACE,MAAA,EAAQ,wBAAA,CAAyB,OAAA,GACjC,KAAA,WACC,OAAA,CAAQ,oBAAA;EA6CD;;;;;;;EApCV,cAAA,CACE,MAAA,EAAQ,wBAAA,CAAyB,OAAA,IAChC,OAAA,CAAQ,WAAA,SAAoB,oBAAA;EA6FI;;;;EAvFnC,UAAA,CACE,MAAA,EAAQ,wBAAA,CAAyB,OAAA,GACjC,KAAA,YACC,OAAA,UAAiB,iBAAA;EAqGW;;;;;;EA7F/B,YAAA,CACE,MAAA,EAAQ,wBAAA,CAAyB,OAAA,GACjC,KAAA,UACA,WAAA;IAAA,SACW,WAAA;IAAA,SACA,WAAA;IAAA,SACA,UAAA;EAAA,IAEV,OAAA;EAuIwC;;;;;;EA/H3C,UAAA,CACE,MAAA,EAAQ,wBAAA,CAAyB,OAAA,GACjC,KAAA,UACA,WAAA;IAAA,SACW,WAAA;IAAA,SACA,WAAA;IAAA,SACA,UAAA;EAAA,IAEV,OAAA;EAtDD;;;;;;;EA+DF,YAAA,CACE,MAAA,EAAQ,wBAAA,CAAyB,OAAA,GACjC,KAAA,UACA,YAAA,UACA,WAAA;IAAA,SACW,WAAA;IAAA,SACA,WAAA;IAAA,SACA,UAAA;EAAA,IAEV,OAAA;EApDO;;;;;;EA4DV,gBAAA,CACE,MAAA,EAAQ,wBAAA,CAAyB,OAAA,GACjC,KAAA,UACA,KAAA;IAAA,SACW,MAAA;IAAA,SACA,IAAA;IAAA,SACA,EAAA;IAAA,SACA,aAAA;IAAA,SACA,aAAA;IAAA,SACA,UAAA;EAAA,IAEV,OAAA;EA1DD;;;;;;;;;;;;EAwEF,UAAA,CACE,MAAA,EAAQ,wBAAA,CAAyB,OAAA,GACjC,QAAA,YACA,MAAA,YACC,OAAA,CAAQ,WAAA;EA7CD;;;;;EAAA,SAoDD,gBAAA,GAAmB,iBAAA;EA/Cf;;;;;EAAA,SAsDJ,mBAAA,GAAsB,oBAAA;EA1CI;;;;;;;;EAAA,SAoD1B,yBAAA,IACP,MAAA,EAAQ,WAAA,EACR,QAAA,EAAU,wBAAA,EACV,WAAA;EArDA;;;;;;EAAA,SA6DO,oCAAA,IACP,QAAA,EAAU,QAAA,CAAS,UAAA,OAEnB,MAAA,EAAQ,WAAA,EACR,QAAA,EAAU,wBAAA,EACV,WAAA;EAzCA;;;;EAgDF,4BAAA,aAAyC,OAAA;EAjChC;;;;EAuCT,0BAAA,aAAuC,OAAA;EA3B3B;;;;;;;;;EAsCZ,KAAA,CAAM,GAAA,EAAK,WAAA,GAAc,OAAA,EAAS,OAAA,EAAS,cAAA,YAA0B,gBAAA;AAAA;;;;;;;UAStD,2BAAA;EATU;;;;;;EAgBzB,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-
|
|
1
|
+
import { n as SqlControlAdapterDescriptor, t as SqlControlAdapter } from "./control-adapter-BnNdlGKS.mjs";
|
|
2
2
|
export { type SqlControlAdapter, type SqlControlAdapterDescriptor };
|
package/dist/control.d.mts
CHANGED
|
@@ -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-
|
|
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-CfJQKaMJ.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";
|