mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-09-12 03:24:23 +02:00
Put PrimaryKeyRequired back in the right place
This commit is contained in:
parent
2ab894dd73
commit
ac9f8208c7
1 changed files with 3 additions and 0 deletions
|
|
@ -3316,6 +3316,9 @@ class Table(Queryable):
|
|||
if hash_id_columns and hash_id is None:
|
||||
hash_id = "id"
|
||||
|
||||
if upsert and (not pk and not hash_id):
|
||||
raise PrimaryKeyRequired("upsert() requires a pk")
|
||||
|
||||
assert not (hash_id and pk), "Use either pk= or hash_id="
|
||||
if hash_id_columns and (hash_id is None):
|
||||
hash_id = "id"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue