SQLite package manager
Fix: Create asset temp dir inside .sqlpkg
dir instead of using OS temp dir (#17)
Nothing new, just some minor refactoring.
Minor improvements:
which
supports the lib
prefix (e.g. libxlite.so
for the x2bool/xlite
package).install
and update
support .tgz
assets.This release brings several improvements for both end users and package authors.
which
commandTo load an extension into SQLite after installing it with sqlpkg
, you'll need the path to the extension file. Run the which
command to see it:
sqlpkg which nalgeon/stats
/Users/anton/.sqlpkg/nalgeon/stats/stats.dylib
Use this path to load the extension with a .load
shell command, a load_extension()
SQL function, or other means. See this guide for details:
How to Install an SQLite Extension
By default, macOS disables unsigned binaries and prevents extensions from loading in SQLite. To solve this problem, sqlpkg
now automatically removes installed extensions from the operating system quarantine, so you can use them right away.
This feature is intended for package authors.
Previously, you had to explicitly specify the version number in the package spec file. Now sqlpkg
supports the latest
version for GitHub-hosted packages. It will automatically resolve the version to the latest GitHub release. For example:
{
"owner": "nalgeon",
"name": "stats",
"version": "latest", // resolves automatically
// ...
}
This feature is intended for package authors.
To have sqlpkg
validate asset checksums, host the checksums.txt
file along with the asset files. For example:
https://github.com/nalgeon/sqlean/releases/latest/download/checksums.txt
https://github.com/nalgeon/sqlean/releases/latest/download/sqlean-linux-x86.zip
https://github.com/nalgeon/sqlean/releases/latest/download/sqlean-macos-arm64.zip
https://github.com/nalgeon/sqlean/releases/latest/download/sqlean-macos-x86.zip
https://github.com/nalgeon/sqlean/releases/latest/download/sqlean-win-x64.zip
The contents of checksums.txt
should match the standard POSIX shasum
output (using the SHA-256 algorithm):
6bc24897dde2c7f00cf435055a6853358cb06fcb5a2a789877903ebec0b9298d sqlean-linux-x86.zip
e3de533fdc23e0d953572c2b544ecc2951b890758af0a00b5a42695ae59ee7ac sqlean-macos-arm64.zip
e3de533fdc23e0d953572c2b544ecc2951b890758af0a00b5a42695ae59ee7ac sqlean-macos-x86.zip
f0d2d705bbe641bf2950a51253820e85de04373b7f428f109f69df1d85fa0654 sqlean-win-x64.zip
This release introduces the lockfile and the version
command.
sqlpkg
stores information about the installed packages in a special file (the lockfile) — sqlpkg.lock
. If you're using a local repository, it's a good idea to commit sqlpkg.lock
along with other code. This way, when you check out the code on another machine, you can install all the packages at once.
To install the packages listed in the lockfile, simply run install
with no arguments:
sqlpkg install
sqlpkg
will detect the lockfile (in the current folder or the user's home folder) and install all the packages listed in it.
If you are a 0.0.1 user, create a lockfile for already installed packages by running sqlpkg list
.
Basic package management functions: