Spaces:
Sleeping
Sleeping
Download lib/db/src/index.ts from Tahasaif3/DataExtract: direct link, hf CLI and curl.
- Browser
- Download file 416 Bytes
-
https://huggingface.co/spaces/Tahasaif3/DataExtract/resolve/main/lib/db/src/index.ts
- Command line
-
hf download hf://spaces/Tahasaif3/DataExtract/lib/db/src/index.ts
-
curl -L -o index.ts https://huggingface.co/spaces/Tahasaif3/DataExtract/resolve/main/lib/db/src/index.ts
416 Bytes
| import { drizzle } from "drizzle-orm/node-postgres"; | |
| import pg from "pg"; | |
| import * as schema from "./schema"; | |
| const { Pool } = pg; | |
| if (!process.env.DATABASE_URL) { | |
| throw new Error( | |
| "DATABASE_URL must be set. Did you forget to provision a database?", | |
| ); | |
| } | |
| export const pool = new Pool({ connectionString: process.env.DATABASE_URL }); | |
| export const db = drizzle(pool, { schema }); | |
| export * from "./schema"; | |