Skip to content

Commit 26b2cf3

Browse files
committed
Changelog for 1.1 + docs for --ignore/ignore=True
1 parent 50e2f94 commit 26b2cf3

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

docs/changelog.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
Changelog
33
===========
44

5+
.. _v1_1:
6+
7+
1.1 (2019-05-28)
8+
----------------
9+
10+
- Support for ``ignore=True`` / ``--ignore`` for ignoring inserted records if the primary key alread exists (`#21 <https://github.com/simonw/sqlite-utils/issues/21>`__) - documentation: :ref:`Inserting data (Python API) <python_api_bulk_inserts>`, :ref:`Inserting data (CLI) <cli_inserting_data>`
11+
- Ability to add a column that is a foreign key reference using ``fk=...`` / ``--fk`` (`#16 <https://github.com/simonw/sqlite-utils/issues/16>`__) - documentation: :ref:`Adding columns (Python API) <python_api_add_column>`, :ref:`Adding columns (CLI) <cli_add_column>`
512

613
.. _v1_0_1:
714

docs/cli.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,10 @@ You can import all three records into an automatically created ``dogs`` table an
224224

225225
$ sqlite-utils insert dogs.db dogs dogs.json --pk=id
226226

227+
You can skip inserting any records that have a primary key that already exists using ``--ignore``::
228+
229+
$ sqlite-utils insert dogs.db dogs dogs.json --ignore
230+
227231
You can also import newline-delimited JSON using the ``--nl`` option. Since `Datasette <https://datasette.readthedocs.io/>`__ can export newline-delimited JSON, you can combine the two tools like so::
228232

229233
$ curl -L "https://latest.datasette.io/fixtures/facetable.json?_shape=array&_nl=on" \

docs/python-api.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,8 @@ The ``foreign_keys`` argument takes a sequence of three-tuples, each one specify
164164
("author_id", "authors", "id")
165165
])
166166
167+
.. _python_api_bulk_inserts:
168+
167169
Bulk inserts
168170
============
169171

@@ -198,6 +200,8 @@ The function can accept an iterator or generator of rows and will commit them ac
198200
"name": "Name {}".format(i),
199201
} for i in range(10000)), batch_size=1000)
200202
203+
You can skip inserting any records that have a primary key that already exists using ``ignore=True``. This works with both ``.insert({...}, ignore=True)`` and ``.insert_all([...], ignore=True)``.
204+
201205
Upserting data
202206
==============
203207

0 commit comments

Comments
 (0)