Thank you. That makes sense.  

On Wednesday, April 17, 2013 at 4:27 PM, Michael Bayer wrote:

> 
> On Apr 17, 2013, at 3:37 PM, Randy Shults <randy.c.shu...@gmail.com 
> (mailto:randy.c.shu...@gmail.com)> 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 a topic in the Google 
> Groups "sqlalchemy" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/sqlalchemy/ZhksMS_1DCU/unsubscribe?hl=en.
> To unsubscribe from this group and all its topics, send an email to 
> sqlalchemy+unsubscr...@googlegroups.com 
> (mailto:sqlalchemy+unsubscr...@googlegroups.com).
> To post to this group, send email to sqlalchemy@googlegroups.com 
> (mailto:sqlalchemy@googlegroups.com).
> Visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
> 
> 


-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to