Hisbaan
Hisbaan
DTDrizzle Team
Created by divramod on 8/9/2024 in #help
how to infer the type of the db for the postgres driver
Try this:
const db = drizzle(pgPool, { schema });
export type DrizzleClient = typeof db;

// in the other file
import { DrizzleClient } from "the-first-file";
export const myFunction = async (db: DrizzleClient) => {
// ...
}
const db = drizzle(pgPool, { schema });
export type DrizzleClient = typeof db;

// in the other file
import { DrizzleClient } from "the-first-file";
export const myFunction = async (db: DrizzleClient) => {
// ...
}
3 replies