You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm wondering: Assuming all operations are properly awaited, if it's necessary to manually call sql.end() at the end when using Cloudflare Workers?
This library's docs says Cloudflare Workers allows this package to use the TCP socket API, which seems to automatically cleanup connection "on EOF". This, alongside the following examples, seems to imply it's not necessary:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hello!
I'm using
postgres
inside a Cloudflare Worker.I'm wondering: Assuming all operations are properly awaited, if it's necessary to manually call
sql.end()
at the end when using Cloudflare Workers?This library's docs says Cloudflare Workers allows this package to use the TCP socket API, which seems to automatically cleanup connection "on EOF". This, alongside the following examples, seems to imply it's not necessary:
However, I found this other example using this same library where the
sql.end
is observed:Is this something specific to Hyperdrive connections, are some of the docs outdated or am I missing something else?
Sorry if it's not the right place to ask, but since the docs mention Cloudflare Workers with an example, I thought I'd ask.
Beta Was this translation helpful? Give feedback.
All reactions