mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-23 01:14:31 +02:00
Docs for insert with multiple --pk, refs #621
This commit is contained in:
parent
da92a30679
commit
1feb0c4271
1 changed files with 3 additions and 1 deletions
|
|
@ -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``:
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue