@beignet/provider-db-drizzle 0.0.24 → 0.0.26
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 +12 -0
- package/README.md +41 -0
- package/dist/mysql/schema.d.ts +787 -0
- package/dist/mysql/schema.d.ts.map +1 -0
- package/dist/mysql/schema.js +66 -0
- package/dist/mysql/schema.js.map +1 -0
- package/dist/postgres/schema.d.ts +787 -0
- package/dist/postgres/schema.d.ts.map +1 -0
- package/dist/postgres/schema.js +66 -0
- package/dist/postgres/schema.js.map +1 -0
- package/dist/sqlite/schema.d.ts +873 -0
- package/dist/sqlite/schema.d.ts.map +1 -0
- package/dist/sqlite/schema.js +66 -0
- package/dist/sqlite/schema.js.map +1 -0
- package/package.json +16 -2
- package/skills/database-provider/SKILL.md +190 -0
- package/src/mysql/schema.ts +99 -0
- package/src/postgres/schema.ts +93 -0
- package/src/sqlite/schema.ts +93 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @beignet/provider-db-drizzle
|
|
2
2
|
|
|
3
|
+
## 0.0.26
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 104302c: Refresh package-shipped TanStack Intent skills and add package skills for Drizzle database providers, Better Auth, React Hook Form, and React uploads.
|
|
8
|
+
|
|
9
|
+
## 0.0.25
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 1f84b39: Add provider table metadata diagnostics, Drizzle operational schema exports, and `beignet db schema generate` for app-owned migration flows.
|
|
14
|
+
|
|
3
15
|
## 0.0.24
|
|
4
16
|
|
|
5
17
|
## 0.0.23
|
package/README.md
CHANGED
|
@@ -72,6 +72,14 @@ bun add @beignet/provider-db-drizzle @beignet/core drizzle-orm mysql2
|
|
|
72
72
|
Doctor also checks standard Drizzle config, schema exports, database scripts,
|
|
73
73
|
seed/reset entrypoints, and provider registration drift in generated apps.
|
|
74
74
|
|
|
75
|
+
## Agent skills
|
|
76
|
+
|
|
77
|
+
This package ships a TanStack Intent skill for coding agents:
|
|
78
|
+
`@beignet/provider-db-drizzle#database-provider`. Load it when wiring Drizzle
|
|
79
|
+
providers, schema placement, Drizzle config, `DbPort` typing, repository
|
|
80
|
+
adapters, Unit of Work, audit, idempotency, outbox tables, migrations,
|
|
81
|
+
seed/reset helpers, devtools query instrumentation, or database doctor drift.
|
|
82
|
+
|
|
75
83
|
## Setup
|
|
76
84
|
|
|
77
85
|
### 1. Define your schema
|
|
@@ -97,6 +105,26 @@ export const todos = sqliteTable("todos", {
|
|
|
97
105
|
export { todos } from "./todos";
|
|
98
106
|
```
|
|
99
107
|
|
|
108
|
+
If the app uses Beignet's Drizzle-backed operational ports for audit,
|
|
109
|
+
idempotency, or outbox, generate the provider-owned table exports into the app
|
|
110
|
+
schema:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
bun beignet db schema generate
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
That writes `infra/db/schema/beignet.ts` and adds
|
|
117
|
+
`export * from "./beignet";` to `infra/db/schema/index.ts`. After that, run the
|
|
118
|
+
normal app-owned migration flow:
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
bun beignet db generate
|
|
122
|
+
bun beignet db migrate
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Use `--tables audit,idempotency,outbox` to select a subset when adopting one
|
|
126
|
+
operational port at a time.
|
|
127
|
+
|
|
100
128
|
### 2. Configure Drizzle CLI (build-time)
|
|
101
129
|
|
|
102
130
|
Create `drizzle.config.ts` in your app root for the Drizzle CLI:
|
|
@@ -1079,6 +1107,19 @@ All exports below come from `@beignet/provider-db-drizzle/sqlite`. The
|
|
|
1079
1107
|
provider options (`pool`, and `mode` for MySQL), the `DbPort` escape hatch
|
|
1080
1108
|
(`pool` instead of `client`), and the mutation error class names.
|
|
1081
1109
|
|
|
1110
|
+
### Schema subpaths
|
|
1111
|
+
|
|
1112
|
+
Each backend also exports canonical Beignet operational table definitions:
|
|
1113
|
+
|
|
1114
|
+
- `@beignet/provider-db-drizzle/sqlite/schema`
|
|
1115
|
+
- `@beignet/provider-db-drizzle/postgres/schema`
|
|
1116
|
+
- `@beignet/provider-db-drizzle/mysql/schema`
|
|
1117
|
+
|
|
1118
|
+
Each schema subpath exports `auditLog`, `idempotencyRecords`, and
|
|
1119
|
+
`outboxMessages`. Prefer `beignet db schema generate` in apps so the selected
|
|
1120
|
+
exports are re-exported from your app schema index before Drizzle Kit generates
|
|
1121
|
+
migrations.
|
|
1122
|
+
|
|
1082
1123
|
### `DbPort<TSchema>`
|
|
1083
1124
|
|
|
1084
1125
|
The port interface exposed on `ctx.ports.db`:
|