@beignet/provider-db-drizzle 0.0.47 → 0.0.49
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/CHANGELOG.md +13 -0
- package/README.md +11 -3
- package/package.json +3 -3
- package/skills/database-provider/SKILL.md +12 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @beignet/provider-db-drizzle
|
|
2
2
|
|
|
3
|
+
## 0.0.49
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- e597d53: Require Node.js 22.12 or newer across every Beignet package, generated app,
|
|
8
|
+
and documented workflow.
|
|
9
|
+
|
|
10
|
+
## 0.0.48
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- 728c942: Add read-only migration status reports, connected validation, stable generated migration hashes, preflight pending detection, generated Drizzle status scripts, and serialized deployment guidance.
|
|
15
|
+
|
|
3
16
|
## 0.0.47
|
|
4
17
|
|
|
5
18
|
## 0.0.46
|
package/README.md
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# @beignet/provider-db-drizzle
|
|
2
2
|
|
|
3
|
+
> **Runtime:** Beignet requires Node.js 22.12 or newer. Bun 1.3.14 or newer is
|
|
4
|
+
> supported for Beignet commands.
|
|
5
|
+
|
|
3
6
|
> [!CAUTION]
|
|
4
7
|
> Beignet is experimental alpha software. The `0.0.x` package line is for early
|
|
5
8
|
> evaluation, and APIs may change between releases while the framework settles.
|
|
@@ -126,6 +129,7 @@ normal app-owned migration flow:
|
|
|
126
129
|
```bash
|
|
127
130
|
bun beignet db generate
|
|
128
131
|
bun beignet db migrate
|
|
132
|
+
bun beignet db status
|
|
129
133
|
```
|
|
130
134
|
|
|
131
135
|
Use `--tables audit,idempotency,outbox` to select a subset when adopting one
|
|
@@ -487,9 +491,13 @@ transactions, outbox rows, idempotency rows, or migration assumptions.
|
|
|
487
491
|
|
|
488
492
|
## Deployment notes
|
|
489
493
|
|
|
490
|
-
Run
|
|
491
|
-
|
|
492
|
-
|
|
494
|
+
Run one serialized migration job per environment before booting code that
|
|
495
|
+
depends on new schema, then verify the target with `beignet db status` and
|
|
496
|
+
`beignet preflight --connect`. Do not migrate from every web replica. Status is
|
|
497
|
+
read-only and cannot prevent a race; use the deployment platform's concurrency
|
|
498
|
+
lock or an app-owned database advisory-lock wrapper. Keep repository interfaces
|
|
499
|
+
app-owned so switching SQLite, Postgres, or MySQL changes infra wiring instead
|
|
500
|
+
of contracts, use cases, policies, or routes.
|
|
493
501
|
|
|
494
502
|
## Unit of work
|
|
495
503
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@beignet/provider-db-drizzle",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.49",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Drizzle ORM database providers for Beignet — typed DbPort, unit of work, audit logs, outbox, and idempotency for SQLite (libSQL/Turso), Postgres, and MySQL.",
|
|
6
6
|
"exports": {
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"access": "public"
|
|
81
81
|
},
|
|
82
82
|
"engines": {
|
|
83
|
-
"node": ">=
|
|
83
|
+
"node": ">=22.12.0"
|
|
84
84
|
},
|
|
85
85
|
"peerDependencies": {
|
|
86
86
|
"@beignet/core": ">=0.0.3 <1.0.0",
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
"@electric-sql/pglite": "^0.5.2",
|
|
110
110
|
"@libsql/client": "^0.14.0",
|
|
111
111
|
"@types/bun": "^1.3.13",
|
|
112
|
-
"@types/node": "^
|
|
112
|
+
"@types/node": "^22.0.0",
|
|
113
113
|
"@types/pg": "^8.11.0",
|
|
114
114
|
"drizzle-orm": "^0.45.2",
|
|
115
115
|
"mysql2": "^3.12.0",
|
|
@@ -44,6 +44,7 @@ Beignet table exports into the app schema, then run the normal migration flow:
|
|
|
44
44
|
beignet db schema sync
|
|
45
45
|
beignet db generate
|
|
46
46
|
beignet db migrate
|
|
47
|
+
beignet db status
|
|
47
48
|
```
|
|
48
49
|
|
|
49
50
|
Use `--tables audit,idempotency,outbox` when adopting a subset.
|
|
@@ -83,6 +84,12 @@ then calls an idempotent `closeDatabaseClient()` so operational commands exit
|
|
|
83
84
|
without breaking failed-boot retries. When a provider creates its own
|
|
84
85
|
env-backed client, the provider always closes it.
|
|
85
86
|
|
|
87
|
+
Generated apps also own `infra/db/migration-status.ts`. It compares the
|
|
88
|
+
checked-in Drizzle journal and SQL hashes with the target database without
|
|
89
|
+
mutating either side. Run it through `beignet db status`; exit 0 means current,
|
|
90
|
+
exit 2 means pending, and any other non-zero exit means inspection or migration
|
|
91
|
+
history validation failed.
|
|
92
|
+
|
|
86
93
|
If a custom injected client does not use the provider's standard URL env var,
|
|
87
94
|
list that exact variable under `providerAudit.ignoreRequiredEnv` in
|
|
88
95
|
`beignet.config.ts`. The exception affects static CLI audit only.
|
|
@@ -177,7 +184,8 @@ the current transaction unless rebuilt from `tx`.
|
|
|
177
184
|
## Gotchas
|
|
178
185
|
|
|
179
186
|
- The provider installs `ctx.ports.db`; the app still owns schema,
|
|
180
|
-
migrations, repository interfaces, seed/reset scripts, and Drizzle
|
|
187
|
+
migrations, repository interfaces, seed/reset/status scripts, and Drizzle
|
|
188
|
+
config.
|
|
181
189
|
- `ctx.ports.db.drizzle` is an infra escape hatch. Do not make it the normal
|
|
182
190
|
dependency for contracts, use cases, policies, routes, or UI.
|
|
183
191
|
- Register Drizzle before app-local providers that call `ports.db.drizzle` in
|
|
@@ -205,7 +213,9 @@ the current transaction unless rebuilt from `tx`.
|
|
|
205
213
|
and drain from a worker, cron route, or explicit outbox drain route.
|
|
206
214
|
|
|
207
215
|
Generate and migrate the backing tables before booting code that depends on
|
|
208
|
-
these ports.
|
|
216
|
+
these ports. In deployment, serialize one migration job per environment,
|
|
217
|
+
verify it with `beignet db status`, then run `beignet preflight --connect`.
|
|
218
|
+
Do not migrate independently from every web replica.
|
|
209
219
|
|
|
210
220
|
## Testing
|
|
211
221
|
|