Default command now executes queries, --csv or --json

I replaced the following commands:

    sqlite-utils json db.db "select * from table"
    sqlite-utils csv db.db "select * from table"

With a unified 'query' command, which is now set as the default:

    sqlite-utils db.db "select * from table"
    sqlite-utils db.db "select * from table" --csv
This commit is contained in:
Simon Willison 2019-02-22 17:40:21 -08:00
commit f2ca48c0da
5 changed files with 76 additions and 60 deletions

View file

@ -48,7 +48,7 @@ The ``Database()`` constructor can now accept a ``pathlib.Path`` object in addit
Two new commands: ``sqlite-utils csv`` and ``sqlite-utils json``
These commands execute a SQL query and return the results as CSV or JSON. See :ref:`cli_csv` and :ref:`cli_json` for more details.
These commands execute a SQL query and return the results as CSV or JSON. See :ref:`cli_query_csv` and :ref:`cli_query_json` for more details.
::