Passing database connections #2421
Unanswered
jollyrogue
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Do you use same db schema for all users or user/company has their own schema (multi tenancy)? In case of former see #2075 (comment) NB: it would be better if you do not call DB from handler directly and instead create service-like structs that you call from handler. In that case you separate your transport (HTTP) layer from service (business) layer. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What's the best way to handle passing database connections into route functions?
I've been creating a global variable to handle the database connections in some simple applications I've written, but I'm wondering if there is a better way.
There is creating a custom context, but attaching a database to it doesn't seem like a great idea.
Beta Was this translation helpful? Give feedback.
All reactions