From 2e6bdec38c090a3d0915211ef67f6196d7362b37 Mon Sep 17 00:00:00 2001 From: syntaxbullet Date: Tue, 6 Jan 2026 18:52:25 +0100 Subject: [PATCH] refactor: switch Drizzle ORM from postgres-js to bun-sql driver. --- src/lib/DrizzleClient.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/lib/DrizzleClient.ts b/src/lib/DrizzleClient.ts index dde3c67..7b193bd 100644 --- a/src/lib/DrizzleClient.ts +++ b/src/lib/DrizzleClient.ts @@ -1,14 +1,13 @@ -import { drizzle } from "drizzle-orm/postgres-js"; -import postgres from "postgres"; +import { drizzle } from "drizzle-orm/bun-sql"; +import { SQL } from "bun"; import * as schema from "@db/schema"; import { env } from "@lib/env"; const connectionString = env.DATABASE_URL; -// Disable prefetch as it is not supported by "transaction" method -export const client = postgres(connectionString, { prepare: false }); +export const postgres = new SQL(connectionString); -export const DrizzleClient = drizzle(client, { schema }); +export const DrizzleClient = drizzle(postgres, { schema }); export const closeDatabase = async () => { - await client.end(); + await postgres.close(); }; \ No newline at end of file