This is a DBAPI specific method and is only functional for those backends which support it, for statements where it is appropriate. It’s behavior is not consistent across backends.
I only tested this with sqlite (see tests/test_pugsql.py)
I'm wondering if there's a way to unify this with INSERT .. RETURNING syntax with postgres, etc. I'll merge this and open a ticket for thinking about that..
This allows
insert
statements to quickly use the inserted primary key, this is useful when auto increment primary keys are used.This feature is based on this api.
The api docs for sqlalchemy say this:
I only tested this with sqlite (see tests/test_pugsql.py)