Hello , is it possible to set dynamic database connection on run time? I have Laravel application , I created a middleware where it gets subdomain and connects clients to its database , so its subdomain based multitenant application. I want to make remake my application with Adonis js , how can I achieve similar approach? I have 40 clients with 40 databases (each client has 80 to 400 concurrent users online) , my goal is serve api by sub domain with single adonis instance. Thank you in advance for your help.
Update: I checked documentation and saw Multiple Connections section , is it what I am looking for? If I define 40 database connections (all databases in same host, same schema ,same user name , same password , only database names are different) is it cause performance issues?
Update 2: I keep checking documentation , lucid#_connection My question is , can I select dynamic connection with lucid ? maybe pass a variable to connection function?
Update 3 : I managed to choose connection dynamically following this Multiple Connections section.
Now my question is , is it bad to have 40 database connections?