I am using SQLAlchemy without the ORM, i.e. using hand crafted SQL statememts to directly interact with the backend db. I am using PG as my backend db (psycopg2 as DB driver) in
User lastrowid
result = conn.execute("INSERT INTO user (name, country_id) VALUES ('Homer', 123)") result.lastrowid