From 1feb0c427124105fc90026bdcae470542a1cae1b Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Sat, 16 Mar 2024 17:27:18 -0700 Subject: [PATCH] Docs for insert with multiple --pk, refs #621 --- docs/cli.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/cli.rst b/docs/cli.rst index 0254ab1..d32549f 100644 --- a/docs/cli.rst +++ b/docs/cli.rst @@ -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``: