Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Environment:2giosangmitom Sqmeow nvim Docker Compose Test Databases

From Leeroopedia
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 51433
  • postgres:17-alpine — PostgreSQL on port 55432
  • cockroachdb/cockroach:v26.2.6 — CockroachDB on port 56257
  • mysql:8 — MySQL on port 53306
  • mariadb:11.8 — MariaDB on port 53307 (profile-gated)
  • clickhouse/clickhouse-server:25.8-alpine — ClickHouse on port 58123
  • redis:8-alpine — Redis on port 56379
  • docker.dragonflydb.io/dragonflydb/dragonfly:v1.40.2 — Dragonfly on port 56380
  • mongo:8 — MongoDB on port 57017
  • scylladb/scylla:2025.3 — ScyllaDB on port 59042
  • cassandra:5.0 — Cassandra on port 59043
  • surrealdb/surrealdb:v3 — SurrealDB on port 58000
  • gvenzl/oracle-free:23-slim — Oracle on port 51521

Test URL Environment Variables

  • SQMEOW_TEST_MSSQL_URL
  • SQMEOW_TEST_POSTGRES_URL
  • SQMEOW_TEST_MYSQL_URL
  • SQMEOW_TEST_MARIADB_URL
  • SQMEOW_TEST_CLICKHOUSE_URL
  • SQMEOW_TEST_REDIS_URL
  • SQMEOW_TEST_DRAGONFLY_URL
  • SQMEOW_TEST_MONGODB_URL
  • SQMEOW_TEST_SCYLLA_URL
  • SQMEOW_TEST_CASSANDRA_URL
  • SQMEOW_TEST_SURREALDB_URL
  • SQMEOW_TEST_ORACLE_URL
  • SQMEOW_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"]); requires docker compose --profile mariadb up or is started by just db-up which 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.

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment