mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-23 01:14:31 +02:00
Documentation for create-triggers, refs #57
This commit is contained in:
parent
2ca63e3b2d
commit
3a4dddaca2
2 changed files with 10 additions and 0 deletions
|
|
@ -907,6 +907,12 @@ If you insert additional records into the table you will need to refresh the sea
|
|||
}, pk="id")
|
||||
dogs.populate_fts(["name", "twitter"])
|
||||
|
||||
A better solution is to use database triggers. You can set up database triggers to automatically update the full-text index using ``create_triggers=True``:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
dogs.enable_fts(["name", "twitter"], create_triggers=True)
|
||||
|
||||
``.enable_fts()`` defaults to using `FTS5 <https://www.sqlite.org/fts5.html>`__. If you wish to use `FTS4 <https://www.sqlite.org/fts3.html>`__ instead, use the following:
|
||||
|
||||
.. code-block:: python
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue