I am using sqlite3 in python and I have multiple database files which I now want to combine into one big file. Each database is associated with a specific topic but they all share the same structure. I'll be querying them separately -- I just want to combine them into one file so that it's easier to move them around.
One dirty way I can think of goes like this:
create_string = 'CREATE TABLE %s_table1 (id INTEGER PRIMARY KEY, doca INTEGER, docb INTEGER)' %topic1
cur.execute(create_string)
This way, I'll have the topic name prefixed with each table and when I do a query, I'll have to construct a query string with the appropriate topic name. But there should be a better way to solve this. Am I missing something obvious?
How to Merge Multiple Database files in SQLite?
How can I merge many SQLite databases?
I've already looked at these and it seems my problem is easier to solve than theirs, but I still can't find a better solution.
Thanks in advance for any help.