Re: [sqlalchemy] insert() and sa.func.something

2010-05-03 Thread Michael Bayer
On May 3, 2010, at 12:18 PM, Jon Nelson wrote: > On Mon, May 3, 2010 at 11:05 AM, Michael Bayer > wrote: >> you use values() for this: >> >> table.insert().values(col1=foo, col2=3, col3=func.custom_function('cheese')) >> >> if you want bind params: >> >> i = table.insert().values(col3=func.c

Re: [sqlalchemy] insert() and sa.func.something

2010-05-03 Thread Jon Nelson
On Mon, May 3, 2010 at 11:05 AM, Michael Bayer wrote: > you use values() for this: > > table.insert().values(col1=foo, col2=3, col3=func.custom_function('cheese')) > > if you want bind params: > > i = table.insert().values(col3=func.custom_function('mybind')) > conn.execute(i, {'col1':'foo', 'col2

Re: [sqlalchemy] insert() and sa.func.something

2010-05-03 Thread Michael Bayer
you use values() for this: table.insert().values(col1=foo, col2=3, col3=func.custom_function('cheese')) if you want bind params: i = table.insert().values(col3=func.custom_function('mybind')) conn.execute(i, {'col1':'foo', 'col2':3, 'mybind':'cheese'}) note that the name "col3" as a bind param

[sqlalchemy] insert() and sa.func.something

2010-05-03 Thread Jon Nelson
I have a custom sql function in postgresql that needs to be applied to some data that I would like to insert. The SQL for this might look like: INSERT INTO table (col1, col2, col3) VALUES ('foo', 3, custom_function('cheese')); How do I do this with sqlalchemy's lower-level table.insert() support?