MySQL cross database selects?
Hello folks, wanted to ask MySQL cross database select related question. I have two tables in two different databases (schemas) and I want to do a select and join them - it works if I specify table names like "database.table" format.
What is the best way to handle this with drizzle?
I am thinking of:
if possible, having 1 connection pool
if possible, having database name attached to a table metadata for sql generation during selects
as a fallback to just use sql operator and specify manually the database aka "schema" names
2 Replies
Doesn't this work for you? https://orm.drizzle.team/docs/schemas
Drizzle ORM - next gen TypeScript ORM
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.
Nice, exactly that. I also found
mysqlTableWithSchema
function - seems to be the same - thanks alot!