mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-23 01:14:31 +02:00
pk=['id'] now equivalent to pk='id', closes #181
This commit is contained in:
parent
7eda0532e8
commit
7c0ef116ed
2 changed files with 8 additions and 5 deletions
|
|
@ -330,6 +330,8 @@ class Database:
|
|||
column_defs = []
|
||||
# ensure pk is a tuple
|
||||
single_pk = None
|
||||
if isinstance(pk, list) and len(pk) == 1 and isinstance(pk[0], str):
|
||||
pk = pk[0]
|
||||
if isinstance(pk, str):
|
||||
single_pk = pk
|
||||
if pk not in [c[0] for c in column_items]:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue