Throw an assertion error when on_duplicate_update is specified on db.insert with no key_columns

This commit is contained in:
Fabio Manganiello 2022-09-04 16:02:37 +02:00
parent 0143dac216
commit 4682fb4210
Signed by untrusted user: blacklight
GPG Key ID: D90FBA7F76362774
1 changed files with 5 additions and 0 deletions

View File

@ -292,6 +292,11 @@ class DbPlugin(Plugin):
}
"""
if on_duplicate_update:
assert (
key_columns
), 'on_duplicate_update requires key_columns to be specified'
if key_columns is None:
key_columns = []