Query across multiple databases
ac-arcana opened this issue · 3 comments
I have a database with a Weapons table. I have another database that acts as a save file and contains a table which specifies the weapons a user has available, UserWeapons.
I want to write a query to get all rows from Weapons where the weapon id is found in UserWeapons.
Usually you can specify which db you are querying when you specify a table in SQL queries, however I do not see a way to specify multiple databases in one query if the query is tied to a db object.
Is there a way to specify a database or path in the query that is not documented?
Hello @ac-arcana
I think this might be possible with the ATTACH DATABASE command, see here:
https://sqlite.org/lang_attach.html
I'll take a look at this for sure! I'm guessing the syntax as in this documentation should work? So ATTACH filepath AS dbname. I'll try it and I'll close if this works for me. I knew vaguely about the attach command but wasn't sure it would work with this plugin due to the database variables
I'm gonna mark this as solved and closed. I don't think I truly understood the power of using SQL syntax in query, instead of just the built in functions. Anything normally done with SQL can be done this way.