Skip to content
This repository was archived by the owner on Feb 4, 2026. It is now read-only.

Commit 72ab8ef

Browse files
committed
initial version
0 parents  commit 72ab8ef

31 files changed

+1536
-0
lines changed

.github/workflows/build.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: build
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- .github/**
8+
- cmd/**
9+
- internal/**
10+
- main.go
11+
pull_request:
12+
branches: [main]
13+
workflow_dispatch:
14+
15+
jobs:
16+
build:
17+
name: Build and test
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v3
21+
22+
- name: Setup Go
23+
uses: actions/setup-go@v4
24+
with:
25+
go-version-file: "go.mod"
26+
27+
- name: Install dependencies
28+
run: go get .
29+
30+
- name: Build
31+
run: go build -v .
32+
33+
- name: Test
34+
run: go test -v ./...

.github/workflows/publish.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: publish
2+
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
publish:
14+
name: Release and publish
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v3
18+
19+
- name: Setup Go
20+
uses: actions/setup-go@v4
21+
with:
22+
go-version-file: "go.mod"
23+
24+
- name: Install dependencies
25+
run: go get .
26+
27+
- name: Release and publish
28+
uses: goreleaser/goreleaser-action@v4
29+
with:
30+
args: release --clean
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.sqlpkg/
2+
sqlpkg

.goreleaser.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
builds:
2+
- binary: sqlpkg

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023+ Anton Zhiyanov <https://github.com/nalgeon/sqlpkg-cli>
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
# The (unofficial) SQLite package manager
2+
3+
`sqlpkg` manages SQLite extensions, just like `pip` does with Python packages or `brew` does with macOS programs.
4+
5+
It works primarily with the [SQLite package registry](https://sqlpkg.org/), but is not limited to it. You can install SQLite extensions from GitHub repositories or other websites. All you need is a package spec file (more on that later).
6+
7+
Please note that `sqlpkg` is new and a bit rough around the edges.
8+
9+
## Downloading and installing
10+
11+
`sqlpkg` is a binary executable file (`sqlpkg.exe` on Windows, `sqlpkg` on Linux/macOS). Download it from the link below and put it somewhere in your `PATH` ([what's that?](https://stackoverflow.com/a/41895179/19962064)), so you can run it from anyhwere on your computer.
12+
13+
[**Download**](https://github.com/nalgeon/sqlpkg-cli/releases/latest)
14+
15+
Then run it from the command line (terminal) as described below.
16+
17+
## Installing packages
18+
19+
Install a package from the registry:
20+
21+
```
22+
sqlpkg install nalgeon/stats
23+
```
24+
25+
`nalgeon/stats` is the ID of the extension as shown in the registry.
26+
27+
Install a package from a GitHub repository (it should have a package spec file):
28+
29+
```
30+
sqlpkg install github.com/nalgeon/sqlean
31+
```
32+
33+
Install a package from a spec file somewhere on the Internet:
34+
35+
```
36+
sqlpkg install https://antonz.org/downloads/stats.json
37+
```
38+
39+
Install a package from a local spec file:
40+
41+
```
42+
sqlpkg install ./stats.json
43+
```
44+
45+
## Package location
46+
47+
By default, `sqlpkg` installs all extensions in the home folder:
48+
49+
- `%USERPROFILE%\.sqlpkg` on Windows
50+
- `~/.sqlpkg` on Linux/macOS
51+
52+
So for our `nalgeon/stats` extension it might be:
53+
54+
- `C:\Users\anton\.sqlpkg\nalgeon\stats\stats.dll` on Windows
55+
- `/home/anton/.sqlpkg/nalgeon/stats/stats.so` on Linux
56+
- `/Users/anton/.sqlpkg/nalgeon/stats/stats.dylib` on macOS
57+
58+
## Other commands
59+
60+
`sqlpkg` provides other basic commands you would expect from a package manager.
61+
62+
### `update`
63+
64+
```
65+
sqlpkg update
66+
```
67+
68+
Updates all installed packages to the latest versions.
69+
70+
### `list`
71+
72+
```
73+
sqlpkg list
74+
```
75+
76+
Lists installed packages.
77+
78+
### `info`
79+
80+
```
81+
sqlpkg info nalgeon/stats
82+
```
83+
84+
Displays package information. Works with both local and remote packages.
85+
86+
### `uninstall`
87+
88+
```
89+
sqlpkg uninstall nalgeon/stats
90+
```
91+
92+
Uninstalls a previously installed package.
93+
94+
## Using a local repository
95+
96+
By default, `sqlpkg` installs all extensions in the home folder. If you are writing a Python (JavaScript, Go, ...) application — you may prefer to put them in the project folder (think virtual environment in Python or `node_modules` in JavaScript).
97+
98+
To do that, run the `init` command:
99+
100+
```
101+
sqlpkg init
102+
```
103+
104+
It will create an `.sqlpkg` folder in the current directory. After that, all other commands run from the same directory will use it instead of the home folder.
105+
106+
## Package spec file
107+
108+
The package spec file describes a particular package so that `sqlpkg` can work with it. It is usually created by the package author, so if you are a `sqlpkg` user, you don't need to worry about that.
109+
110+
If you _are_ a package author, who wants your package to be installable by `sqlpkg`, learn how to create a spec file using [this guide](docs/spec-file.md) (coming soon).
111+
112+
That's all for now. Now try some packages!
113+
114+
[⬇️ Download](https://github.com/nalgeon/sqlpkg-cli/releases/latest)
115+
[✨ Explore](https://sqlpkg.org/)
116+
[🚀 Follow](https://twitter.com/ohmypy)

0 commit comments

Comments
 (0)