@prisma-next/target-postgres 0.1.0-pr.72.1 → 0.2.0

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.
Files changed (2) hide show
  1. package/README.md +7 -17
  2. package/package.json +12 -12
package/README.md CHANGED
@@ -17,8 +17,8 @@ Provides the Postgres target descriptor (`SqlControlTargetDescriptor`) for CLI c
17
17
  - **Target Descriptor Export**: Exports the Postgres `SqlControlTargetDescriptor` for use in CLI configuration files
18
18
  - **Descriptor-First Design**: All declarative fields (version, capabilities, types, operations) are properties directly on the descriptor, eliminating the need for separate manifest files
19
19
  - **Multi-Plane Support**: Provides both migration-plane (control) and runtime-plane entry points for the Postgres target
20
- - **Planner Factory**: Implements `migrations.createPlanner()` to create Postgres-specific migration planners
21
- - **Runner Factory**: Implements `migrations.createRunner()` to create Postgres-specific migration runners
20
+ - **Planner Factory**: Implements `createPlanner()` to create Postgres-specific migration planners
21
+ - **Runner Factory**: Implements `createRunner()` to create Postgres-specific migration runners
22
22
  - **Database Dependency Consumption**: The planner extracts database dependencies from the configured framework components (passed as `frameworkComponents`), verifies each dependency against the live schema, and only emits install operations when required. The runner reuses the same metadata for post-apply verification, so there are no hardcoded extension mappings—database dependencies stay component-owned.
23
23
 
24
24
  This package spans multiple planes:
@@ -26,15 +26,6 @@ This package spans multiple planes:
26
26
  - **Runtime plane** (`src/exports/runtime.ts`): Runtime entry point for target-specific runtime code (future)
27
27
  - **Authoring pack ref** (`src/exports/pack.ts`): Pure data surface for contract builder workflows
28
28
 
29
- ## `db init`
30
-
31
- This package provides the Postgres implementation of the SQL migration planner/runner used by `prisma-next db init`:
32
-
33
- - **Planner** (`src/core/migrations/planner.ts`): produces an additive-only `MigrationPlan` to bring the database schema in line with a destination contract. Extra unrelated schema is tolerated; non-additive mismatches (type/nullability/constraint incompatibilities) surface as structured conflicts.
34
- - **Runner** (`src/core/migrations/runner.ts`): executes a plan under an advisory lock, verifies the post-state schema, then writes the contract marker and appends a ledger entry in the `prisma_contract` schema.
35
-
36
- For the CLI orchestration, see `packages/1-framework/3-tooling/cli/src/commands/db-init.ts`.
37
-
38
29
  ## Usage
39
30
 
40
31
  ### Control Plane (CLI)
@@ -52,8 +43,8 @@ import postgresDriver from '@prisma-next/driver-postgres/control';
52
43
  // - id: 'postgres'
53
44
  // - version: '0.0.1'
54
45
  // - capabilities, types, operations (directly on descriptor)
55
- // - migrations.createPlanner(): creates a Postgres migration planner
56
- // - migrations.createRunner(): creates a Postgres migration runner
46
+ // - createPlanner(): creates a Postgres migration planner
47
+ // - createRunner(): creates a Postgres migration runner
57
48
 
58
49
  // Create family instance with target, adapter, and driver
59
50
  const family = sqlFamilyDescriptor.create({
@@ -64,8 +55,8 @@ const family = sqlFamilyDescriptor.create({
64
55
  });
65
56
 
66
57
  // Create planner and runner from target descriptor
67
- const planner = postgres.migrations.createPlanner(family);
68
- const runner = postgres.migrations.createRunner(family);
58
+ const planner = postgres.createPlanner(family);
59
+ const runner = postgres.createRunner(family);
69
60
 
70
61
  // Plan and execute migrations
71
62
  const planResult = planner.plan({ contract, schema, policy });
@@ -143,8 +134,7 @@ This package ships a mix of fast planner unit tests and slower runner integratio
143
134
 
144
135
  - **Default (`pnpm --filter @prisma-next/target-postgres test`)**: runs all tests including integration tests
145
136
  - **Test files**:
146
- - `test/migrations/planner.behavior.test.ts`: Planner unit tests (classification, conflicts, dependency ops)
147
- - `test/migrations/planner.integration.test.ts`: Planner integration tests
137
+ - `test/migrations/planner.case1.test.ts`: Planner unit tests
148
138
  - `test/migrations/runner.*.integration.test.ts`: Runner integration tests (basic, errors, idempotency, policy)
149
139
 
150
140
  ```bash
package/package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "name": "@prisma-next/target-postgres",
3
- "version": "0.1.0-pr.72.1",
3
+ "version": "0.2.0",
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/family-sql": "0.1.0-pr.72.1",
10
- "@prisma-next/cli": "0.1.0-pr.72.1",
11
- "@prisma-next/contract": "0.1.0-pr.72.1",
12
- "@prisma-next/sql-contract": "0.1.0-pr.72.1",
13
- "@prisma-next/sql-errors": "0.1.0-pr.72.1",
14
- "@prisma-next/sql-schema-ir": "0.1.0-pr.72.1",
15
- "@prisma-next/core-control-plane": "0.1.0-pr.72.1",
16
- "@prisma-next/core-execution-plane": "0.1.0-pr.72.1",
17
- "@prisma-next/utils": "0.1.0-pr.72.1"
9
+ "@prisma-next/family-sql": "0.2.0",
10
+ "@prisma-next/cli": "0.2.0",
11
+ "@prisma-next/contract": "0.2.0",
12
+ "@prisma-next/sql-contract": "0.2.0",
13
+ "@prisma-next/sql-errors": "0.2.0",
14
+ "@prisma-next/sql-schema-ir": "0.2.0",
15
+ "@prisma-next/core-control-plane": "0.2.0",
16
+ "@prisma-next/core-execution-plane": "0.2.0",
17
+ "@prisma-next/utils": "0.2.0"
18
18
  },
19
19
  "devDependencies": {
20
20
  "@vitest/coverage-v8": "^4.0.0",
@@ -22,8 +22,8 @@
22
22
  "tsup": "^8.3.0",
23
23
  "typescript": "^5.9.3",
24
24
  "vitest": "^4.0.16",
25
- "@prisma-next/adapter-postgres": "0.1.0-pr.72.1",
26
- "@prisma-next/driver-postgres": "0.1.0-pr.72.1",
25
+ "@prisma-next/adapter-postgres": "0.2.0",
26
+ "@prisma-next/driver-postgres": "0.2.0",
27
27
  "@prisma-next/test-utils": "0.0.1"
28
28
  },
29
29
  "files": [