SQLite allows a program to attach multiple databases to a single connection, and you are able to reference tables in these additional databases with things like schema.table as the name of a table.
Is there a way to do this in SQLAlchemy? I am working on an application that will want to import data from another database (that uses basically the same schema, maybe just a subset of the schema of the main database), and get the updates needed to perform by using a join on unique keys (that aren't necessarily the primary key). After finishing the update, and pulling the information in (remapping rowid/primary keys <-> foreign keys that didn't match between the databases) I would then detach this database (which ideally I opened as a read only connection). I can see how to establish multiple engines and sessions, but then I can't do the join between the databases which would let me do a lot of the work down in the database engine. I also have found being able to bind different sets of tables into different engines, but in my case the database will have the same set of tables, so this doesn't look to work. -- Richard Damon -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description. --- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/sqlalchemy/93932507-f4b8-d378-8db6-28636d7a0825%40Damon-Family.org.
