drizzle-team / drizzle-orm

Headless TypeScript ORM with a head. Runs on Node, Bun and Deno. Lives on the Edge and yes, it's a JavaScript ORM too 😅
https://orm.drizzle.team
Apache License 2.0
24.52k stars 643 forks source link

[BUG]: node-postgres client doesn't have end function #3402

Open jansedlon opened 1 week ago

jansedlon commented 1 week ago

What version of drizzle-orm are you using?

0.36.0

What version of drizzle-kit are you using?

0.27.1

Describe the Bug

Give this code

import { drizzle } from "drizzle-orm/node-postgres";

export const db = await drizzle({
  schema: schema,
  connection: {
    // ...
  },
});

In tests i need to close the connection but there's no function called end in db.$client.end(). It's only exposed when manually creating pg Pool. Drizzle is not creating pool by itself?

Expected behavior

It should expose end function

Environment & setup

No response

gclego commented 1 week ago

deferred upgrade due to this. we are closing the connection on migration but v36 does not have any API for that