Skip to content

Contributing ​

Build and test ​

quarry is a Rust project. Common tasks are in the justfile at the repository root; run just to list them:

RecipeDoes
just run … / just tui …Run quarry from source, e.g. just run demo.db
just checkClippy (warnings are errors), then the tests
just test-slowThe slow timing tests, in release mode
just installBuild the quarry-sql Arch package from HEAD and install it with pacman (just uninstall removes it)
just install-cargoInstall the binary into ~/.cargo/bin instead, on systems without pacman
just tarballBuild dist/quarry-<version>-<target>.tar.gz with a checksum
just ship <version>Make a release; see Releasing
just artRegenerate the logo and banner
just docs / just docs-buildPreview or build this site

Or use Cargo directly, from the repository root:

sh
cargo build            # debug build
cargo test             # unit and integration tests
cargo clippy --all-targets

The integration tests for PostgreSQL and MySQL need running servers. Point quarry at them with environment variables; tests for a server that can't be reached are skipped:

sh
QUARRY_TEST_PG=postgres://postgres@127.0.0.1/postgres \
QUARRY_TEST_MYSQL=mysql://root@127.0.0.1 \
cargo test

The tests create their own quarry_test_* databases and drop them afterwards.

Project layout ​

PathContents
src/cli.rs, src/main.rsCommand-line options and start-up
src/conn/Connection URLs, password files, SSH tunnels
src/db/The PostgreSQL, MySQL and SQLite drivers, and the schema catalog
src/repl/The REPL: prompt, key bindings, session
src/tui/The TUI
src/complete/Context-aware completion
src/special/Special commands
src/sql/Statement splitting, classification, formatting
src/output/Table and machine output formats, pager
src/llm/\llm providers and the --setup-llm wizard
src/theme.rsBuilt-in themes and custom theme loading
tests/Integration tests
docs/This site

The logo and banner ​

logo.svg and banner.svg in the repository root are generated. Change the mascot in scripts/gen_art.py, then run:

sh
just art        # or: python3 scripts/gen_art.py

The animations leave every shape at its resting pose, so renderers without SVG animation still draw the static artwork.

This documentation site ​

The site lives in docs/ and is built with VitePress. Pages are Markdown files under docs/start, docs/guides, docs/advanced, docs/reference and docs/help; the sidebar is defined in docs/.vitepress/config.mts, and the landing page is docs/.vitepress/theme/components/HomePage.vue.

sh
just docs          # live preview
just docs-build    # static site in docs/.vitepress/dist
just docs-deploy   # publish to quarry.asmechanics.com (after `npx wrangler login`)

When you change quarry's behaviour, update the matching page here in the same change. The reference pages (options, commands, keys, config) are the ones most likely to need it.

The terminal screenshots are real captures (tmux capture-pane -e -p) stored in docs/.vitepress/theme/captures/, rendered to HTML by the Terminal component during the build.

Released under the MIT licence.