diff options
| author | Zaid-maker <53424436+Zaid-maker@users.noreply.github.com> | 2025-06-24 16:59:44 +0500 |
|---|---|---|
| committer | Zaid-maker <53424436+Zaid-maker@users.noreply.github.com> | 2025-06-24 16:59:44 +0500 |
| commit | 62051de6c11dde40e2929c030e4418f87b137e42 (patch) | |
| tree | 3492ed2abd6a127512a6ce09543bcf770bcd53d5 /packages/db/src/index.ts | |
| parent | 7c83b8e70b2024d79f053bd40e6f633969c2c1f5 (diff) | |
| parent | 900deab065ef17941262f48524af786cac302945 (diff) | |
| download | opencut-62051de6c11dde40e2929c030e4418f87b137e42.tar.gz | |
Merge branch 'main' into implement-workflows
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 |
