Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions packages/database/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import { Pool } from "pg";
import { drizzle } from "drizzle-orm/node-postgres";
import * as schema from "./schema";

const pool = new Pool({
host: process.env.POSTGRES_HOST,
port: Number(process.env.POSTGRES_PORT!),
database: process.env.POSTGRES_DATABASE,
user: process.env.POSTGRES_USER,
password: process.env.POSTGRES_PASSWORD,
ssl: true,
const db = drizzle({
schema: schema,
connection: {
host: process.env.POSTGRES_HOST,
port: Number(process.env.POSTGRES_PORT!),
database: process.env.POSTGRES_DATABASE,
user: process.env.POSTGRES_USER,
password: process.env.POSTGRES_PASSWORD,
ssl: process.env.NODE_ENV === "production" ? true : false,

Check warning on line 12 in packages/database/src/index.ts

View workflow job for this annotation

GitHub Actions / quality-checks / Lint

NODE_ENV is not listed as a dependency in the root turbo.json or workspace () turbo.json
},
});

const db = drizzle(pool, { schema });

const dbTestConnection = async () => {
try {
const result = await db.execute("SELECT NOW()");
Expand Down
Loading