mirror of
https://github.com/khairul169/github-leaderboard.git
synced 2025-04-28 15:39:31 +07:00
14 lines
357 B
TypeScript
14 lines
357 B
TypeScript
import { drizzle } from "drizzle-orm/postgres-js";
|
|
import postgres from "postgres";
|
|
import * as schema from "../models";
|
|
|
|
const DATABASE_PATH = import.meta.env.DATABASE_PATH;
|
|
if (!DATABASE_PATH) {
|
|
throw new Error("DATABASE_PATH is not set");
|
|
}
|
|
|
|
const queryClient = postgres(DATABASE_PATH);
|
|
const db = drizzle(queryClient, { schema });
|
|
|
|
export default db;
|