SLOPDB / DOCUMENTATION / SLOPDB

SlopDB

SlopDB is an embedded SQL database written in Go. It provides a SQLite-like SQL dialect, concurrent transactions, a Go API and an interactive command-line interface, plus optional MySQL and PostgreSQL protocol servers over TCP and Unix sockets. Each database lives in a directory and runs without an external database server.

Features

Queries and data

Transactions and concurrency

Performance

Durability and operations

Integration and tools

See the documentation for feature details and restrictions.

Quick start

Build from the repository root with Go 1.22.2 or newer:

go build -o slopdb .
./slopdb ./example-db

The getting started guide walks through creating a table, querying data and running scripts.

To connect using MySQL clients, run ./slopdb --mysql-tcp 127.0.0.1:3306 ./example-db or use --mysql-socket /tmp/slopdb.sock. See MySQL server for authentication, both-listener operation and compatibility limits.

For PostgreSQL clients, use ./slopdb --postgres-tcp 127.0.0.1:5432 ./example-db or --postgres-socket /tmp/slopdb-postgres/.s.PGSQL.5432. See PostgreSQL emulation for TLS, client certificates and SQL compatibility limits.

For replicated clusters, see Raft replication for bootstrap, clone/join, TLS, membership management and SQL read consistency options.

Using SlopDB from Go

The Go API supports querying, concurrent application sessions and transactions, with deadlines and cancellation. Options let applications choose resource and durability settings.

The embedded database/sql driver registers as slopdb: import _ "slopdb/driver", then call sql.Open("slopdb", directory). A pool uses independent sessions over one shared physical engine. NewConnector can also wrap an existing native database without taking ownership of it.

See prepared statements for parameter binding and transaction examples, and application operations for working with results, loading data, backups and integrity checks.

Documentation

Tests and benchmarks

go test ./... -count=1 -timeout 10m
go test -race ./... -count=1 -timeout 10m
go vet ./...

The repository includes SQL reference fixtures, concurrency and transaction tests, corruption checks and crash-recovery tests. Ordinary Go tests use isolated temporary databases and require no external database engine. See TESTING.md for selective commands and coverage.

These are development benchmarks rather than certified TPC scores. Compare runs with matching data, concurrency, execution mode and durability settings.

Rendered from the project documentation · e5e2eb2View source on GitHub ↗