Does the idea of last_inserted_ids exist for ORM?

I do
      session.add(someobj)
      session.commit()
and then want the id of the newly inserted object.

I can reference
      someobj.id
but this generates a select call to the database

If the insert was done with SQL syntax, something like:
       result = conn.execute(table.insert(etc......

I can directly access the inserted id as
      result.last_inserted_ids()
without another database call.

Can I get the id directly when using the ORM?

-- 
Mike Conley

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