mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-09-15 21:14:10 +02:00
sqlite-utils query - to read SQL from stdin, closes #765
This commit is contained in:
parent
353baf280d
commit
619770bf42
5 changed files with 48 additions and 0 deletions
10
docs/cli.rst
10
docs/cli.rst
|
|
@ -29,6 +29,16 @@ The ``sqlite-utils query`` command lets you run queries directly against a SQLit
|
|||
.. note::
|
||||
In Python: :ref:`db.query() <python_api_query>` CLI reference: :ref:`sqlite-utils query <cli_ref_query>`
|
||||
|
||||
Pass ``-`` as the SQL query to read the query from standard input. This is useful for longer queries that would otherwise require careful shell escaping, or for piping in SQL generated by another tool:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
echo "select * from dogs" | sqlite-utils query dogs.db -
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
sqlite-utils query dogs.db - < query.sql
|
||||
|
||||
.. _cli_query_json:
|
||||
|
||||
Returning JSON
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue