mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-25 02:14:31 +02:00
sqlite-utils tables ... --schema option, closes #104
This commit is contained in:
parent
2b40710e9d
commit
147b52622d
3 changed files with 34 additions and 2 deletions
14
docs/cli.rst
14
docs/cli.rst
|
|
@ -162,7 +162,7 @@ You can list the names of tables in a database using the ``tables`` subcommand::
|
|||
{"table": "cats"},
|
||||
{"table": "chickens"}]
|
||||
|
||||
You can output this list in CSV using the ``-csv`` option::
|
||||
You can output this list in CSV using the ``--csv`` option::
|
||||
|
||||
$ sqlite-utils tables mydb.db --csv --no-headers
|
||||
dogs
|
||||
|
|
@ -188,6 +188,18 @@ Use ``--columns`` to include a list of columns in each table::
|
|||
{"table": "Gosh2", "count": 0, "columns": ["c1", "c2", "c3"]},
|
||||
{"table": "dogs", "count": 2, "columns": ["id", "age", "name"]}]
|
||||
|
||||
Use ``--schema`` to include the schema of each table::
|
||||
|
||||
$ sqlite-utils tables dogs.db --schema --table
|
||||
table schema
|
||||
------- -----------------------------------------------
|
||||
Gosh CREATE TABLE Gosh (c1 text, c2 text, c3 text)
|
||||
Gosh2 CREATE TABLE Gosh2 (c1 text, c2 text, c3 text)
|
||||
dogs CREATE TABLE [dogs] (
|
||||
[id] INTEGER,
|
||||
[age] INTEGER,
|
||||
[name] TEXT)
|
||||
|
||||
The ``--nl``, ``--csv`` and ``--table`` options are all available.
|
||||
|
||||
.. _cli_inserting_data:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue