mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-25 10:24:32 +02:00
Added sqlite-utils create-view command, closes #107
This commit is contained in:
parent
78264b738c
commit
d16097231c
3 changed files with 113 additions and 0 deletions
15
docs/cli.rst
15
docs/cli.rst
|
|
@ -401,6 +401,21 @@ You can specify foreign key relationships between the tables you are creating us
|
|||
|
||||
If a table with the same name already exists, you will get an error. You can choose to silently ignore this error with ``--ignore``, or you can replace the existing table with a new, empty table using ``--replace``.
|
||||
|
||||
|
||||
.. _cli_create_view:
|
||||
|
||||
Creating views
|
||||
==============
|
||||
|
||||
You can create a view using the ``create-view`` command::
|
||||
|
||||
$ sqlite-utils create-view mydb.db version "select sqlite_version()"
|
||||
|
||||
$ sqlite-utils mydb.db "select * from version"
|
||||
[{"sqlite_version()": "3.31.1"}]
|
||||
|
||||
Use ``--replace`` to replace an existing view of the same name, and ``--ignore`` to do nothing if a view already exists.
|
||||
|
||||
.. _cli_add_column:
|
||||
|
||||
Adding columns
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue