Driver error callback

I'm trying to upgrade to 0.3.4 with the new drizzle client and am wondering how you are supposed to access driver callback events like 'error' or 'end'. My current code looks like this:
const pg = new pg.Client(...);
const db = drizzle(pg, { schema });
pg.on("error", () => ...)
const pg = new pg.Client(...);
const db = drizzle(pg, { schema });
pg.on("error", () => ...)
1 Reply
Mario564
Mario5642mo ago
Aside fomr how you're doing right now (which is also correct), you can also do db.$client. The $client method being the same as the pg variable you declared.

Did you find this page helpful?