Allow sqlite-utils upsert to infer --pk from existing table

This commit is contained in:
Simon Willison 2026-07-07 18:09:12 -07:00
commit ebafb84c93
4 changed files with 30 additions and 6 deletions

View file

@ -321,6 +321,8 @@ See :ref:`cli_upsert`.
incoming record has a primary key that matches an existing record the existing
record will be updated.
If the table already exists and has a primary key, --pk can be omitted.
Example:
echo '[
@ -330,7 +332,6 @@ See :ref:`cli_upsert`.
Options:
--pk TEXT Columns to use as the primary key, e.g. id
[required]
--flatten Flatten nested JSON objects, so {"a": {"b": 1}}
becomes {"a_b": 1}
--nl Expect newline-delimited JSON