Environment:2giosangmitom Sqmeow nvim Docker Compose Test Databases
| Knowledge Sources | |
|---|---|
| Domains | Infrastructure, Testing, Databases |
| Last Updated | 2026-10-16 14:00 GMT |
Overview
Docker Compose stack of 13 database servers for sqmeow.nvim integration tests, started with just db-up on non-standard ports to avoid collisions with developer-run services.
Description
The compose.yaml file defines database services for every server-backed adapter dialect: PostgreSQL, MySQL, MariaDB, ClickHouse, Redis, Dragonfly, MongoDB, ScyllaDB, Cassandra, SurrealDB, Oracle, MSSQL, and CockroachDB. Ports are deliberately non-standard (e.g. PostgreSQL on 55432, MySQL on 53306) so the stack never collides with a server the developer already runs. Each service includes a healthcheck that just db-up waits for before tests begin.
SQLite and DuckDB require no Docker service; they run in-process or against local files.
The Justfile's test-rust and test-lua recipes check each service individually and export the corresponding SQMEOW_TEST_*_URL environment variable only when the container is running. Tests that find no URL skip themselves silently.
= Usage
Use this environment when running integration tests for server-backed databases. Start with just db-up, run tests, then stop with just db-down. Without these services, server-backed tests are skipped (and may appear as passed in the summary).
System Requirements
| Category | Requirement | Notes |
|---|---|---|
| OS | Linux or macOS | Docker must be available |
| Software | Docker + Docker Compose | Required to run database containers |
| Disk | ~10GB for container images | Oracle image alone is ~3GB |
| Memory | 4GB+ free | ScyllaDB and Oracle are memory-intensive; Scylla uses --memory 512M --overprovisioned 1
|
| Network | Local ports 51433-59042 | Non-standard ports avoid collisions |
Dependencies
Docker Services
mcr.microsoft.com/mssql/server:2022-latest— MSSQL on port 51433postgres:17-alpine— PostgreSQL on port 55432cockroachdb/cockroach:v26.2.6— CockroachDB on port 56257mysql:8— MySQL on port 53306mariadb:11.8— MariaDB on port 53307 (profile-gated)clickhouse/clickhouse-server:25.8-alpine— ClickHouse on port 58123redis:8-alpine— Redis on port 56379docker.dragonflydb.io/dragonflydb/dragonfly:v1.40.2— Dragonfly on port 56380mongo:8— MongoDB on port 57017scylladb/scylla:2025.3— ScyllaDB on port 59042cassandra:5.0— Cassandra on port 59043surrealdb/surrealdb:v3— SurrealDB on port 58000gvenzl/oracle-free:23-slim— Oracle on port 51521
Test URL Environment Variables
SQMEOW_TEST_MSSQL_URLSQMEOW_TEST_POSTGRES_URLSQMEOW_TEST_MYSQL_URLSQMEOW_TEST_MARIADB_URLSQMEOW_TEST_CLICKHOUSE_URLSQMEOW_TEST_REDIS_URLSQMEOW_TEST_DRAGONFLY_URLSQMEOW_TEST_MONGODB_URLSQMEOW_TEST_SCYLLA_URLSQMEOW_TEST_CASSANDRA_URLSQMEOW_TEST_SURREALDB_URLSQMEOW_TEST_ORACLE_URLSQMEOW_TEST_COCKROACH_URL
Credentials
All test databases use fixed credentials defined in compose.yaml:
- MSSQL:
sa/Sqmeow_Test123! - PostgreSQL:
sqmeow/sqmeow(database:sqmeow) - MySQL:
root/sqmeow - MariaDB:
root/sqmeow - ClickHouse:
sqmeow/sqmeow - Redis/Dragonfly: No password
- MongoDB: No password
- SurrealDB:
root/root - Oracle:
sqmeow/sqmeow - CockroachDB:
root, no password
These are test-only credentials, never used in production.
Quick Install
# Start all test databases (waits for healthchecks)
just db-up
# Run integration tests
just test-rust
just test-lua
# Stop databases and remove all data
just db-down
# Run a single adapter's tests (example: PostgreSQL)
nix develop --command cargo test -j 1 \
-p sqmeow-adapters --test postgres \
-- --exact --test-threads=1 --nocapture
Code Evidence
Per-service URL export from Justfile:47-84:
# Each server is checked on its own: one of them being down should skip its own cases, not
# point the other dialect's tests at a port with nothing behind it.
if [ -n "$(docker compose ps --status running --quiet postgres 2>/dev/null)" ]; then
export SQMEOW_TEST_POSTGRES_URL="postgres://sqmeow:sqmeow@127.0.0.1:55432/sqmeow"
fi
Dragonfly memory lock override from compose.yaml:105-109:
# Dragonfly speaks the Redis protocol, and the Redis cases run against it as well. It locks its
# memory on start, which Docker's default limit refuses. The image brings its own healthcheck.
dragonfly:
image: docker.dragonflydb.io/dragonflydb/dragonfly:v1.40.2
ulimits:
memlock: -1
ScyllaDB resource-constrained startup from compose.yaml:123-128:
scylla:
image: scylladb/scylla:2025.3
command: --smp 1 --memory 512M --overprovisioned 1 --developer-mode 1 --broadcast-rpc-address 127.0.0.1
Test skip pattern from core/sqmeow-adapters/src/postgres.rs:22-23:
let Ok(url) = std::env::var("SQMEOW_TEST_POSTGRES_URL") else {
eprintln!("skipped: set SQMEOW_TEST_POSTGRES_URL");
Common Errors
| Error Message | Cause | Solution |
|---|---|---|
| Tests pass but server-backed cases were skipped | Docker services not running | Run just db-up before tests
|
port is already allocated |
Another service on the same port | Stop the conflicting service or check the non-standard port mapping |
| Oracle healthcheck timeout | Oracle takes minutes on first start | Wait longer; healthcheck retries 60 times at 10s intervals |
| Dragonfly fails to start | Docker memlock limit too low | Ensure ulimits: memlock: -1 in compose config
|
| ScyllaDB connection refused | Not yet bootstrapped | ScyllaDB takes ~60s; healthcheck retries 60 times |
SQMEOW_TEST_*_URL not set when running cargo directly |
Justfile sets these only for running containers | Run via just test-rust or export manually
|
Compatibility Notes
- MariaDB: Profile-gated (
profiles: ["mariadb"]); requiresdocker compose --profile mariadb upor is started byjust db-upwhich uses--wait. - CockroachDB: Speaks the PostgreSQL protocol; tested through the PostgreSQL adapter with a CockroachDB-specific URL.
- Cassandra: Speaks CQL; tested through the Scylla adapter. Both share test cases from
tests/common/scylla_cases.rs. - Dragonfly: Speaks the Redis protocol; tested through the Redis adapter. Both share test cases from
tests/common/redis_cases.rs. - Oracle: Uses
gvenzl/oracle-free:23-slim; takes several minutes on first start to create its database.