-
-
Notifications
You must be signed in to change notification settings - Fork 66
Closed
Description
Is there a reason why the env.DATABASE_URL is dynamically imported?
This is the template generated with [email protected]:
// current
import { env } from '$env/dynamic/private';
import Database from 'better-sqlite3';
import { drizzle } from 'drizzle-orm/better-sqlite3';
if (!env.DATABASE_URL) throw new Error('DATABASE_URL is not set');
const client = new Database(env.DATABASE_URL);
export const db = drizzle(client);This is what I've been using:
// proposal
import { DATABASE_URL } from '$env/static/private';
import Database from 'better-sqlite3';
import { drizzle } from 'drizzle-orm/better-sqlite3';
const client = new Database(DATABASE_URL);
export const db = drizzle(client);Metadata
Metadata
Assignees
Labels
No labels