Re: [sqlalchemy] Postgresq Execute Many with Textual SQL Convenience Issue

2023-11-02 Thread Mike Bayer
On Thu, Nov 2, 2023, at 11:24 AM, mkmo...@gmail.com wrote: > Hi Mike, > > When using Core, we can do a bulk insert and bulk return with Postgresql > trivially: > > from sqlalchemy import table, column > t = table('foo', column('id'), column('bar') > > ins =

[sqlalchemy] Postgresq Execute Many with Textual SQL Convenience Issue

2023-11-02 Thread mkmo...@gmail.com
Hi Mike, When using Core, we can do a bulk insert and bulk return with Postgresql trivially: from sqlalchemy import table, column t = table('foo', column('id'), column('bar') ins = t.insert().values([{'bar': 'a'}, {'bar': 'b'}]).returning(foo.id) results = conn.execute(ins)