mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-24 18:04:32 +02:00
sqlite-utils rows --where and -p options, closes #382
This commit is contained in:
parent
324ebc3130
commit
3b632f0a7e
4 changed files with 57 additions and 18 deletions
10
docs/cli.rst
10
docs/cli.rst
|
|
@ -449,6 +449,16 @@ You can use the ``-c`` option to specify a subset of columns to return::
|
|||
[{"age": 4, "name": "Cleo"},
|
||||
{"age": 2, "name": "Pancakes"}]
|
||||
|
||||
You can filter rows using a where clause with the ``--where`` option::
|
||||
|
||||
$ sqlite-utils rows dogs.db dogs -c name --where 'name = "Cleo"'
|
||||
[{"name": "Cleo"}]
|
||||
|
||||
Or pass named parameters using ``--where`` in combination with ``-p``::
|
||||
|
||||
$ sqlite-utils rows dogs.db dogs -c name --where 'name = :name' -p name Cleo
|
||||
[{"name": "Cleo"}]
|
||||
|
||||
Use ``--limit N`` to only return the first ``N`` rows. Use ``--offset N`` to return rows starting from the specified offset.
|
||||
|
||||
.. _cli_tables:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue