SQL / Server v1.12.19 · stable
Elyra SQL Server · The Database

A SQL server
in a single file .

Elyra SQL Server is a robust, MySQL-compatible engine in Rust. The whole database is one crash-safe ACID file, it speaks the MySQL wire protocol so mysql, DBeaver and any driver work unchanged — with native vector search and parallel OLAP aggregation built in.

mysql — connect with any client
# Start the server on a single file
$ elyrasql serve --data mydb.edb
✓ MySQL protocol on 127.0.0.1:3306

# Connect with the stock mysql client
$ mysql -h127.0.0.1 -P3306
mysql> SELECT id FROM docs
    -> ORDER BY embedding <-> VECTOR '[…]' LIMIT 5;
S.01 — What it does

One file,
the MySQL wire protocol.

Full DDL/DML, joins, correlated subqueries, CTEs (incl. WITH RECURSIVE), window functions, set operations and transactions — plus AI-native hybrid search, in-SQL embeddings, vector search and parallel OLAP, in a single ACID file.

Single-file, ACID

The whole database is one crash-safe file (*.edb) with multi-version concurrency — a single-writer / multi-reader model. “Crash-safe” is tested, not asserted: a robustness scenario repeatedly SIGKILLs the server and checks that acknowledged commits survived, that a mid-write kill with six concurrent writers left no torn transaction, and that totals are conserved across ~3000 concurrent transfers.

Or no server at all

Since 1.10.0 the same engine opens an .edb file in-process, as a library — no server, no socket, no wire protocol — with a C ABI (elyra-embed-capi) for anything that reaches Rust through an FFI. The SQL is identical because it is the same engine: elyra-engine sits on the storage layer and nothing above it, so this is a second entry point rather than a second implementation, and a file written in-process is served over MySQL by elyrasql serve and read back with the same values. It is the SQLite shape — one file, no daemon — with the vector search and OLAP surface the server has. The downloads on this page are still the server; the embedded engine is a library you build against.

Serve it to an agent

elyrasql mcp is a Model Context Protocol server over stdio, so an AI agent introspects the schema and runs SQL with no server, port or driver in the way — the embedded shape again, pointed at a model rather than a driver. It is read-only by default, and refuses a write through the engine’s own privilege check rather than by scanning the SQL for dangerous words, because keyword-matching is not a way to refuse them reliably. --allow-writes grants Write and never Admin: INSERT, UPDATE and DELETE become possible while DROP TABLE, schema changes and GRANT stay refused. Results are capped at 200 rows and always say when they were, because a model that cannot tell a partial answer from a complete one will reason from the partial one — and DECIMAL stays a string so its scale survives a model reading prices.

MySQL wire protocol

A first-party wire layer with TLS (rustls), MySQL 8’s caching_sha2_password and native prepared statements. Connect with the mysql CLI, DBeaver or any driver — a full Laravel/Eloquent stack runs cleanly, plus PDO, Python, Node — and Rust (sqlx) since 1.11.2. Until then the docs said sqlx worked out of the box; it did not. sqlx opens every connection with a statement ElyraSQL refused — a scalar subquery as a SET value, and time_zone as a session variable — so no sqlx application got as far as its first query, including anything generic over AnyPool, which cannot turn the statement off. Found when Grove tried to bundle ElyraSQL and its convert tool could not reach it. Both halves are accepted now. That fix took time_zone only as far as UTC — a non-zero offset was refused rather than stored and silently not honoured, which was the right refusal to make and not a place to stop. Since 1.11.3 a numeric offset within ±14:00 is accepted and applied: the local now-family reads in the session zone, the UTC_* forms stay in UTC, and FROM_UNIXTIME and UNIX_TIMESTAMP interpret their value there. A named zone like Europe/Oslo is still refused, because it needs a zone table carrying DST rules that a fixed offset cannot express — and answering with one anyway is how a timestamp comes back an hour wrong twice a year.

Vector native

VECTOR(n) columns with exact and HNSW approximate nearest-neighbour search — semantic search lives in the database.

Hybrid search

HYBRID(text, 'query', vec, vector) fuses full-text and vector rankings with Reciprocal Rank Fusion, honouring your WHERE filter — the RAG retrieval stack in one query, no Elasticsearch or reranker.

In-SQL embeddings

ai_embed('text') calls an OpenAI-compatible endpoint (cloud or a local Ollama/vLLM server) and returns the vector, so query vectors and stored values are generated directly in SQL. Since 1.11.0 a CREATE EMBEDDING INDEX ... USING MODEL keeps a vector column in step with a text column on its own, so the application stops orchestrating re-embedding. What needs embedding is derived from the data — a hash of the model and the text against the one recorded when the vector was written, not a write hook — so a bulk load, a restore, binlog replay and a replication apply are all covered rather than only the INSERT path. Write-back runs in a serializable transaction, so an UPDATE landing while the provider is being called is never overwritten; failures back off and dead-letter after five attempts, which SHOW EMBEDDING INDEXES reports as Retrying or Failed.

Parallel OLAP

Large aggregations run through a parallel, streaming engine — analytical queries without a separate warehouse. Since 1.11.3 EXPLAIN says which path a query took: a grouped query used to answer type=ALL with an empty Extra, identical for the vectorised path and the one that spills to disk, so the server's defining feature was invisible from the client and nobody could see when a rewrite had pushed a query off the fast path. Extra now names it — columnar scalar, columnar group, parallel streaming, partitioned and spilling — and since 1.12.0 adds primary-key range, zone maps or columnar cache only when that is what will run; before, every columnar GROUP BY claimed zone maps, even with them turned off. 1.12.0 also sends a single aggregate down the columnar path and lets aggregation use up to eight cores, and an aggregate or GROUP BY over a primary-key range now reads only that range: SUM over half of 20M rows went from 1761 to 281 ms, and GROUP BY with id = 777 from 200 to 0.2 ms.

Full SQL surface

Joins, correlated subqueries, CTEs with WITH RECURSIVE, window functions, set operations and a large function catalog. Since 1.12.13 a join in parentheses works on the right of another join, where the tables inside it were never brought into scope; subqueries work in JOIN ... ON and in UPDATE ... SET, both refused with 1235; and UPDATE IGNORE works, where the parser read the keyword as the table name. A join whose ON adds a condition to its key (AND b.deleted_at IS NULL, every soft-deleting ORM's join) hashes on the key again: 98 s became 0.07 s on two 20,000-row tables. DROP TABLE and RENAME TABLE take a table's triggers with them, which stayed behind and fired on the next table of that name. Since 1.12.16 HAVING without GROUP BY filters the result rows, as in MySQL, where it was ignored and every row came back, an aggregate only in HAVING makes the query one group, and an uncorrelated subquery in HAVING works, where it was refused with 1235.

Serializable transactions

Snapshot and serializable isolation, so concurrent writers stay correct under contention (until 1.12.17 it did not hold: an autocommit UPDATE, DELETE, REPLACE, INSERT IGNORE or INSERT ... ON DUPLICATE KEY UPDATE read its rows outside any transaction and wrote them back unchecked, so eight sessions adding 1 to a row 200 times each left it at about 200 instead of 1600, with no error; concurrent INSERTs took the same AUTO_INCREMENT values and failed with a false Duplicate entry, or, in a table without a primary key, rows silently replaced each other; and a table scan inside a transaction stopped early after a write, so after BEGIN; DELETE FROM t WHERE id = 1 on a 10 000-row table, COUNT(*) was 8191. Such a statement now runs as its own transaction and re-runs on the new values, as MySQL's row lock would make it wait; only one that loses 64 times in a row reports 1213, and it is bounded by ELYRASQL_TXN_MAX_BYTES (1 GiB by default), like a transaction). Since 1.12.11 LOCK TABLES locks what MySQL locks: a SELECT of a WRITE-locked table read it, and a joined UPDATE or DELETE, the SELECT of an INSERT ... SELECT, a view over the table and CREATE TRIGGER went straight through a READ or WRITE lock and FLUSH TABLES WITH READ LOCK. They now wait, as in MySQL, and a second LOCK TABLES replaces the first one's locks.

Introspection

SHOW statements and INFORMATION_SCHEMA so existing tooling can browse the catalog out of the box. Views too since 1.12.9: information_schema.TABLES, SHOW TABLE STATUS and information_schema.COLUMNS left them out, so a tool that read the catalog to find a view found nothing, and DESCRIBE of a view failed with 1146. They are now listed and described as in MySQL, without reading a row.

Replication & HA

Built-in replication for read scaling and high-availability deployments, with Raft-style leader election for automatic failover. All inter-node traffic — the replication stream and the consensus control plane — is TLS-encrypted with peer-certificate verification when the cluster TLS variables are set, so a node that cannot verify a peer does not form a cluster with it. From 1.9.5 that fails closed. Through 1.9.4 setting only one of the two variables, or pointing them at a certificate that would not load, logged a warning and carried on unencrypted — so the operator most likely to be caught was the one who had configured TLS and mistyped a path. The control plane also refuses to bind to a non-loopback address without authentication now, rather than trusting the network. The replication endpoint itself was a wider gap, closed in 1.9.9: it hands a full copy of the database to every peer that connects, and until then it required no authentication on loopback at all — and the replica subcommand had no authentication flags in the first place, so it always started open. Both now refuse to start without ELYRASQL_CLUSTER_SECRET, and a replica verifies its primary before applying anything it sends, because a replica that cannot tell who is feeding it will serve whatever it is given. Since 1.12.11 a cluster commits as soon as a majority has a write: the leader waited for every follower, so a follower it could not reach added its 500 ms deadline to every write. In a three-node cluster with one node unreachable, a write took 513 ms and now takes 24 ms; acknowledged writes are on a majority as before (until 1.12.18 not on its disks: writes of the Raft log were best effort, so with one of three nodes down a write was acknowledged with only one node holding it on disk, a node added after compaction counted toward the majority with an empty database, and a restarted node applied entries a second time; a node now acknowledges only what it has written to disk, and one far behind catches up from a snapshot of the leader's database). Until 1.12.18 a replica could also keep rows its primary deleted, 100 rows against the primary's 50, with no error, when it received a full snapshot over its existing data, and a crash could keep a write in the database that the binlog never recorded, so replicas catching up from the binlog and point-in-time restores would silently miss it. A full snapshot is now applied only to an empty file, a restarted replica resumes instead of copying the whole database again, and each binlog group is written before its data commit and is durable no later than it. Raft cluster writes are 2-2.7x faster, and all nodes of a Raft cluster must be upgraded together.

Reviewed by someone who is not us

The last two releases came in as reviewed contribution stacks from an outside engineer, @HelgeSverre, who ran commercial Laravel codebases against isolated instances and reduced every failure to a generic MySQL reproduction. Seven fixes in 1.9.0 alone — each verified against MySQL 8.4 on identical data before merging, and in several cases by comparing the table contents afterwards rather than the statement's return code, because the failure mode was a statement that looked like it worked. None of them came from a bug report; they came from someone reading carefully with a reference implementation open.

Every one of them found by asking MySQL

The 1.8.0 corrections came from differential testing, not from reports — and three were silent, the kind that survives a suite written by the people who wrote the engine. CREATE TABLE ... AS SELECT was cut at the first parenthesis, so an aggregate lost half its query (materialized views run through CTAS, so those never worked either). UNSIGNED was enforced on BIGINT but not on INT, so Laravel got the constraint on foreignId() columns and not on unsignedInteger() ones. And SHOW CREATE TABLE omitted CHECK and FOREIGN KEY, so a dumped schema quietly lost constraints that were still being enforced. The harness is still finding them, and still by asking MySQL. 1.11.3: NOW() read the clock afresh on every call, so SELECT NOW() = NOW() was 0 and an ORM writing created_at and updated_at in one INSERT stored two different timestamps — the family is resolved to one instant per statement now, as MySQL does, with SYSDATE() left live because MySQL leaves it. And SET @var inside a stored procedure landed in the procedure's local scope and was discarded when CALL returned, which the harness had never covered because it had no stored-procedure section. It has one now. 1.12.7: a restored mysqldump had no views and no triggers, and no error said so. MySQL's version comments (/*! ... */), in which mysqldump writes every view and every trigger header, were skipped as comments; CREATE VIEW refused the ALGORITHM, DEFINER and SQL SECURITY clauses mysqldump writes on every view; and SET a = ..., b = ... ran only its first assignment, so a row with id 0 in an AUTO_INCREMENT column was renumbered on restore. And USER(), CURRENT_USER() and CONNECTION_ID() answered root and 1 for everyone, so an audit trigger recorded root for every change; they now answer for the connection that asks, checked position by position against MySQL 8.4. A mysqldump of a MySQL 8.4 database now restores with the mysql client — tables, rows, views, triggers and procedures — except stored functions, which ElyraSQL does not have yet. 1.12.8: in a join, ORDER BY a joined table's column that is not selected sorted by a selected column of another table with the same name. The rows were right and their order was not, and a LIMIT kept the wrong rows; it now sorts by that column. 1.12.9: mysqldump can dump an ElyraSQL database. It stopped at its first statement; now a dump restores into ElyraSQL or MySQL with its tables, rows, views, triggers, procedures, partitioning and statistics, and BLOB values in a dump restore. Name the database: --all-databases still gives an empty dump. And a partition bound written as MySQL writes it, followed by ENGINE = InnoDB as in every MySQL dump, lost its bound and became MAXVALUE, so TRUNCATE PARTITION p0 emptied the whole table; a table restored from such a dump before 1.12.9 has that partitioning, and SHOW CREATE TABLE now shows it. And until 1.12.15 a Navicat or mysqldump dump did not restore: index definitions as MySQL writes them — KEY k (a) USING BTREE, which is how Navicat and SHOW CREATE TABLE write every index, ASC / DESC key parts, COMMENT, VISIBLE / INVISIBLE — were refused with 1064, so every table with such an index failed to be created and its rows with it. A foreign key now shares an index that leads with its columns, as in MySQL, where it used to get an extra index of its own.

Laravel migrations run unmodified

Four commercial Laravel codebases were run against isolated ElyraSQL instances — the largest with 469 migration files — and every failure reduced to a generic MySQL reproduction. Two full application suites now pass: 278 tests / 764 assertions and 169 tests / 762 assertions. Almost none of the fixes were engine bugs; they were places where ElyraSQL answered correctly but differently — a column label, a coercion under a session SQL mode, a metadata field — and each of those differences would have become a driver-specific workaround in somebody's application. 103 new end-to-end tests run through the MySQL wire protocol to keep them closed. Since 1.12.1 DB_DATABASE can be any name: ElyraSQL accepts it as an alias for its one database and reports it as the schema, so Schema::hasTable() and SHOW introspection find what they look for, but two applications pointed at different names share one set of tables, so each application gets its own ElyraSQL instance.

Native on Apple Silicon

Tagged releases now attach a macos-aarch64 archive alongside the Linux ones, built and tested on an arm64 macOS runner with the minimum supported Rust toolchain — not cross-compiled and hoped for. The build targets macOS 11, and CI verifies the Mach-O architecture, minimum OS and signature, then runs the binary again after extracting the archive. Build metadata tells the truth too: @@version_compile_machine no longer claims an Apple Silicon build is Linux x86_64.

Checked against real MySQL, at every threshold

Every result is diffed row for row against an actual MySQL 8.4, because the failure that matters is not a crash — it is a query that quietly returns the wrong number. A 203-case differential battery was not enough: three wrong-result bugs still shipped, and all of them hid below the row counts the tests used. So the suite now replays its battery at sizes bracketing every internal threshold — 127/128/129, 255/256/257, 2047/2048/2049, 4095/4097, 8193 — where byte boundaries, join-strategy switches and spill partitions change behaviour. That is what caught the 1.4.14 aggregate bugs — and in 1.6.0 a join ON spanning both tables that was hashed as if it were an equi key, silently returning twice the rows MySQL does. It gates every push. A second harness that compares full table digests after a dump and reload was less lucky: added in 1.9.1, never wired into CI, and quietly broken from that release until 1.9.4 noticed. It runs nightly now, against five schema models — a tool nobody runs is a tool that has stopped working. Row-for-row was still not the whole answer, and 1.9.6 showed how: a boolean used as a number came back DOUBLE where MySQL sends BIGINT and every value matched, so every case passed — and nothing was looking at affected-row counts at all, which is how five upsert shapes reported the wrong number across two code paths. From 1.9.7 the differential compares column types and affected rows too, folding the distinctions no client can observe (integer widths, the string/blob family) so the ones that matter stay visible: comparing types exactly flagged 88 of 210 cases, and folding brings that to 19 tracked with their reason. A check that cries wolf gets skimmed, and then the real finding beside it does too. Verified by running it against the pre-fix binary, where it reports precisely the twelve divergences it was built to catch. 1.12.1 closes three more places where ElyraSQL was close to MySQL and not equal to it. START TRANSACTION READ ONLY was accepted and not enforced, so an INSERT inside one ran and only a later ROLLBACK undid it; every data write is now refused before it runs, with MySQL's error 1792 (DDL in a read-only transaction commits it first and runs, as in MySQL, since 1.12.3), and the forms around it work as in MySQL, checked statement by statement against MySQL 8.4. SELECT ... INTO @var assigns the variable instead of returning the row, and DROP DATABASE of a name that holds nothing is MySQL's 1008, not not supported. Three fixes that change what existing code can see come with an upgrade note. 1.12.2 adds a fourth: a SELECT in a procedure body ran but its rows were dropped, so CALL answered with only an OK. Every SELECT, in loops, handlers and nested CALLs too, now comes back as its own result set, followed by the CALL's OK, as MySQL sends them, over the text and the binary protocol. The server now offers CLIENT_MULTI_RESULTS, which clients such as mysql_async and sqlx only use when offered, and a client without it gets MySQL's 1312. A client that called a procedure and read only an OK will find result sets first, and has to read them or move on to the next result. 1.12.3 adds three more, each checked against MySQL 8.4. \_ and \% in a LIKE pattern match literally: the backslash was dropped when the string was read, so 'axb' LIKE 'a\_b' was true, and a search that escapes its input with Laravel's addcslashes($term, '%_') matched rows it should not have. DDL commits the open transaction first, as in MySQL: CREATE, ALTER, DROP, RENAME, TRUNCATE, account statements, LOCK TABLES, ANALYZE TABLE and a new BEGIN used to run inside the open transaction, so a ROLLBACK after INSERT followed by CREATE TABLE undid the INSERT as well, and a second BEGIN silently discarded its writes, where MySQL commits them; code that relied on a ROLLBACK reaching back past a DDL statement will no longer get that. And SHOW TABLES applies its LIKE and WHERE and lists views: SHOW TABLES LIKE 'nope' used to list every table, so a tool that checked for a table that way always found it.

One query cannot stall the rest

A long synchronous stretch — a join product, a sort, aggregation over materialised rows — used to monopolise a runtime worker, and enough of them stopped the server accepting connections at all. Heavy stretches now hand the worker back and the streaming joins yield, with no configuration: 32 runaway queries on 16 cores still leave a new connection answered in under 0.1 s. Set ELYRASQL_QUERY_TIMEOUT_MS and the deadline is enforced inside the row loops, so a runaway actually stops burning CPU.

Bounded, the way MySQL is

One authenticated client should not be able to take the server down. Connections, prepared statements, streamed parameters and materialising joins are capped with MySQL's own variables, defaults and error codes — max_connections at 151 answering surplus connections with 1040 rather than a bare reset, max_prepared_stmt_count at 16382 with 1461, max_allowed_packet at 64 MiB with 1153 — and, as in MySQL, one connection slot is reserved for an Admin account so an operator can still get in and KILL sessions on a saturated server. A materialising join is bounded per join and across all of them at once (ELYRASQL_JOIN_MAX_ROWS, ELYRASQL_JOIN_MAX_ROWS_TOTAL), because memory scales with concurrency: eight concurrent cross joins went from 97 GB and a killed process to a 5.4 GB plateau with an error that names the limit.

Sorts Nordic text the way MySQL does

The default collation is utf8mb4_0900_ai_ci, matching MySQL 8: case- and accent-insensitive, so ‘café’ = ‘cafe’, ‘Straße’ = ‘Strasse’, ‘æ’ = ‘ae’, and Ærlig sorts among the A’s instead of after zz. This was not a cosmetic sort-order difference — WHERE s > ‘cat’ returned a different set of rows than MySQL, which is a wrong answer for Nordic and other European text. The folding table is derived from MySQL's own WEIGHT_STRING output rather than written by hand, so it cannot disagree with the collation it implements. Since 1.12.12 LIKE on the default collation folds accents too, as MySQL does: ‘café’ LIKE ‘cafe’ was false. A utf8mb4_bin column's collation is followed by LIKE, IN and COUNT(DISTINCT), which compared case-insensitively whatever the column, and COLLATE and the BINARY operator work in expressions: WHERE s COLLATE utf8mb4_bin = ‘x’ and BINARY s, the usual way to compare a column exactly, were refused with 1235.

Rows cost what the query reads

A row is one encoded blob, so materialising a column nobody selected still pays for the allocation — and row-oriented paths decoded every column of every row, meaning cost scaled with how wide your table is rather than with what you asked for. Scans now decode only the referenced columns, and ORDER BY … LIMIT k asks whether a row would survive the top-N before building it at all. On 200k rows: ORDER BY … LIMIT 100 over 12 columns 95 → 31 ms, a 1:1 join COUNT(*) 492 → 150 ms, and a join emitting 40M rows 33.3 s → 1.13 s. An unbounded sort and a plain COUNT(*) scan did not move — the controls matter as much as the gains, because nothing was traded away.

Non-equi joins answer instead of erroring

ON a.id < b.id or a BETWEEN band join had no equality to hash, so the whole product was materialised until it hit the memory ceiling and the query was refused. Those joins now stream: memory stays flat — a 20k-row three-way inequality join leaves the server at its 34 MB idle footprint. Be aware the work is still quadratic and the row ceilings no longer bound it, so bound the time with ELYRASQL_QUERY_TIMEOUT_MS instead. When the ON mixes an equality with other conditions, the equality is still hashed and the rest applied as a residual.

A planner that counts the cost

Using an index is not automatically cheaper: a secondary-index range fetches every matching row by key, so a wide range was slower than reading the table — COUNT(*) WHERE amt > 0 took 124 ms, while the same rows written as a non-indexable filter took 2.7 ms. A range matching more than ELYRASQL_INDEX_RANGE_MAX_FRACTION of the table now falls back to a scan, decided after walking the keys but before fetching a single row, so a misjudged range costs only a key walk. And col IN (…) finally uses the index, or compiles to a hash-set test when a scan is right. On 200k rows: amt > 0 124 → 16.5 ms, IN (500 values) 102 → 5.7 ms. Since 1.12.17 an index over a FLOAT/DOUBLE or BINARY/VARBINARY/BLOB column holds its rows: these values had no key encoding, so CREATE INDEX succeeded but left every row with a non-NULL value out of the index, without an error, SELECT * FROM products ORDER BY price LIMIT 10 returned only the rows whose price is NULL, and a UNIQUE index accepted any number of duplicates. Floats now encode in numeric order and binary strings in byte order; on first start the indexes an earlier version left empty are filled in, and each duplicate a UNIQUE one already holds is logged as an error naming the table, the index and the row.

OLAP-fast

Vectorised columnar aggregation and parallel clustered scans — on native Linux over 1M rows, the fastest of ElyraSQL, PostgreSQL 17 and MySQL 8.4 on every OLAP aggregation, 2–5× ahead of MySQL. Written in Rust, no GC pauses.

Get SQL Server

MySQL-compatible,
one file, in Rust.

Free and open source. Pair it with the SQL Client, or explore the whole SQL family.