mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-24 18:04:32 +02:00
sqlite-utils create-index command, closes #14
This commit is contained in:
parent
7784b924a1
commit
8a5d0d80c3
3 changed files with 95 additions and 0 deletions
17
docs/cli.rst
17
docs/cli.rst
|
|
@ -221,6 +221,23 @@ After running the above ``dogs.json`` example, try running this::
|
|||
|
||||
This will replace the record for id=2 (Pancakes) with a new record with an updated age.
|
||||
|
||||
.. _cli_create_index:
|
||||
|
||||
Creating indexes
|
||||
================
|
||||
|
||||
You can add an index to an existing table using the ``create-index`` subcommand::
|
||||
|
||||
$ sqlite-utils create-index mydb.db mytable col1 [col2...]
|
||||
|
||||
This can be used to create indexes against a single column or multiple columns.
|
||||
|
||||
The name of the index will be automatically derived from the table and columns. To specify a different name, use ``--name=name_of_index``.
|
||||
|
||||
Use the ``--unique`` option to create a unique index.
|
||||
|
||||
Use ``--if-not-exists`` to avoid attempting to create the index if one with that name already exists.
|
||||
|
||||
.. _cli_fts:
|
||||
|
||||
Configuring full-text search
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue