You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sqlalchemy
Hi,
I have postgresql database with "records" table. There is "id" (bigserial unique primary key) column. I need to insert a row in such a way that I get id from newly inserted row.
ins = records.insert() results = conn.execute(ins)
I was unable to find a code example of how to add "RETURNING" functionality to records.insert() and how to find the id from the results.
Thanks
Mike Bayer
unread,
Nov 29, 2015, 11:53:48 AM11/29/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sqlal...@googlegroups.com
Please refer to the SQL Expression Language Tutorial, specifically the
last paragraph in this section:
Using the search box on the side of the documentation with the search
term "returning", you'll get more links that describe both implicit and
explicit use of RETURNING: