Hmm, new to SQLAlchemy here, but if I want transactions, then I need
to go the Session route, correct?

On Jun 23, 2:48 pm, Michael Bayer <mike...@zzzcomputing.com> wrote:
> On Jun 23, 2011, at 5:08 PM, Wells Oliver wrote:
>
> > W/ psycopg2, you can do a cursor.execute(query, list) where list is an
> > actual python list of values : [1,2,3]
>
> > W/ SQLAlchemy, it seems the session.execute(query, values) will only
> > accept a dictionary for values. Am I missing something? Can I pass a
> > list instead? Thanks.
>
> I was a little surprised the docs don't refer to the fact that you should use 
> connection() for this case, so I updated them:
>
> http://www.sqlalchemy.org/docs/orm/session.html#sqlalchemy.orm.sessio...http://www.sqlalchemy.org/docs/core/connections.html#sqlalchemy.engin...
>
> "If a plain string is passed, it is first converted to a text() construct, 
> which here means that bind parameters should be specified using the format 
> :param. If raw DBAPI statement execution is desired, use Session.connection() 
> to acquire a Connection, then call its execute() method."

-- 
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