mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-25 02:14:31 +02:00
Refactored to table.search_sql() method, added --limit
This commit is contained in:
parent
2c00567aac
commit
de39e8db1e
4 changed files with 119 additions and 45 deletions
|
|
@ -907,6 +907,8 @@ You can specify a subset of columns to be returned using the ``-c`` option one o
|
|||
|
||||
$ sqlite-utils search mydb.db documents searchterm -c title -c created
|
||||
|
||||
By default all search results will be returned. You can use ``--limit 20`` to return just the first 20 results.
|
||||
|
||||
Use the ``--sql`` option to output the SQL that would be executed, rather than running the query::
|
||||
|
||||
$ sqlite-utils search mydb.db documents searchterm --sql
|
||||
|
|
@ -923,11 +925,9 @@ Use the ``--sql`` option to output the SQL that would be executed, rather than r
|
|||
[original]
|
||||
join [documents_fts] on [original].rowid = [documents_fts].rowid
|
||||
where
|
||||
[documents_fts] match :search
|
||||
[documents_fts] match :query
|
||||
order by
|
||||
rank desc
|
||||
limit
|
||||
20
|
||||
|
||||
.. _cli_vacuum:
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue