mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-08-06 09:24:11 +02:00
sqlite-utils --attach option, closes #236
This commit is contained in:
parent
999f099cbe
commit
2ba5588881
4 changed files with 49 additions and 2 deletions
16
docs/cli.rst
16
docs/cli.rst
|
|
@ -122,7 +122,21 @@ You can use the ``--json-cols`` option to automatically detect these JSON column
|
|||
}
|
||||
]
|
||||
}
|
||||
]-
|
||||
]
|
||||
|
||||
.. cli_attach:
|
||||
|
||||
Attaching additional databases
|
||||
------------------------------
|
||||
|
||||
SQLite supports cross-database SQL queries, which can join data from tables in more than one database file.
|
||||
|
||||
You can attach one or more additional databases using the ``--attach`` option, providing an alias to use for that database and the path to the SQLite file on disk.
|
||||
|
||||
This example attaches the ``books.db`` database under the alias ``books`` and then runs a query that combines data from that database with the default ``dogs.db`` database::
|
||||
|
||||
sqlite-utils dogs.db --attach books books.db \
|
||||
'select * from sqlite_master union all select * from books.sqlite_master'
|
||||
|
||||
.. _cli_query_csv:
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue