Skip to content
Source
Sign inSign up
TanStack/schemas
Open History to see the last commit

drizzle.config.ts

21 lines709 Bytes

1import { config } from 'dotenv'
2import { defineConfig } from 'drizzle-kit'
3​
4config({ path: ['.env.local', '.env'] })
5​
6// The d1-http driver targets the *remote* D1 database; only db:studio
7// needs the credentials. Schema changes go through generated migrations
8// that wrangler applies (never `drizzle-kit push`, which skips
9// d1_migrations):
10// pnpm run db:generate && pnpm run db:migrate
11export default defineConfig({
12 out: './drizzle',
13 schema: './src/db/schema.ts',
14 dialect: 'sqlite',
15 driver: 'd1-http',
16 dbCredentials: {
17 accountId: process.env.CLOUDFLARE_ACCOUNT_ID ?? '',
18 databaseId: process.env.CLOUDFLARE_DATABASE_ID ?? '',
19 token: process.env.CLOUDFLARE_D1_TOKEN ?? '',
20 },
21})