@prisma-next/family-sql 0.2.0 → 0.3.0-dev.1

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 +15 -3
  2. package/package.json +16 -16
package/README.md CHANGED
@@ -15,7 +15,7 @@ Provides the SQL family descriptor (`ControlFamilyDescriptor`) that includes:
15
15
  - **Planner & Runner SPI**: Owns the `MigrationPlanner` / `MigrationRunner` interfaces plus the `SqlControlTargetDescriptor` helper so targets can expose planners and runners (e.g., Postgres init planner/runner)
16
16
  - **Family Hook Integration**: Integrates the SQL target family hook (`sqlTargetFamilyHook`) from `@prisma-next/sql-contract-emitter`
17
17
  - **Control Plane Entry Point**: Serves as the control plane entry point for the SQL family, enabling the CLI to select the family hook and create family instances
18
- - **Component Database Dependencies**: Consumes database dependencies declared by framework components (target/adapter/extensions). Callers pass the active `frameworkComponents` list into planning/execution/verification; SQL layers structurally narrow to components that declare `databaseDependencies` and use their pure verification hooks (no fuzzy matching against `contract.extensionPacks`).
18
+ - **Component Database Dependencies**: Consumes database dependencies declared by framework components (target/adapter/extension packs). Callers pass the active `frameworkComponents` list into planning/execution/verification; SQL layers structurally narrow to components that declare `databaseDependencies` and use their pure verification hooks (no fuzzy matching against `contract.extensionPacks`).
19
19
 
20
20
  ## Usage
21
21
 
@@ -43,7 +43,7 @@ const verifyResult = await familyInstance.verify({ driver, contractIR, ... });
43
43
  const emitResult = await familyInstance.emitContract({ contractIR: rawContract }); // Handles stripping mappings and validation internally
44
44
 
45
45
  // Targets that implement SqlControlTargetDescriptor can build planners
46
- const planner = postgresTargetDescriptor.createPlanner(familyInstance);
46
+ const planner = postgresTargetDescriptor.migrations.createPlanner(familyInstance);
47
47
  // frameworkComponents should include the active target, adapter, and any extension descriptors so
48
48
  // planner/runner can resolve database dependencies declared by those components.
49
49
  const planResult = planner.plan({
@@ -54,7 +54,7 @@ const planResult = planner.plan({
54
54
  });
55
55
 
56
56
  // Targets also provide runners for executing plans
57
- const runner = postgresTargetDescriptor.createRunner(familyInstance);
57
+ const runner = postgresTargetDescriptor.migrations.createRunner(familyInstance);
58
58
  const executeResult = await runner.execute({
59
59
  plan: planResult.plan,
60
60
  driver,
@@ -131,3 +131,15 @@ The runner returns structured errors with the following codes:
131
131
  **Dependents:**
132
132
  - CLI configuration files import this package to register the SQL family
133
133
 
134
+ ## How to debug `db init`
135
+
136
+ - **CLI orchestration**: `packages/1-framework/3-tooling/cli/src/commands/db-init.ts`
137
+ - **Planner/runner SPI types**: `packages/2-sql/3-tooling/family/src/core/migrations/types.ts`
138
+ - **Pure schema verifier (used by planner + runner)**: `@prisma-next/family-sql/schema-verify` (source: `packages/2-sql/3-tooling/family/src/core/schema-verify/`)
139
+ - **Postgres implementation**:
140
+ - Planner: `packages/3-targets/3-targets/postgres/src/core/migrations/planner.ts`
141
+ - Runner: `packages/3-targets/3-targets/postgres/src/core/migrations/runner.ts`
142
+ - **Tests**:
143
+ - CLI integration: `test/integration/test/cli.db-init.e2e.test.ts`
144
+ - Target unit/integration: `packages/3-targets/3-targets/postgres/test/migrations/*`
145
+
package/package.json CHANGED
@@ -1,25 +1,25 @@
1
1
  {
2
2
  "name": "@prisma-next/family-sql",
3
- "version": "0.2.0",
3
+ "version": "0.3.0-dev.1",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "description": "SQL family descriptor for Prisma Next",
7
7
  "dependencies": {
8
8
  "arktype": "^2.0.0",
9
- "@prisma-next/cli": "0.2.0",
10
- "@prisma-next/contract": "0.2.0",
11
- "@prisma-next/core-control-plane": "0.2.0",
12
- "@prisma-next/core-execution-plane": "0.2.0",
13
- "@prisma-next/runtime-executor": "0.2.0",
14
- "@prisma-next/operations": "0.2.0",
15
- "@prisma-next/sql-contract-emitter": "0.2.0",
16
- "@prisma-next/sql-contract-ts": "0.2.0",
17
- "@prisma-next/sql-contract": "0.2.0",
18
- "@prisma-next/sql-relational-core": "0.2.0",
19
- "@prisma-next/sql-runtime": "0.2.0",
20
- "@prisma-next/sql-schema-ir": "0.2.0",
21
- "@prisma-next/utils": "0.2.0",
22
- "@prisma-next/sql-operations": "0.2.0"
9
+ "@prisma-next/cli": "0.3.0-dev.1",
10
+ "@prisma-next/contract": "0.3.0-dev.1",
11
+ "@prisma-next/core-control-plane": "0.3.0-dev.1",
12
+ "@prisma-next/core-execution-plane": "0.3.0-dev.1",
13
+ "@prisma-next/operations": "0.3.0-dev.1",
14
+ "@prisma-next/runtime-executor": "0.3.0-dev.1",
15
+ "@prisma-next/sql-contract": "0.3.0-dev.1",
16
+ "@prisma-next/sql-operations": "0.3.0-dev.1",
17
+ "@prisma-next/sql-relational-core": "0.3.0-dev.1",
18
+ "@prisma-next/sql-runtime": "0.3.0-dev.1",
19
+ "@prisma-next/sql-schema-ir": "0.3.0-dev.1",
20
+ "@prisma-next/sql-contract-emitter": "0.3.0-dev.1",
21
+ "@prisma-next/utils": "0.3.0-dev.1",
22
+ "@prisma-next/sql-contract-ts": "0.3.0-dev.1"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@vitest/coverage-v8": "^4.0.0",
@@ -27,7 +27,7 @@
27
27
  "typescript": "^5.9.3",
28
28
  "vite-tsconfig-paths": "^5.1.4",
29
29
  "vitest": "^4.0.16",
30
- "@prisma-next/driver-postgres": "0.2.0",
30
+ "@prisma-next/driver-postgres": "0.3.0-dev.1",
31
31
  "@prisma-next/test-utils": "0.0.1"
32
32
  },
33
33
  "files": [