CUPUM / nplex

Plateforme de valorisation de petits projets d'architecture et d'aménagement à Montréal.
https://www.nplex.design
4 stars 0 forks source link

Task: Determine database pooled connection lifecycle and management in serverless #180

Closed iolyd closed 5 months ago

iolyd commented 1 year ago

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 every handle hook sequence and close its connection after resolve(event) (but before returning the result).

Read

iolyd commented 5 months ago

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.