v0.5.2 · stable
Elyra SQL Anywhere · The Engine

SQLite, everywhere
your app runs .

SQL Anywhere is a fork of SQLite that keeps full file-format and API compatibility while adding what you need to run SQLite beyond a single local file: embedded replicas, a network server, and continuous backup to object storage.

Reads
<1ms
Compat
100%
License
MIT
main.rs
// An embedded replica that syncs in the background
let db = Builder::new_local_replica("local.db")
    .build().await?;

db.sync().await?;        // pull latest frames
let conn = db.connect()?; // reads served locally

conn.query("SELECT email FROM users", ())
    .await?;
S.01 — What it does

The SQLite you know,
ready for the network.

Start with the embedded Rust API for sub-millisecond local reads. Promote it to a replica, expose it over HTTP with the server, and stream the WAL to S3 — without ever leaving the SQLite file format.

Embedded replicas

Keep a live, local copy of a remote database inside your process. Reads are served locally in sub-milliseconds; writes sync in the background.

Replication

Ship the write-ahead log from a primary to replicas with frame injection — the building blocks for read replicas and embedded replicas alike.

Server mode (sqld)

Expose SQLite over HTTP and WebSockets so remote clients talk to it like PostgreSQL or MySQL — with namespaces and an admin API.

Multitenancy & namespaces

Serve many independent databases from a single sqld instance, with path-based routing and wildcard domains for local development.

Bottomless storage

Continuously stream the write-ahead log to S3-compatible object storage for durable, point-in-time-recoverable databases.

Encryption

At-rest and in-transit encryption built in, so sensitive data stays protected on disk and across the wire.

Offline writes

Accept writes while disconnected and reconcile when the connection returns — ideal for edge and mobile.

Search is one engine

Full-text (FTS5), faceted, vector and hybrid search are all the same database file and ordinary SQL — no separate search product to deploy, sync or keep consistent. Vector runs on a built-in, quantizable DiskANN index.

Pluggable embeddings

Bring your own semantic model via the Embedder trait — plug in a real embedding model for semantic search, or swap providers, without changing your queries.

Cache, queue & pub/sub

Storage primitives as chapters, not products: a KV cache with TTL, an atomic-claim job queue, and a replication-log pub/sub bus — all ordinary SQL, no Redis, SQS or Kafka to run alongside.

Collaborative vector index

The flagship combination of CRDT offline merge × DiskANN × inline embed(): several devices index offline and independently, merge conflict-free, then every device can vector-search over every device's documents (experimental).

CRDT offline merge

The vendored cr-sqlite extension turns tables into conflict-free replicated relations (crsql_as_crr) — edit offline on many devices and merge deterministically by exchanging change rows.

Docker images

Multi-arch sqld container images (linux/amd64 + linux/arm64) published to ghcr.io/kwhorne/sqlanywhere-server on every release, alongside the prebuilt binaries.

Pluggable virtual WAL

A virtual write-ahead log interface lets you swap in custom WAL backends for replication and storage.

Drop-in SQLite

Databases that don't use the extra features stay byte-compatible with stock SQLite tooling and the C API.

Extensions

ALTER TABLE type changes, randomized ROWID, WebAssembly UDFs, and xPreparedSql on top of the core engine.

Bindings everywhere

Async Rust API plus C and WebAssembly bindings — embed the same engine from native apps to the browser.

vectors.sql
-- A table with a 4-dimensional vector column
CREATE TABLE movies (
  title     TEXT,
  embedding F32_BLOB(4)
);

INSERT INTO movies VALUES
  ('Inception', vector32('[0.1,0.2,0.3,0.4]'));

-- Build an approximate-nearest-neighbour index
CREATE INDEX movies_idx
  ON movies (libsql_vector_idx(embedding));

-- Query the nearest neighbours
SELECT title FROM vector_top_k(
    'movies_idx', vector32('[0.2,0.1,0.4,0.3]'), 5)
  JOIN movies ON movies.rowid = id;
New in 0.3 — vector-native edge

Embeddings are a
first-class column.

Store embeddings directly in vector columns and run fast similarity search with a built-in DiskANN index — no separate vector database, no extension to install. It is just SQL. 0.3 turns it into a full local-first RAG toolkit.

  • Hybrid search — fuse vector similarity with FTS5 keyword search via Reciprocal Rank Fusion
  • Quantized indexes (float16 | float8 | 1-bit) shrink the on-disk graph up to 5.5× for edge devices
  • embed(text, dims) turns text into a vector literal inline — no pre-compute step
  • Approximate nearest-neighbour search via libsql_vector_idx + vector_top_k
Vector search & local RAG guide
Full SQLite compatibility

A superset, not a
rewrite.

SQL Anywhere keeps the SQLite file format and C API intact. Your existing databases, queries, and tooling keep working — you opt into replication, the server, and bottomless storage only when you need them.

  • Byte-compatible with stock SQLite files
  • Same C API — existing bindings keep working
  • Add replication and server mode incrementally
  • Free and open source under the MIT license
Read the docs
shell
# A drop-in SQLite shell
$ ./sqlanywhere mydata.db
SQL Anywhere version 0.5.2
  (based on SQLite version 3.43.0)

# Run it as a network server
$ sqld --http-listen-addr 0.0.0.0:8080
 HTTP + WebSocket  (Hrana)
 bottomless → S3   (WAL stream)
Colophon — Get started

One engine,
local to global.

Embed it, replicate it, or serve it over the network. Free, open source, and fully SQLite-compatible.

Elyra SQL Anywhere · v0.5.2 Built in Norway · MMXXVI