]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Don't pre-calc inserted primary key if no getter
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 10 Feb 2021 15:36:52 +0000 (10:36 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 10 Feb 2021 15:36:52 +0000 (10:36 -0500)
commit89dc4562adb38367ee5fabbcc04ee44968af4906
tree0099d5317799c7c93b5427be73bb77e841c5b3f4
parentc36391bcd2936ee3eca0f6e359da5de6fcd93bd1
Don't pre-calc inserted primary key if no getter

the _setup_ins_pk_from_empty() method provides a placeholder
result for inserted_primary_key_rows that is not typically
going to be invoked.  For an executemany (or even execute)
that isn't already stating it wants primary key values
up front, defer this computation until explicitly requested.

Change-Id: I6295eafbccc96a0422b9cac34e79db7924c702ca
References: https://github.com/sqlalchemy/sqlalchemy/discussions/5893#discussioncomment-356155
lib/sqlalchemy/engine/default.py