Skip to content

Commit 590447d

Browse files
committed
Linked all schemas to drizzle.
1 parent 3bc8dfc commit 590447d

4 files changed

Lines changed: 7 additions & 2 deletions

File tree

β€Žbackend/src/database/index.tsβ€Ž

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
import { Pool } from "pg"
33
import { env } from '@/src/utils/env';
44
import { drizzle } from 'drizzle-orm/node-postgres';
5+
import * as schema from "@/src/database/schema/index"
56

67
export const pool = new Pool({
7-
connectionString: env.DATABASE_URL
8+
connectionString: env.DATABASE_URL
89
})
910

10-
export const db = drizzle(pool)
11+
export const db = drizzle(pool, { schema: schema })
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import type { quotes } from "@/src/database/schema/quote/quote.schema"
2+
3+
export type Quote = typeof quotes.$inferSelect
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from "@/src/database/schema/quote/quote.schema";
File renamed without changes.

0 commit comments

Comments
Β (0)