diff options
| author | Hyteq <DerpsDer.es@gmail.com> | 2025-06-24 11:23:40 +0300 |
|---|---|---|
| committer | Hyteq <DerpsDer.es@gmail.com> | 2025-06-24 11:23:40 +0300 |
| commit | 140880a444339e67e641abe3d0496e2915af92d7 (patch) | |
| tree | da0db554d468fb672e26c5a031803a9e3134e74a /packages/db/src/index.ts | |
| parent | 65bff0d2da7ca32436bb5c081c1d4a83d539f11c (diff) | |
| download | opencut-140880a444339e67e641abe3d0496e2915af92d7.tar.gz | |
chore(turborepo): initial setup and config, move db to package
Diffstat (limited to 'packages/db/src/index.ts')
| -rw-r--r-- | packages/db/src/index.ts | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/packages/db/src/index.ts b/packages/db/src/index.ts new file mode 100644 index 00000000..b712776c --- /dev/null +++ b/packages/db/src/index.ts @@ -0,0 +1,16 @@ +import { drizzle } from "drizzle-orm/postgres-js"; +import postgres from "postgres"; +import * as schema from "./schema"; + +if (!process.env.DATABASE_URL) { + throw new Error("DATABASE_URL is not set"); +} + +// Create the postgres client +const client = postgres(process.env.DATABASE_URL); + +// Create the drizzle instance +export const db = drizzle(client, { schema }); + +// Re-export schema for convenience +export * from "./schema";
\ No newline at end of file |
