With the new stack, we are using neon's serverless pooler to allow for transactional queries with drizzle-orm. Yet, it is unclear if and when we must call pool.end() to close socket connections. Consequentially, it is also unclear if we can instantiate a singleton pool to create a db client that we use both for lucia and inside our request handlers or if we should instead create a single pool+client on every handle hook sequence and close its connection after resolve(event) (but before returning the result).
Could not find a clear answer on this and solving related issues with the authentication dependency we use would be quite challenge. Closing for now. Reopen if problems arise in production.
Task Description
With the new stack, we are using neon's serverless pooler to allow for transactional queries with drizzle-orm. Yet, it is unclear if and when we must call
pool.end()
to close socket connections. Consequentially, it is also unclear if we can instantiate a singleton pool to create a db client that we use both for lucia and inside our request handlers or if we should instead create a single pool+client on everyhandle
hook sequence and close its connection afterresolve(event)
(but before returning the result).Read