The (unofficial) SQLite package manager

To update or switch versions, run webi sqlpkg@stable (or @v0.2.2, @beta, etc).

Files

These are the files / directories that are created and/or modified with this install:

~/.local/envman/PATH.env
~/.local/bin/sqlpkg
~/.sqlpkg/
<PROJECT-DIR>/.sqlpkg/

Cheat Sheet

sqlpkg manages SQLite extensions, just like pip does with Python packages or brew does with macOS programs.

View and search sqlite extensions at https://sqlpkg.org/.

Install via sqlpkg install:

# sqlpkg install <name|git-uri|https-url>
sqlpkg install nalgeon/stats

Verify with sqlpkg list

sqlpkg

Which then becomes available at ~/.sqlpkg/nalgeon/stats/

Command Description
help Display help
info Display package information
init Init project scope
install Install packages
list List installed packages
uninstall Uninstall package
update Update installed packages
version Display version
which Display path to extension file

How to initialize a Project

By default, sqlpkg installs extensions to ~/.sqlpkg/<extension-name>.

However, sqlpkg init will create a .sqlpkg in the current project folder.
(just like virtual environment or node_modules)

sqlpkg init
✓ created a project scope

How to Install SQLite Extensions

You can install extensions in various ways:

  • SQL Pkg Registry (sqlpkg.org)
  • Git / GitHub URI
  • Spec File URL
  • Local Spec File

Registry

# sqlpkg install <pkg-name>
sqlpkg info nalgeon/stats
sqlpkg install nalgeon/stats
sqlpkg list | grep stats

nalgeon/stats is the ID of the extension as shown in the registry.

Git / GitHub

sqlpkg info github.com/riyaz-ali/dns.sql
sqlpkg install github.com/riyaz-ali/dns.sql
sqlpkg list | grep dns.sql

Git repositories must have a package spec file.

Spec URL

sqlpkg info https://raw.githubusercontent.com/riyaz-ali/dns.sql/main/sqlpkg.json
sqlpkg install https://raw.githubusercontent.com/riyaz-ali/dns.sql/main/sqlpkg.json
sqlpkg list | grep dns.sql

Spec File

sqlpkg info ./sqlpkg.json
sqlpkg install ./sqlpkg.json
sqlpkg list | grep dns.sql

How to Manage Packages

sqlpkg provides other basic commands you would expect from a package manager:

  • Info
  • Install
  • Update (one or all)
  • Uninstall
sqlpkg <cmd> <pkg-name|git-uri|spec-url|file>

info

sqlpkg info nalgeon/stats
sqlpkg info github.com/riyaz-ali/dns.sql
sqlpkg info https://raw.githubusercontent.com/riyaz-ali/dns.sql/main/sqlpkg.json
sqlpkg info ./sqlpkg.json

install

sqlpkg install nalgeon/stats
sqlpkg install github.com/riyaz-ali/dns.sql
sqlpkg install https://raw.githubusercontent.com/riyaz-ali/dns.sql/main/sqlpkg.json
sqlpkg install ./sqlpkg.json

update

sqlpkg update
sqlpkg update nalgeon/stats

Note: update without a package name will update ALL extensions

Note: update installs the latest version, not necessarily a semver-compatible version

uninstall

sqlpkg uninstall nalgeon/stats

Contribute

Report an Issue Submit Installer Star on GitHub