Skip to content

Commit ac9f820

Browse files
committed
Put PrimaryKeyRequired back in the right place
1 parent 2ab894d commit ac9f820

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

sqlite_utils/db.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3316,6 +3316,9 @@ def insert_all(
33163316
if hash_id_columns and hash_id is None:
33173317
hash_id = "id"
33183318

3319+
if upsert and (not pk and not hash_id):
3320+
raise PrimaryKeyRequired("upsert() requires a pk")
3321+
33193322
assert not (hash_id and pk), "Use either pk= or hash_id="
33203323
if hash_id_columns and (hash_id is None):
33213324
hash_id = "id"

0 commit comments

Comments
 (0)