mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-16 02:40:39 +09:00
11 lines
283 B
TypeScript
11 lines
283 B
TypeScript
|
|
import { drizzle } from "drizzle-orm/postgres-js";
|
||
|
|
import postgres from "postgres";
|
||
|
|
import * as schema from "./schema/index.js";
|
||
|
|
|
||
|
|
export function createDb(url: string) {
|
||
|
|
const sql = postgres(url);
|
||
|
|
return drizzle(sql, { schema });
|
||
|
|
}
|
||
|
|
|
||
|
|
export type Db = ReturnType<typeof createDb>;
|