Thanks, Simon. Good suggestion, but these are databases and not
schema within a database. If I use the schema="MyDatabase." (
notice the ".") and quote_schema=False, the table names come out
like I want, but look at what happens to the label here:

SELECT [LeftTable_1].description AS [MyDatabase._LeftTab_1]
FROM MyDatabase..[LeftTable] AS [LeftTable_1]
WHERE [LeftTable_1].id = %(param_1)s

That is really abusing the schema feature, so this is not a bug... I
just wish there were a databasename="Foo" option for Table() so I
could use these ugly databases the way they are. :(

On Wed, Oct 14, 2009 at 11:51 AM, King Simon-NFHD78 <[email protected]
> wrote:

>
> > -----Original Message-----
> > From: [email protected]
> > [mailto:[email protected]] On Behalf Of Luke Arno
> > Sent: 14 October 2009 16:41
> > To: [email protected]
> > Subject: [sqlalchemy] Re: ORM Many to Many Across Two Databases
> >
> > It looks like if I put the relation on the obj mapped to the DB where
> > the association table is _not_, it works in one direction.
> > (So, in the
> > example Right.lefts can work but Left.rights cannot.) When trying to
> > use Left.rights, it looks for the table in the wrong database.
> >
> > It appears that it would be fine if I could just get the
> > table names all
> > qualified with database name in the issued SQL. Is there a way to
> > make that happen, by any chance?
> >
>
> You can do this by using a single engine and metadata, and passing a
> 'schema' parameter when defining your tables:
>
> http://www.sqlalchemy.org/docs/05/metadata.html#specifying-the-schema-na
> me
>
> Hope that helps,
>
> Simon
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to