@beignet/provider-db-drizzle 0.0.46 → 0.0.48

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 CHANGED
@@ -1,5 +1,13 @@
1
1
  # @beignet/provider-db-drizzle
2
2
 
3
+ ## 0.0.48
4
+
5
+ ### Patch Changes
6
+
7
+ - 728c942: Add read-only migration status reports, connected validation, stable generated migration hashes, preflight pending detection, generated Drizzle status scripts, and serialized deployment guidance.
8
+
9
+ ## 0.0.47
10
+
3
11
  ## 0.0.46
4
12
 
5
13
  ## 0.0.45
package/README.md CHANGED
@@ -126,6 +126,7 @@ normal app-owned migration flow:
126
126
  ```bash
127
127
  bun beignet db generate
128
128
  bun beignet db migrate
129
+ bun beignet db status
129
130
  ```
130
131
 
131
132
  Use `--tables audit,idempotency,outbox` to select a subset when adopting one
@@ -487,9 +488,13 @@ transactions, outbox rows, idempotency rows, or migration assumptions.
487
488
 
488
489
  ## Deployment notes
489
490
 
490
- Run migrations before booting code that depends on new schema. Keep repository
491
- interfaces app-owned so switching SQLite, Postgres, or MySQL changes infra
492
- wiring instead of contracts, use cases, policies, or routes.
491
+ Run one serialized migration job per environment before booting code that
492
+ depends on new schema, then verify the target with `beignet db status` and
493
+ `beignet preflight --connect`. Do not migrate from every web replica. Status is
494
+ read-only and cannot prevent a race; use the deployment platform's concurrency
495
+ lock or an app-owned database advisory-lock wrapper. Keep repository interfaces
496
+ app-owned so switching SQLite, Postgres, or MySQL changes infra wiring instead
497
+ of contracts, use cases, policies, or routes.
493
498
 
494
499
  ## Unit of work
495
500
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@beignet/provider-db-drizzle",
3
- "version": "0.0.46",
3
+ "version": "0.0.48",
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": {
@@ -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 config.
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