d1-kyt 0.3.6 → 0.4.0
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 +12 -0
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -127,6 +127,18 @@ d1-kyt typegen # runs kysely-codegen
|
|
|
127
127
|
|
|
128
128
|
Reads `wrangler.jsonc` to detect `migrations_dir` automatically.
|
|
129
129
|
|
|
130
|
+
### Type Generation
|
|
131
|
+
|
|
132
|
+
`d1-kyt typegen` requires a `DATABASE_URL` environment variable pointing to a local SQLite database. kysely-codegen connects to this database to infer types.
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
# Apply migrations to local D1 database first
|
|
136
|
+
wrangler d1 migrations apply <db-name> --local
|
|
137
|
+
|
|
138
|
+
# Then generate types (local D1 databases live in .wrangler/)
|
|
139
|
+
DATABASE_URL=.wrangler/state/v3/d1/<db-id>/db.sqlite d1-kyt typegen
|
|
140
|
+
```
|
|
141
|
+
|
|
130
142
|
### Configuration
|
|
131
143
|
|
|
132
144
|
```typescript
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "d1-kyt",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Opinionated Cloudflare D1 + Kysely toolkit",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -44,6 +44,9 @@
|
|
|
44
44
|
"typescript": "5.9.3",
|
|
45
45
|
"vitest": "4.0.18"
|
|
46
46
|
},
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"better-sqlite3": "12.6.2"
|
|
49
|
+
},
|
|
47
50
|
"scripts": {
|
|
48
51
|
"build": "tsc",
|
|
49
52
|
"dev": "tsc --watch",
|