@prisma-next/target-postgres 0.3.0-dev.4 → 0.3.0-dev.6
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/{exports/chunk-2EJEPMD3.js → chunk-RKEXRSSI.js} +1 -1
- package/dist/chunk-RKEXRSSI.js.map +1 -0
- package/dist/core/descriptor-meta.d.ts +9 -0
- package/dist/core/descriptor-meta.d.ts.map +1 -0
- package/dist/core/migrations/planner.d.ts +14 -0
- package/dist/core/migrations/planner.d.ts.map +1 -0
- package/dist/core/migrations/runner.d.ts +8 -0
- package/dist/core/migrations/runner.d.ts.map +1 -0
- package/dist/core/migrations/statement-builders.d.ts +30 -0
- package/dist/core/migrations/statement-builders.d.ts.map +1 -0
- package/dist/exports/control.d.ts +4 -12
- package/dist/exports/control.d.ts.map +1 -0
- package/dist/exports/control.js +1 -1
- package/dist/exports/pack.d.ts +3 -4
- package/dist/exports/pack.d.ts.map +1 -0
- package/dist/exports/pack.js +1 -1
- package/dist/exports/runtime.d.ts +4 -5
- package/dist/exports/runtime.d.ts.map +1 -0
- package/dist/exports/runtime.js +1 -1
- package/package.json +14 -13
- package/src/core/descriptor-meta.ts +8 -0
- package/src/core/migrations/planner.ts +862 -0
- package/src/core/migrations/runner.ts +596 -0
- package/src/core/migrations/statement-builders.ts +144 -0
- package/src/exports/control.ts +56 -0
- package/src/exports/pack.ts +6 -0
- package/src/exports/runtime.ts +29 -0
- package/dist/exports/chunk-2EJEPMD3.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core/descriptor-meta.ts"],"sourcesContent":["export const postgresTargetDescriptorMeta = {\n kind: 'target',\n familyId: 'sql',\n targetId: 'postgres',\n id: 'postgres',\n version: '0.0.1',\n capabilities: {},\n} as const;\n"],"mappings":";AAAO,IAAM,+BAA+B;AAAA,EAC1C,MAAM;AAAA,EACN,UAAU;AAAA,EACV,UAAU;AAAA,EACV,IAAI;AAAA,EACJ,SAAS;AAAA,EACT,cAAc,CAAC;AACjB;","names":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const postgresTargetDescriptorMeta: {
|
|
2
|
+
readonly kind: "target";
|
|
3
|
+
readonly familyId: "sql";
|
|
4
|
+
readonly targetId: "postgres";
|
|
5
|
+
readonly id: "postgres";
|
|
6
|
+
readonly version: "0.0.1";
|
|
7
|
+
readonly capabilities: {};
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=descriptor-meta.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"descriptor-meta.d.ts","sourceRoot":"","sources":["../../src/core/descriptor-meta.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,4BAA4B;;;;;;;CAO/B,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { SqlMigrationPlanner } from '@prisma-next/family-sql/control';
|
|
2
|
+
type OperationClass = 'extension' | 'table' | 'unique' | 'index' | 'foreignKey';
|
|
3
|
+
export interface PostgresPlanTargetDetails {
|
|
4
|
+
readonly schema: string;
|
|
5
|
+
readonly objectType: OperationClass;
|
|
6
|
+
readonly name: string;
|
|
7
|
+
readonly table?: string;
|
|
8
|
+
}
|
|
9
|
+
interface PlannerConfig {
|
|
10
|
+
readonly defaultSchema: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function createPostgresMigrationPlanner(config?: Partial<PlannerConfig>): SqlMigrationPlanner<PostgresPlanTargetDetails>;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=planner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planner.d.ts","sourceRoot":"","sources":["../../../src/core/migrations/planner.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,mBAAmB,EAIpB,MAAM,iCAAiC,CAAC;AAgBzC,KAAK,cAAc,GAAG,WAAW,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,YAAY,CAAC;AAuBhF,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,UAAU,EAAE,cAAc,CAAC;IACpC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,UAAU,aAAa;IACrB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC;AAMD,wBAAgB,8BAA8B,CAC5C,MAAM,GAAE,OAAO,CAAC,aAAa,CAAM,GAClC,mBAAmB,CAAC,yBAAyB,CAAC,CAKhD"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { SqlControlFamilyInstance, SqlMigrationRunner } from '@prisma-next/family-sql/control';
|
|
2
|
+
import type { PostgresPlanTargetDetails } from './planner';
|
|
3
|
+
interface RunnerConfig {
|
|
4
|
+
readonly defaultSchema: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function createPostgresMigrationRunner(family: SqlControlFamilyInstance, config?: Partial<RunnerConfig>): SqlMigrationRunner<PostgresPlanTargetDetails>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=runner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../../src/core/migrations/runner.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,wBAAwB,EAIxB,kBAAkB,EAInB,MAAM,iCAAiC,CAAC;AAOzC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AAU3D,UAAU,YAAY;IACpB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC;AAoCD,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,wBAAwB,EAChC,MAAM,GAAE,OAAO,CAAC,YAAY,CAAM,GACjC,kBAAkB,CAAC,yBAAyB,CAAC,CAE/C"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export interface SqlStatement {
|
|
2
|
+
readonly sql: string;
|
|
3
|
+
readonly params: readonly unknown[];
|
|
4
|
+
}
|
|
5
|
+
export declare const ensurePrismaContractSchemaStatement: SqlStatement;
|
|
6
|
+
export declare const ensureMarkerTableStatement: SqlStatement;
|
|
7
|
+
export declare const ensureLedgerTableStatement: SqlStatement;
|
|
8
|
+
export interface WriteMarkerInput {
|
|
9
|
+
readonly coreHash: string;
|
|
10
|
+
readonly profileHash: string;
|
|
11
|
+
readonly contractJson?: unknown;
|
|
12
|
+
readonly canonicalVersion?: number | null;
|
|
13
|
+
readonly appTag?: string | null;
|
|
14
|
+
readonly meta?: Record<string, unknown>;
|
|
15
|
+
}
|
|
16
|
+
export declare function buildWriteMarkerStatements(input: WriteMarkerInput): {
|
|
17
|
+
readonly insert: SqlStatement;
|
|
18
|
+
readonly update: SqlStatement;
|
|
19
|
+
};
|
|
20
|
+
export interface LedgerInsertInput {
|
|
21
|
+
readonly originCoreHash?: string | null;
|
|
22
|
+
readonly originProfileHash?: string | null;
|
|
23
|
+
readonly destinationCoreHash: string;
|
|
24
|
+
readonly destinationProfileHash?: string | null;
|
|
25
|
+
readonly contractJsonBefore?: unknown;
|
|
26
|
+
readonly contractJsonAfter?: unknown;
|
|
27
|
+
readonly operations: unknown;
|
|
28
|
+
}
|
|
29
|
+
export declare function buildLedgerInsertStatement(input: LedgerInsertInput): SqlStatement;
|
|
30
|
+
//# sourceMappingURL=statement-builders.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"statement-builders.d.ts","sourceRoot":"","sources":["../../../src/core/migrations/statement-builders.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,MAAM,EAAE,SAAS,OAAO,EAAE,CAAC;CACrC;AAED,eAAO,MAAM,mCAAmC,EAAE,YAGjD,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,YA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
|
-
interface PostgresPlanTargetDetails {
|
|
5
|
-
readonly schema: string;
|
|
6
|
-
readonly objectType: OperationClass;
|
|
7
|
-
readonly name: string;
|
|
8
|
-
readonly table?: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
1
|
+
import type { SqlControlTargetDescriptor } from '@prisma-next/family-sql/control';
|
|
2
|
+
import type { PostgresPlanTargetDetails } from '../core/migrations/planner';
|
|
11
3
|
/**
|
|
12
4
|
* Postgres target descriptor for CLI config.
|
|
13
5
|
*/
|
|
14
6
|
declare const postgresTargetDescriptor: SqlControlTargetDescriptor<'postgres', PostgresPlanTargetDetails>;
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
export default postgresTargetDescriptor;
|
|
8
|
+
//# sourceMappingURL=control.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control.d.ts","sourceRoot":"","sources":["../../src/exports/control.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAEV,0BAA0B,EAC3B,MAAM,iCAAiC,CAAC;AAEzC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAI5E;;GAEG;AACH,QAAA,MAAM,wBAAwB,EAAE,0BAA0B,CAAC,UAAU,EAAE,yBAAyB,CAoC7F,CAAC;AAEJ,eAAe,wBAAwB,CAAC"}
|
package/dist/exports/control.js
CHANGED
package/dist/exports/pack.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { TargetPackRef } from '@prisma-next/contract/framework-components';
|
|
2
|
-
|
|
1
|
+
import type { TargetPackRef } from '@prisma-next/contract/framework-components';
|
|
3
2
|
declare const postgresPack: TargetPackRef<'sql', 'postgres'>;
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
export default postgresPack;
|
|
4
|
+
//# sourceMappingURL=pack.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pack.d.ts","sourceRoot":"","sources":["../../src/exports/pack.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4CAA4C,CAAC;AAGhF,QAAA,MAAM,YAAY,EAAE,aAAa,CAAC,KAAK,EAAE,UAAU,CAAgC,CAAC;AAEpF,eAAe,YAAY,CAAC"}
|
package/dist/exports/pack.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { RuntimeTargetDescriptor, RuntimeTargetInstance } from '@prisma-next/core-execution-plane/types';
|
|
2
|
-
|
|
1
|
+
import type { RuntimeTargetDescriptor, RuntimeTargetInstance } from '@prisma-next/core-execution-plane/types';
|
|
3
2
|
/**
|
|
4
3
|
* Postgres runtime target instance interface.
|
|
5
4
|
*/
|
|
6
|
-
interface PostgresRuntimeTargetInstance extends RuntimeTargetInstance<'sql', 'postgres'> {
|
|
5
|
+
export interface PostgresRuntimeTargetInstance extends RuntimeTargetInstance<'sql', 'postgres'> {
|
|
7
6
|
}
|
|
8
7
|
/**
|
|
9
8
|
* Postgres target descriptor for runtime plane.
|
|
10
9
|
*/
|
|
11
10
|
declare const postgresRuntimeTargetDescriptor: RuntimeTargetDescriptor<'sql', 'postgres', PostgresRuntimeTargetInstance>;
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
export default postgresRuntimeTargetDescriptor;
|
|
12
|
+
//# sourceMappingURL=runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/exports/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,qBAAqB,EACtB,MAAM,yCAAyC,CAAC;AAGjD;;GAEG;AACH,MAAM,WAAW,6BAA8B,SAAQ,qBAAqB,CAAC,KAAK,EAAE,UAAU,CAAC;CAAG;AAElG;;GAEG;AACH,QAAA,MAAM,+BAA+B,EAAE,uBAAuB,CAC5D,KAAK,EACL,UAAU,EACV,6BAA6B,CAS9B,CAAC;AAEF,eAAe,+BAA+B,CAAC"}
|
package/dist/exports/runtime.js
CHANGED
package/package.json
CHANGED
|
@@ -1,32 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma-next/target-postgres",
|
|
3
|
-
"version": "0.3.0-dev.
|
|
3
|
+
"version": "0.3.0-dev.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"description": "Postgres target pack for Prisma Next",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"arktype": "^2.0.0",
|
|
9
|
-
"@prisma-next/
|
|
10
|
-
"@prisma-next/
|
|
11
|
-
"@prisma-next/core-
|
|
12
|
-
"@prisma-next/
|
|
13
|
-
"@prisma-next/sql
|
|
14
|
-
"@prisma-next/
|
|
15
|
-
"@prisma-next/sql-
|
|
16
|
-
"@prisma-next/sql-
|
|
17
|
-
"@prisma-next/utils": "0.3.0-dev.
|
|
9
|
+
"@prisma-next/cli": "0.3.0-dev.6",
|
|
10
|
+
"@prisma-next/contract": "0.3.0-dev.6",
|
|
11
|
+
"@prisma-next/core-control-plane": "0.3.0-dev.6",
|
|
12
|
+
"@prisma-next/core-execution-plane": "0.3.0-dev.6",
|
|
13
|
+
"@prisma-next/family-sql": "0.3.0-dev.6",
|
|
14
|
+
"@prisma-next/sql-errors": "0.3.0-dev.6",
|
|
15
|
+
"@prisma-next/sql-schema-ir": "0.3.0-dev.6",
|
|
16
|
+
"@prisma-next/sql-contract": "0.3.0-dev.6",
|
|
17
|
+
"@prisma-next/utils": "0.3.0-dev.6"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"@vitest/coverage-v8": "4.0.16",
|
|
21
21
|
"tsup": "8.5.1",
|
|
22
22
|
"typescript": "5.9.3",
|
|
23
23
|
"vitest": "4.0.16",
|
|
24
|
-
"@prisma-next/adapter-postgres": "0.3.0-dev.
|
|
25
|
-
"@prisma-next/driver-postgres": "0.3.0-dev.
|
|
24
|
+
"@prisma-next/adapter-postgres": "0.3.0-dev.6",
|
|
25
|
+
"@prisma-next/driver-postgres": "0.3.0-dev.6",
|
|
26
26
|
"@prisma-next/test-utils": "0.0.1"
|
|
27
27
|
},
|
|
28
28
|
"files": [
|
|
29
29
|
"dist",
|
|
30
|
+
"src",
|
|
30
31
|
"packs"
|
|
31
32
|
],
|
|
32
33
|
"exports": {
|
|
@@ -44,7 +45,7 @@
|
|
|
44
45
|
}
|
|
45
46
|
},
|
|
46
47
|
"scripts": {
|
|
47
|
-
"build": "tsup --config tsup.config.ts",
|
|
48
|
+
"build": "tsup --config tsup.config.ts && tsc --project tsconfig.build.json",
|
|
48
49
|
"test": "vitest run --passWithNoTests",
|
|
49
50
|
"test:coverage": "vitest run --coverage --passWithNoTests",
|
|
50
51
|
"typecheck": "tsc --project tsconfig.json --noEmit",
|