Stage 2: DB client factory + live integration tests (real Postgres)
- packages/schema/src/client.ts: createDb(url) -> { db, sql } drizzle/postgres-js
factory. Exposed as the ./client subpath export so the node-only driver never
leaks into client bundles.
- packages/schema/src/db.integration.test.ts: 6 tests gated behind INTEGRATION=1
(content insert/read, vault_path UNIQUE, idempotency_key UNIQUE no-double-post,
content_id FK, audit append, kill-switch upsert). Verified against Postgres 17.
- Default CI suite unchanged: integration tests skip without INTEGRATION.
Closes the Stage 2.1 DoD against a live database (unblocked by Gate 0.8).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
"exports": {
|
||||
".": "./src/index.ts",
|
||||
"./db": "./src/db.ts",
|
||||
"./client": "./src/client.ts",
|
||||
"./frontmatter": "./src/frontmatter.ts"
|
||||
},
|
||||
"scripts": {
|
||||
@@ -20,7 +21,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"zod": "^3.23.0",
|
||||
"drizzle-orm": "^0.36.0"
|
||||
"drizzle-orm": "^0.36.0",
|
||||
"postgres": "^3.4.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"drizzle-kit": "^0.28.0",
|
||||
|
||||
Reference in New Issue
Block a user