Development
Build, test, document, and validate changes to rsql.
Build and run
go build -o bin/rsql ./cmd/rsql
go run ./cmd/rsql serve --api-token=dev-tokenGo verification
go test ./...
go test -race ./...
go vet ./...Coverage can be collected with:
go test -coverprofile=coverage.out ./...
go tool cover -func=coverage.outClient verification
cd client
bun install
bun test
bunx tsc --noEmitDocumentation verification
From the repository root:
bun install
bun run docs:typecheck
bun run docs:build
bun run docs:devFibel serves every page as HTML and as raw Markdown through .md and
.markdown routes. It also builds search and llms.txt indexes.
Documentation changes publish a multi-platform image to
ghcr.io/k2b-dev/rsql-docs. Use main or latest for the newest build from
the default branch, and pin sha-<commit> or the image digest for a fixed
deployment.
Release artifacts
The release builder validates that the tag, CLI version, and TypeScript package
version match. It produces static Linux and macOS archives plus DEB and RPM
packages for amd64 and arm64.
Install the pinned nFPM release, then build into a new output directory:
go install github.com/goreleaser/nfpm/v2/cmd/nfpm@v2.42.1
./scripts/build-release.sh v1.0.0 /tmp/rsql-releaseThe tag workflow installs the generated packages on Debian and Rocky Linux
before creating the GitHub Release. It also records GitHub artifact
attestations. Container builds target linux/amd64 and linux/arm64.
Code organization
Keep HTTP handlers focused on transport and service code focused on
orchestration. Put SQLite-specific behavior in internal/store/sqlite, and
preserve package boundaries expressed by each package's doc.go.
Expected API failures use typed domain errors and stable JSON error codes. Prefer direct code over speculative abstractions, and add tests for every behavioral branch introduced by a change.