Closed lcsqlpete closed 3 years ago
In some of case, switching database will be connecting different host or different configuration. It's need to create a new connection for that.
You can create a connection class to manage all the database connections in project, and switch it what you want.
Both databases are on exactly the same connection, same host, same user, same password so opening a second connection is not necessary.
This is a feature that is needed.
Clearly we need it
My application uses two mySQL databases on the same db host with 90% of the queries coming from one database which I name in the connect method and 10% from the other. For the 10%, I would like to specify the database name as part of the table parameter of the select method, e.g mydb.mytable, so I don't have to open a second connection to the same host but I am getting error "Uncaught InvalidArgumentException: Incorrect table name".
Am I doing something wrong or does medoo not allow this? If the latter, is there some other way to do this without opening a second connection.