Better validation for upsert --pk, closes #390

This commit is contained in:
Simon Willison 2022-01-25 19:19:39 -08:00
commit 2b20957b18
3 changed files with 79 additions and 59 deletions

View file

@ -253,8 +253,6 @@ See :ref:`cli_upsert`.
incoming record has a primary key that matches an existing record the existing
record will be updated.
The --pk option is required.
Example:
echo '[
@ -264,6 +262,7 @@ 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