Can someone help me understand these 2 examples using pool and client?
I'm reading through the docs and see that in the 2 Neon examples, they use a pool and client. From what I understand, pools support multiple requests and a client doesn't.
The 2 questions I have are:
- When would I want to close the pool or client? I would assume I would want to keep it open in production so that I wouldn't need to open the connection again.
- Why would I use a client?
Here are the examples I'm looking at in the docs:
The docs show this example showing to close a pool (https://orm.drizzle.team/docs/installation-and-db-connection/postgresql/neon):
And the example provided uses a client https://github.com/drizzle-team/drizzle-orm/blob/main/examples/neon-cloudflare/src/index.ts
GitHub
drizzle-orm/index.ts at main · drizzle-team/drizzle-orm
TypeScript ORM that feels like writing SQL. Contribute to drizzle-team/drizzle-orm development by creating an account on GitHub.
0 Replies