-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
facing db issues, connecting real-time almost done
- Loading branch information
Showing
7 changed files
with
240 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,18 @@ | ||
import { drizzle } from "drizzle-orm/node-postgres"; | ||
import { Pool } from "pg"; | ||
import * as schema from "./schema"; | ||
import dotenv from "dotenv"; | ||
dotenv.config(); | ||
|
||
const DATABASE_URL = process.env.DATABASE_URL; | ||
|
||
if (!DATABASE_URL) { | ||
console.error("DATABASE_URL is not defined in the environment variables"); | ||
process.exit(1); | ||
} | ||
|
||
const pool = new Pool({ | ||
connectionString: process.env.DATABASE_URL, | ||
connectionString: DATABASE_URL, | ||
}); | ||
|
||
export const db = drizzle(pool, { schema }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.