On Apr 17, 2013, at 3:37 PM, Randy Shults <[email protected]> wrote:
> Awesome thank you.
>
> So even though the Table object is attached to the metadata that was bound to
> the engine that uses a mysql connection, I have to explicitly set the dialect
> and compile when printing out the literal sql.
OK well here the answer is "sort of". *Some* SQL constructs, essentially those
that are "executable", will compile themselves according to the dialect they're
associated with; basically select(), insert(), update(), delete():
from sqlalchemy import Table, Column, MetaData, create_engine, String, select
m = MetaData()
t = Table('t', m, Column('x', String))
m.bind = create_engine("mysql://")
print select([t.c.x.contains("test")])
but just the column expression, since the expression isn't by itself
"executable" it doesn't spend the time searching for an Engine:
print t.c.x.contains("test")
So if you're only dealing with execute(), you should be OK. But this is
why I've really de-emphasized "bound metadata" overall, just makes things more
confusing.
--
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 post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.