Does drizzle support querying across multiple mysql databases (same mysql server)?
Here's some 'rough' code to demonstrate what I'm attempting to do... basically I have tables in two mysql databases (same mysql server). I can write SQL to query data from tables in different databases, but am struggling to get drizzle to do it. I saw that drizzle allows defining the database with mysqlSchema().
Looking at the query that is being generated, it is not using the mysql database (mysqlSchema). When the query is generated, it thinks both tables in the same mysql database (mysqlSchema).
Maybe the 'rqb' doesn't support multiple databases or does drizzle not support querying across them yet?
4 Replies
RQB currently doesn't support multiple schemas. This will likely be addressed in RQB v2
Any update on this? I have a use case for multiple databases on the same server. @asch where did you get up to without being able to use RQB?
If you need to query across databases then I believe you have to use db.select(). If you just need to access both databases then just create multiple connections.
yea, i need to query across the 2 DBs. Did you ever actually try it? Using db.select, how would I target the different databases?