-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question - Database Context #24
Comments
Hey @WildEgo, could you please provide more infos Thanks! |
I'm thinking of playing with this SaaS framework so I was wondering, can I change the database connection on the fly, for example one request has Conn1 and the other has a Conn2, they connect thru a middleware and the data should be accessible on the resolver |
Yes, that's possible! You can just use the gorm plugin https://github.com/go-gorm/dbresolver or multiple db instances on a Acme struct (highly recommended) |
Thank you for the quick reply, I've looked a bit into DBResolver and it looked like it couldn't really do it since I got the data in the runtime, I've never tried that last one could you send me a couple of links? I was trying at the moment by running the connect function again but it got overwritten at the time it got to the resolver |
I am currently at vacation! I will update the demo on next Monday because multiple people got stuck at this point |
Thank you mate I didn't know, take ur time and enjoy ur vacation, thank u for this library, I've been going thru it and learning more GO thanks to it, truly appreciate ur work |
Hey guys was looking at this and seemed interesting, I was wondering can I change the database context on the fly?
Thank in advance!
The text was updated successfully, but these errors were encountered: