Why not pass a pointer to the db through the context of the HTTP request?

Why is it not advisable to pass a pointer to the database through the context of the HTTP request?

This thread might be related.

1 Like

Context is designed for request scoped things. The database handle typically survives over multiple requests, so it’s not request scoped. Passing it through a Context may be a misuse of the API, even if it’s technically possible to do so.

4 Likes

Thanks…

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.