Add --extract option to insert/upsert commands

Wires the extracts= Python API feature through the CLI so imports can
create lookup tables in one step: --extract species for a table named
after the column, or --extract species:Species for a custom name.

Closes #352
This commit is contained in:
Parker Gurney 2026-08-05 14:22:45 -07:00
commit d4d075c924
5 changed files with 111 additions and 0 deletions

View file

@ -1409,6 +1409,8 @@ To extract the ``species`` column out to a separate ``Species`` table, you can d
``None`` values are not extracted: no record is created for them in the lookup table and the column value stays ``null``.
The ``sqlite-utils insert`` and ``sqlite-utils upsert`` commands expose this as the ``--extract`` option, see :ref:`cli_insert_extract`.
.. _python_api_m2m:
Working with many-to-many relationships