Setup drizzle using 'pg' instead of 'postgres' driver package

I'm trying to setup my drizzle using pg instead of postgres due to the bug for row locking according to this post

helpTransaction not respecting locks

however it said that the parameter was not supported using the pg client

import {Client} from 'pg';
import { drizzle } from 'drizzle-orm/postgres-js';
import schema from '@/(server)/_schema/index';

const queryClient = new Client({
  user: Option.user,
  host: Option.host,
  database: Option.database,
  password: Option.pass,
  port: Option.port,
});

await queryClient.connect()

// Error on passing queryClient as parameter
export const db = drizzle(queryClient, {schema: schema});
image.png
Was this page helpful?