MCPcopy Index your code
hub / github.com/sqlalchemy/sqlalchemy / last_inserted_params

Method last_inserted_params

lib/sqlalchemy/engine/cursor.py:1926–1950  ·  view source on GitHub ↗

Return the collection of inserted parameters from this execution. Raises :class:`~sqlalchemy.exc.InvalidRequestError` if the executed statement is not a compiled expression construct or is not an insert() construct.

(
        self,
    )

Source from the content-addressed store, hash-verified

1924 return self.context.compiled_parameters[0]
1925
1926 def last_inserted_params(
1927 self,
1928 ) -> Union[
1929 List[_MutableCoreSingleExecuteParams], _MutableCoreSingleExecuteParams
1930 ]:
1931 """Return the collection of inserted parameters from this
1932 execution.
1933
1934 Raises :class:`~sqlalchemy.exc.InvalidRequestError` if the executed
1935 statement is not a compiled expression construct
1936 or is not an insert() construct.
1937
1938 """
1939 if not self.context.compiled:
1940 raise exc.InvalidRequestError(
1941 "Statement is not a compiled expression construct."
1942 )
1943 elif not self.context.isinsert:
1944 raise exc.InvalidRequestError(
1945 "Statement is not an insert() expression construct."
1946 )
1947 elif self.context.executemany:
1948 return self.context.compiled_parameters
1949 else:
1950 return self.context.compiled_parameters[0]
1951
1952 @property
1953 def returned_defaults_rows(

Callers 1

test_empty_accessorsMethod · 0.80

Calls

no outgoing calls

Tested by 1

test_empty_accessorsMethod · 0.64