Docs for insert with multiple --pk, refs #621

This commit is contained in:
Simon Willison 2024-03-16 17:27:18 -07:00
commit 1feb0c4271

View file

@ -1088,11 +1088,13 @@ You can import all three records into an automatically created ``dogs`` table an
sqlite-utils insert dogs.db dogs dogs.json --pk=id
Pass ``--pk`` multiple times to define a compound primary key.
You can skip inserting any records that have a primary key that already exists using ``--ignore``:
.. code-block:: bash
sqlite-utils insert dogs.db dogs dogs.json --ignore
sqlite-utils insert dogs.db dogs dogs.json --pk=id --ignore
You can delete all the existing rows in the table before inserting the new records using ``--truncate``: