sqlvibe sqlvibe is a high-performance in-memory database engine written in Go with SQL compatibility. Stable Releases | Version | Date | De…
sqlvibe sqlvibe is a high-performance in-memory database engine written in Go with SQL compatibility. Stable Releases | Version | Date | De…
sqlvibe is a high-performance in-memory database engine written in Go with SQL compatibility.
| Version | Date | Description |
|---|---|---|
| v0.10.16 | 2026-03-01 | CGO Phases 12-18: expression eval, bytecode dispatch, type conversion, string/datetime/aggregate batch ops, fast QP tokenizer |
| v0.10.15 | 2026-03-01 | CLI: .dump enhancements, .export fix; context/ window/ subpackages; ANY_VALUE, MODE aggregates |
| v0.9.17 | 2026-02-26 | JSON Extension Enhancement: Table-valued functions (json_each, json_tree), Aggregates (json_group_array, json_group_object), JSONB format |
:memory: URI for fast, ephemeral storageSVDB_EXT_JSON, SVDB_EXT_MATH); query via sqlvibe_extensions virtual tablejson(), json_array(), json_extract(), json_object(), json_set(), json_type(), json_length(), and more (requires -tags SVDB_EXT_JSON)POWER(), SQRT(), MOD(), trigonometric, exponential (requires -tags SVDB_EXT_MATH)CREATE VIEW, DROP VIEW, query views like tables, INSTEAD OF triggers for updatable viewsVACUUM (in-place compaction) and VACUUM INTO 'path' (snapshot to file)ANALYZE collects table/index statistics accessible via sqlite_stat1page_size, mmap_size, locking_mode, synchronous, auto_vacuum, query_only, temp_store, read_uncommitted, cache_spillUNHEX(), RANDOM(), RANDOMBLOB(), ZEROBLOB(), IIF()PRAGMA foreign_keys = ON, inline REFERENCES, table-level FOREIGN KEY, ON DELETE CASCADE/RESTRICT/SET NULL, ON UPDATE CASCADECREATE TRIGGER / DROP TRIGGER, BEFORE/AFTER INSERT/UPDATE/DELETE, WHEN conditions, UPDATE OF column filterssqlite_sequence trackingjulianday(), unixepoch(), extended strftime() with %w/%W/%s/%Jprintf()/format(), quote(), hex(), char(), unicode(), instr()PRAGMA compression: NONE, RLE, LZ4, ZSTD, GZIPBACKUP DATABASE TO 'path' and BACKUP INCREMENTAL TO 'path' SQL commandsPRAGMA storage_info for page counts, WAL size, compression ratioforeign_keys, encoding, collation_list, sqlite_sequence, wal_mode, isolation_level, busy_timeout, compression, storage_info…Extensions are compiled in via build tags:
# Default (no extensions)
go build ./...
# With JSON extension (SQLite JSON1-compatible)
go build -tags "SVDB_EXT_JSON" ./...
# With Math extension
go build -tags "SVDB_EXT_MATH" ./...
# With FTS5 extension (Full-Text Search)
go build -tags "SVDB_EXT_FTS5" ./...
# Multiple extensions
go build -tags "SVDB_EXT_JSON SVDB_EXT_MATH SVDB_EXT_FTS5" ./...Query which extensions are loaded:
SELECT * FROM sqlvibe_extensions;
-- name | description | functions
-- json | JSON extension | json,json_array,json_extract,...
-- math | Math extension | POWER,SQRT,MOD,...
-- fts5 | FTS5 extension | MATCH,BM25,rank,tokenize,...See docs/ARCHITECTURE.md for details.
Benchmarks on AMD EPYC 7763 64-Core @ 2.45 GHz, in-memory database, -benchtime=1s.
Methodology: the result cache is cleared before each sqlvibe iteration via
db.ClearResultCache() so actual per-query execution cost is measured.
SQLite's database/sql driver reuses prepared statements across iterations.
Both sides iterate all result rows end-to-end.
(go test ./tests/Benchmark/... -bench=BenchmarkCompare_ -benchtime=1s).
Results may vary on different hardware.
Build with ./build.sh -t to run tests with all CGO optimizations enabled.
v0.11.2 Highlights: Introduces src/core/svdb/ — a self-contained C++ engine module
with a unified C public API (svdb.h). The internal/cgo/ package provides a thin
type-mapping CGO binding layer (~400 LOC). All orchestration logic moves from Go into C++.
| Rows | SQLite | sqlvibe | Result |
|---|---|---|---|
| 1 K | 293 µs | 263 µs | 1.1× faster |
| 10 K | 2.91 ms | 2.26 ms | 1.3× faster |
| 100 K | 28.6 ms | 27.4 ms | 1.0× faster |
| Rows | SQLite | sqlvibe | Result |
|---|---|---|---|
| 1 K | 197 µs | 793 µs | 4.0× slower |
| 10 K | 1.81 ms | 8.39 ms | 4.6× slower |
| Rows | SQLite | sqlvibe | Result |
|---|---|---|---|
| 1 K | 78 µs | 28 µs | 2.8× faster |
| 10 K | 609 µs | 203 µs | 3.0× faster |
| 100 K | 6.08 ms | 2.33 ms | 2.6× faster |
| Rows | SQLite | sqlvibe | Result |
|---|---|---|---|
| 1 K | 490 µs | 148 µs | 3.3× faster |
| 10 K | 4.85 ms | 1.01 ms | 4.8× faster |
| 100 K | 57.7 ms | 11.7 ms | 4.9× faster |
| Rows | SQLite | sqlvibe | Result |
|---|---|---|---|
| 1 K | 5.5 µs | 7.3 µs | 1.3× slower |
| 10 K | 7.2 µs | 8.0 µs | 1.1× slower |
| 100 K | 25.6 µs | 9.3 µs | 2.8× faster |
| Rows | SQLite | sqlvibe | Result |
|---|---|---|---|
| 1 K | 5.77 ms | 2.83 ms | 2.0× faster |
| 10 K | 56.1 ms | 32.3 ms | 1.7× faster |
| Rows | SQLite | sqlvibe | Result |
|---|---|---|---|
| 1 K | 462 µs | 1.12 ms | 2.4× slower |
| 10 K | 4.60 ms | 11.5 ms | 2.5× slower |
| 100 K | 45.8 ms | 133.7 ms | 2.9× slower |
| Rows | SQLite | sqlvibe | Result |
|---|---|---|---|
| 1 K | 236 µs | 298 µs | 1.3× slower |
| 10 K | 2.16 ms | 2.99 ms | 1.4× slower |
| 100 K | 21.2 ms | 35.7 ms | 1.7× slower |
Analysis (v0.11.2 — C++ Native Engine Module + Unified Public API): sqlvibe excels at aggregate workloads with 2.6–4.9× speedups over SQLite for SUM and GROUP BY. The v0.11.2 unified C public API (
svdb.h) insrc/core/svdb/enables direct C/C++ integration without Go. Key improvements:
- SUM aggregate: 2.6–3.0× faster (C++ aggregate engine)
- GROUP BY: 3.3–4.9× faster (C++ hash aggregation + batch compare)
- SELECT all: 1.0–1.3× faster (C++ columnar store + SIMD batch ops)
- Architecture: New
svdb.hC public API — zero-overhead for C/C++ native callersWHERE filter and JOIN remain areas for future optimization — the bytecode VM evaluation path adds overhead vs SQLite's tightly-optimized scan.
src/core/svdb/ module with unified C public API (svdb.h) — open/exec/query/transactions/schema from pure C/C++build.sh verifies the C API via svdb_open/svdb_exec/svdb_query without any Go runtimeinternal/cgo/ package (~400 LOC) — pure type-mapping, no business logicsvdb_cg_optimize_bc_instrs applied to every query (zero-copy raw-buffer path)fmt.Sprintf allocationWHERE col=val AND cond uses secondary index89+ test suites passing
go build ./...
go test ./...
go test ./tests/Benchmark/... -bench . -benchmemConfigure extensions at build time using -tags:
| Flag | Extensions | Description |
|---|---|---|
SVDB_EXT_JSON |
JSON extension | SQLite JSON1 functions |
SVDB_EXT_MATH |
Math extension | ABS, CEIL, FLOOR, ROUND, POWER, SQRT, MOD, EXP, LN, LOG, etc. |
SVDB_EXT_FTS5 |
FTS5 extension | Full-Text Search: MATCH, BM25, rank, tokenizers |
# With JSON extension
go build -tags "SVDB_EXT_JSON" -o sqlvibe .
# With Math extension
go build -tags "SVDB_EXT_MATH" -o sqlvibe .
# With FTS5 extension
go build -tags "SVDB_EXT_FTS5" -o sqlvibe .
# With multiple extensions
go build -tags "SVDB_EXT_JSON SVDB_EXT_MATH SVDB_EXT_FTS5" -o sqlvibe .-- Query loaded extensions
SELECT * FROM sqlvibe_extensions;See LICENSE file.
No open issues yet, or sync has not completed.