forked from RishabhK103/claude-code
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdrizzle.config.ts
More file actions
26 lines (24 loc) · 765 Bytes
/
drizzle.config.ts
File metadata and controls
26 lines (24 loc) · 765 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import { defineConfig } from 'drizzle-kit'
import { homedir } from 'os'
import { resolve } from 'path'
const databaseUrl = process.env.DATABASE_URL ?? ''
const isPostgres =
databaseUrl.startsWith('postgres://') ||
databaseUrl.startsWith('postgresql://')
export default defineConfig(
isPostgres
? {
dialect: 'postgresql',
schema: './src/server/db/schema/postgres.ts',
out: './src/server/db/migrations',
dbCredentials: { url: databaseUrl },
}
: {
dialect: 'sqlite',
schema: './src/server/db/schema/sqlite.ts',
out: './src/server/db/migrations',
dbCredentials: {
url: process.env.SQLITE_PATH ?? resolve(homedir(), '.claude', 'web', 'claude-code.db'),
},
}
)