Sorry, I missed an example in my first message. The problem arises
when you try to query across two databases:

Session.query(MainUser).join((OtherUser, OtherUser.id == MainUser.id))

Would normally products something like:

SELECT * FROM MainUser INNER JOIN OtherUser ON OtherUser.id =
MainUser.id

When you really need the schema for the table that is in the other
database:


SELECT * FROM MainUser INNER JOIN other.OtherUser ON OtherUser.id =
MainUser.id

On May 7, 9:46 am, "Michael Bayer" <mike...@zzzcomputing.com> wrote:
> Aculeus wrote:
>
> > This has a severe problem having to hard set the schema when that
> > value should be part of configuration. Instead the table should assume
> > the schema of the engine that it's metadata is bound to and
> > automatically appear in queries where there is a table from a
> > different schema than the one the query is being ran through.
>
> if your engine() connects using a certain schema as the "default" schema,
> then no explicit "schema" argument is necessary for tables that are
> accessed by that engine within that schema.  "schema" is only used when
> accessing a non-default schema from a single engine.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to