Vertical partitioning places different kinds of objects, or different tables, across multiple databases:engine1 = create_engine('postgresql://db1')engine2 = create_engine('postgresql://db2')Session = sessionmaker(twophase=True)# bind User operations to engine 1, Account operations to engine 2Session.configure(binds={User:engine1, Account:engine2})session = Session()
Oh by the way, I'm using SQLite as backend.
--
You received this message because you are subscribed to a topic in the Google Groups "sqlalchemy" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sqlalchemy/tRlV984I_64/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sqlalchemy+...@googlegroups.com.
To post to this group, send email to sqlal...@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.
Oh by the way, I'm using SQLite as backend.
On Aug 14, 2015 2:04 AM, "Jinghui Niu" <niuji...@gmail.com> wrote:
I have three different DBs, one is person.db, another is journal.db, yet another is tag.db. In the documentation it reads:
Vertical partitioning places different kinds of objects, or different tables, across multiple databases:
engine1 = create_engine('postgresql://db1')engine2 = create_engine('postgresql://db2')
Session = sessionmaker(twophase=True)
# bind User operations to engine 1, Account operations to engine 2Session.configure(binds={User:engine1, Account:engine2})
session = Session()
I noticed that this example only deals with two DBs, and the parameter is called "twophase". I was wondering if there is any significance of "two" here? How can I fit my third DB in? Thanks.
----
You received this message because you are subscribed to a topic in the Google Groups "sqlalchemy" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sqlalchemy/tRlV984I_64/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sqlalchemy+...@googlegroups.com.
To post to this group, send email to sqlal...@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.
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 sqlalchemy+...@googlegroups.com.
If I still want to use SQLite, and I still need to do vertical partition, what can I do? Am I out of luck?
Just a thought, if I don't commit those three tables together in my application, can I just use 3 Session objects to commit them separately, without having to worry about this two phase issue? I want to go simple, not sure if I can handle this fancy stuff:)