sqlite-utils is tested on Linux, macOS and Windows.
The sqlite-utils command-line tool can be installed on macOS using Homebrew:
brew install sqlite-utils
If you have it installed and want to upgrade to the most recent release, you can run:
brew upgrade sqlite-utils
sqlite-utils --version to confirm the installed version.
pip install sqlite-utils
pipx is a tool for installing Python command-line applications in their own isolated environments. You can use
pipx to install the
sqlite-utils command-line tool like this:
pipx install sqlite-utils
Alternatives to sqlite3#
sqlite-utils uses the
sqlite3 package bundled with the Python standard library.
Depending on your operating system, this may come with some limitations.
On some platforms the ability to load additional extensions (via
--load-extension=/path/to/extension) may be disabled.
You may also see the error
sqlite3.OperationalError: table sqlite_master may not be modified when trying to alter an existing table.
You can work around these limitations by installing either the pysqlite3 package or the sqlean.py package, both of which provide drop-in replacements for the standard library
sqlite3 module but with a recent version of SQLite and full support for loading extensions.
sqlean.py (which has compiled binary wheels available for all major platforms) run the following:
sqlite-utils install sqlean.py
sqlean.py do not provide implementations of the
.iterdump() method. To use that method (see Dumping the database to SQL) or the
sqlite-utils dump command you should also install the
sqlite-utils install sqlite-dump
Setting up shell completion#
You can configure shell tab completion for the
sqlite-utils command using these commands.
eval "$(_SQLITE_UTILS_COMPLETE=bash_source sqlite-utils)"
eval "$(_SQLITE_UTILS_COMPLETE=zsh_source sqlite-utils)"
Add this code to
~/.bashrc to automatically run it when you start a new shell.
See the Click documentation for more details.