Skip to content

Commit 004c464

Browse files
committed
improve: add CI workflow and expand README with API docs
1 parent 420c166 commit 004c464

2 files changed

Lines changed: 91 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master, main, improve/*]
6+
pull_request:
7+
branches: [master, main]
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
build:
15+
name: "${{ matrix.os }}"
16+
runs-on: ${{ matrix.os }}
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
os: [ubuntu-24.04, macos-15, windows-2022]
21+
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v5
25+
with:
26+
submodules: recursive
27+
28+
- name: Set platform
29+
id: platform
30+
shell: bash
31+
run: |
32+
case "${{ runner.os }}" in
33+
Linux) echo "os=ubuntu" >> $GITHUB_OUTPUT; echo "arch=x86_64" >> $GITHUB_OUTPUT ;;
34+
macOS) echo "os=macos" >> $GITHUB_OUTPUT; echo "arch=arm64" >> $GITHUB_OUTPUT ;;
35+
Windows) echo "os=windows" >> $GITHUB_OUTPUT; echo "arch=x86_64" >> $GITHUB_OUTPUT ;;
36+
esac
37+
38+
- name: Download CovScript SDK
39+
shell: bash
40+
run: |
41+
OS="${{ steps.platform.outputs.os }}"
42+
ARCH="${{ steps.platform.outputs.arch }}"
43+
URL="https://github.com/covscript/csbuild/releases/download/${OS}-schedule/covscript-${OS}-${ARCH}.7z"
44+
curl -fsSL "$URL" -o sdk.7z
45+
7z x sdk.7z -y
46+
echo "CS_DEV_PATH=$(pwd)/build" >> $GITHUB_ENV
47+
48+
- name: Configure
49+
run: cmake -S . -B cmake-build
50+
51+
- name: Build
52+
run: cmake --build cmake-build

README.md

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,40 @@
11
# covscript-sqlite
2-
Covariant Script SQLite Extension
2+
3+
SQLite3 database bindings for Covariant Script.
4+
5+
## Dependencies
6+
7+
- [Covariant Script](https://github.com/covscript/covscript)
8+
- SQLite3 (bundled as amalgamation)
9+
10+
## Build
11+
12+
```bash
13+
mkdir build && cd build
14+
cmake ..
15+
cmake --build .
16+
```
17+
18+
## API
19+
20+
### sqlite::database
21+
22+
| Method | Description |
23+
|--------|-------------|
24+
| `open(path)` | Open or create a SQLite database file |
25+
| `close()` | Close the database connection |
26+
| `exec(sql)` | Execute a SQL statement |
27+
28+
### sqlite::statement
29+
30+
| Method | Description |
31+
|--------|-------------|
32+
| `prepare(db, sql)` | Prepare a SQL statement |
33+
| `bind(index, value)` | Bind a value to a parameter |
34+
| `step()` | Execute one step |
35+
| `reset()` | Reset the prepared statement |
36+
| `finalize()` | Finalize the statement |
37+
38+
## License
39+
40+
Apache License 2.0 — see [LICENSE](./LICENSE)

0 commit comments

Comments
 (0)