This probably works non-uniformly in postgres, etc, which have INSERT ... RETURNING syntax for accomplishing this.
What might work here is a :scalar type, which returns the first row / first column. (Arguably we need that anyway). Then :insert could fall back to this in cases where lastrowid isn't supported by the dbapi.
https://github.com/mcfunley/pugsql/pull/6 added an
:insert
return type which uses lastrowid to return the value inserted.This probably works non-uniformly in postgres, etc, which have
INSERT ... RETURNING
syntax for accomplishing this.What might work here is a
:scalar
type, which returns the first row / first column. (Arguably we need that anyway). Then:insert
could fall back to this in cases wherelastrowid
isn't supported by the dbapi.