@prisma-next/sql-schema-ir 0.1.0-dev.3 → 0.1.0-dev.30
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/README.md +18 -11
- package/package.json +8 -5
package/README.md
CHANGED
|
@@ -26,6 +26,7 @@ This package defines the core types for the SQL Schema IR, a target-agnostic rep
|
|
|
26
26
|
|
|
27
27
|
**Dependents:**
|
|
28
28
|
- **Migration Plane**:
|
|
29
|
+
- `@prisma-next/family-sql` - SQL family instance uses SqlSchemaIR for schema verification
|
|
29
30
|
- `@prisma-next/core-control-plane` - Core verification logic
|
|
30
31
|
- `@prisma-next/adapter-postgres` - Postgres introspection
|
|
31
32
|
- `@prisma-next/extension-pgvector` - Extension verification hooks
|
|
@@ -106,23 +107,29 @@ const schemaIR: SqlSchemaIR = await controlAdapter.introspect(driver, contract);
|
|
|
106
107
|
|
|
107
108
|
### Schema Verification
|
|
108
109
|
|
|
109
|
-
|
|
110
|
+
Schema verification is performed via the `schemaVerify()` method on the SQL family instance:
|
|
110
111
|
|
|
111
112
|
```typescript
|
|
112
|
-
// In
|
|
113
|
-
import
|
|
113
|
+
// In SQL family instance
|
|
114
|
+
import sql from '@prisma-next/family-sql/control';
|
|
114
115
|
import type { SqlSchemaIR } from '@prisma-next/sql-schema-ir/types';
|
|
115
116
|
|
|
116
|
-
|
|
117
|
+
// Create family instance
|
|
118
|
+
const familyInstance = sql.create({
|
|
119
|
+
target: postgresTargetDescriptor,
|
|
120
|
+
adapter: postgresAdapterDescriptor,
|
|
121
|
+
driver: postgresDriverDescriptor,
|
|
122
|
+
extensions: [],
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
// Schema verification is performed via family instance method
|
|
126
|
+
const result = await familyInstance.schemaVerify({
|
|
117
127
|
driver,
|
|
118
128
|
contractIR,
|
|
119
|
-
schemaIR, // Produced by family.introspectSchema
|
|
120
|
-
family,
|
|
121
|
-
target,
|
|
122
|
-
adapter,
|
|
123
|
-
extensions,
|
|
124
129
|
strict: false,
|
|
130
|
+
contractPath: './contract.json',
|
|
125
131
|
});
|
|
132
|
+
// schemaVerify internally calls adapter.introspect() to get schemaIR
|
|
126
133
|
```
|
|
127
134
|
|
|
128
135
|
## Architecture
|
|
@@ -140,6 +147,6 @@ This package sits at the core layer in the shared plane, making it accessible to
|
|
|
140
147
|
|
|
141
148
|
- `docs/briefs/11-schema-ir.md` - Schema IR project brief
|
|
142
149
|
- `docs/briefs/SQL Schema IR and Verification.md` - Detailed design document
|
|
143
|
-
- `packages/
|
|
144
|
-
- `packages/targets/
|
|
150
|
+
- `packages/2-sql/3-tooling/family/src/core/instance.ts` - SQL family instance with `schemaVerify()` method
|
|
151
|
+
- `packages/3-targets/6-adapters/postgres/src/exports/control.ts` - Postgres introspection entrypoint
|
|
145
152
|
|
package/package.json
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma-next/sql-schema-ir",
|
|
3
|
-
"version": "0.1.0-dev.
|
|
3
|
+
"version": "0.1.0-dev.30",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"description": "SQL Schema IR types for schema introspection and verification",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@prisma-next/contract": "0.1.0-dev.
|
|
8
|
+
"@prisma-next/contract": "0.1.0-dev.30"
|
|
9
9
|
},
|
|
10
10
|
"devDependencies": {
|
|
11
|
-
"@vitest/coverage-v8": "^
|
|
11
|
+
"@vitest/coverage-v8": "^4.0.0",
|
|
12
12
|
"tsup": "^8.3.0",
|
|
13
13
|
"typescript": "^5.9.3",
|
|
14
|
-
"vitest": "^
|
|
14
|
+
"vitest": "^4.0.16",
|
|
15
|
+
"@prisma-next/test-utils": "0.0.1"
|
|
15
16
|
},
|
|
16
17
|
"files": [
|
|
17
18
|
"dist"
|
|
@@ -27,7 +28,9 @@
|
|
|
27
28
|
"test": "vitest run --passWithNoTests",
|
|
28
29
|
"test:coverage": "vitest run --coverage --passWithNoTests",
|
|
29
30
|
"typecheck": "tsc --project tsconfig.json --noEmit",
|
|
30
|
-
"lint": "biome check . --config-path
|
|
31
|
+
"lint": "biome check . --config-path ../../../../biome.json --error-on-warnings",
|
|
32
|
+
"lint:fix": "biome check --write . --config-path ../../../biome.json",
|
|
33
|
+
"lint:fix:unsafe": "biome check --write --unsafe . --config-path ../../../biome.json",
|
|
31
34
|
"clean": "node ../../../../scripts/clean.mjs"
|
|
32
35
|
}
|
|
33
36
|
}
|