Development Guide

August 16, 2026 ยท View on GitHub

Tests

go test ./... -count=1
go test -coverprofile=coverage.out ./...

Go 1.26's testing/synctest provides virtual time for concurrency tests; keep new timing-sensitive tests deterministic instead of adding real sleeps.

Makefile

make or make help lists all documented targets. Common workflow:

make deps
make ci
make build-all
TargetPurpose
make buildBuild cmd/tinysql into bin/tinysql.
make build-allBuild the CLI plus the common command demos into bin/.
make build-query-files-wasmBuild the browser playground WASM artifacts.
make build-wasm-browser / make build-wasm-nodeBuild the browser or Node WASM API bundles.
make build-gh-pages-demoIncrementally build and validate the static files for the GitHub Pages demo.
make update-gh-pagesReuse a clean gh-pages worktree, sync only changed assets, and commit only if the generated demo changed.
make push-gh-pagesRun update-gh-pages and push gh-pages (only that branch).
make test / make test-allRoot tests plus the standalone query-file demo modules.
make test-unitShort unit tests.
make test-jsonv2Storage/engine persistence tests against Go's experimental JSON v2 โ€” a compatibility gate, not a production default.
make test-query-files / make test-fsqlStandalone query-files and filesystem-query module tests.
make test-query-files-wasmTests inside cmd/query_files_wasm.
make wasm-checkCompile the standard-Go browser, Node, and query-files WebAssembly targets without retaining artifacts.
make tinygo-wasmBuild and execute the Node WASM smoke test using the pinned TinyGo Docker image.
make ciThe complete standard-Go GitHub Actions matrix: formatting, module verification, native/WASM builds, vet, tests, race detection, and coverage.
cd odbc && make linuxBuild the c-shared ODBC driver from its nested Go module.
make coverageRun tests and open an HTML coverage report.
make benchBenchmarks with allocation output.
make fmt / make fmt-checkFormat Go files / check formatting without modifying.
make vetgo vet ./....
make lintgolangci-lint; must be installed locally.
make verifyMutating local check: fmt, vet, lint, tests. Runs make fmt, so it may rewrite tracked Go files.
make verify-ciQuick non-mutating CI-style check: fmt-check, vet, build-check, tests.
make cleanRemove binaries, WASM artifacts, coverage files, WAL leftovers.
make run-repl / make run-server / make run-demoBuild and start the corresponding demo.
make infoPrint build version, Go version, configured paths.

verify-ci builds all host Go packages plus the query_files CLI and its WASM artifact. Run make build-wasm-browser or make build-wasm-node separately when changing those targets. Push main separately after committing source changes.

Nested module dependencies

The ODBC driver has its own go.mod and go.sum. Keep them in sync with the root module whenever the root SQLite dependency changes:

go mod tidy -diff                 # from the repository root
(cd odbc && go mod tidy)
CGO_ENABLED=1 make -C odbc linux

Running go mod tidy in the repository root does not update nested modules; a stale module otherwise fails independently in CI. Use make tidy-all after changing shared dependencies to tidy every tracked module. make modules-verify checks checksums across that same tracked set without touching untracked work.

Variables are overridable:

make build BINARY_DIR=dist
make test GO_TEST_FLAGS="-run TestGeo -count=1"
make update-gh-pages GH_PAGES_COMMIT_MESSAGE="Update playground"
make update-gh-pages GH_PAGES_WORKTREE=/tmp/tinysql-gh-pages

Further reading