Hi, I just started using SQLC and this seems promising! It really helps in separating the boiler plate code with strong typed methods!
Now I do have a question: How should I implement switching the database connection at runtime?
I do have a map of db pools (one for each tenant) and want to switch based on the tenantID in the JWT.
Do I need to initialise every time again? That feels wrong to me...
func New(db DBTX) *Queries {
return &Queries{db: db}
}
What are your ideas? A small example would be really helpful.