mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-23 09:24:31 +02:00
Extra parameters for .lookup(), passed to .insert() - closes #342
This commit is contained in:
parent
3b8abe6087
commit
93b21c230a
3 changed files with 110 additions and 4 deletions
|
|
@ -834,6 +834,17 @@ To create a species record with a note on when it was first seen, you can use th
|
|||
|
||||
The first time this is called the record will be created for ``name="Palm"``. Any subsequent calls with that name will ignore the second argument, even if it includes different values.
|
||||
|
||||
``.lookup()`` also accepts keyword arguments, which are passed through to the :ref:`insert() method <python_api_creating_tables>` and can be used to influence the shape of the created table. Supported parameters are:
|
||||
|
||||
- ``pk`` - which defaults to ``id``
|
||||
- ``foreign_keys``
|
||||
- ``column_order``
|
||||
- ``not_null``
|
||||
- ``defaults``
|
||||
- ``extracts``
|
||||
- ``conversions``
|
||||
- ``columns``
|
||||
|
||||
.. _python_api_extracts:
|
||||
|
||||
Populating lookup tables automatically during insert/upsert
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue