'Return the primary key for the row just inserted.
The return value is a list of scalar values
corresponding to the list of primary key columns
in the target table.
This only applies to single row :func:`.insert`
constructs which did not explicitly specify
:meth:`.Insert.returning`.
Note that primary key columns which specify a
server_default clause,
or otherwise do not qualify as "autoincrement"
columns (see the notes at :class:`.Column`), and were
generated using the database-side default, will
appear in this list as ``None`` unless the backend
supports "returning" and the insert statement executed
with the "implicit returning" enabled.
Raises :class:`~sqlalchemy.exc.InvalidRequestError` if the executed
statement is not a compiled expression construct
or is not an insert() construct.'

@util.memoized_property
def inserted_primary_key(self):

    if (not self.context.compiled):
        raise exc.InvalidRequestError('Statement    is    not    a    compiled    expression    construct.')
    elif (not self.context.isinsert):
        raise exc.InvalidRequestError('Statement    is    not    an    insert()    expression    construct.')
    elif self.context._is_explicit_returning:
        raise exc.InvalidRequestError("Can't    call    inserted_primary_key    when    returning()    is    used.")
    return self.context.inserted_primary_key
