Drizzle and Cloudflare D1

I created a svelte repo using create cloudflare cli. I found
import { defineConfig } from 'drizzle-kit';
if (!process.env.DATABASE_URL) throw new Error('DATABASE_URL is not set');

export default defineConfig({
schema: './src/lib/server/db/schema.ts',

dbCredentials: {
url: process.env.DATABASE_URL
},

verbose: true,
strict: true,
dialect: 'sqlite'
});
import { defineConfig } from 'drizzle-kit';
if (!process.env.DATABASE_URL) throw new Error('DATABASE_URL is not set');

export default defineConfig({
schema: './src/lib/server/db/schema.ts',

dbCredentials: {
url: process.env.DATABASE_URL
},

verbose: true,
strict: true,
dialect: 'sqlite'
});
for the drizzle config. Isn't only for local sqlite db, isn't? How can I config for production D1 database? I know I have to configure D1 in wrangler file. But there is no need to configure d1 database inside drizzle config file? How about generate and migrate?
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?