Released Nov 3, 2026
4.0.0
LATEST STABLESurrealDB 4.0 is here, and it marks a major milestone in the history of SurrealDB. This release brings a record amount of new functionality, usability improvements and bug fixes, all built on a new query executor. Moving a 3.x datastore across is one-way and needs an opt-in, so check the upgrade notes before you upgrade.
Highlights
⚡ One executor for every statement
Until now, SurrealDB had several query planners, picked with --planner-strategy, and the same query could give different answers depending on which one ran it. For 4.0 we replaced them with one executor, which compiles each statement to bytecode and caches it. A table's SELECT permission is now part of that plan, so the planner optimises it together with your WHERE. Large work spreads out too: a selective scan reads its table on several threads at once, and a sort, GROUP BY or join that outgrows its memory share spills to disk instead of failing:
SELECT user, count() AS total FROM event GROUP BY user ORDER BY total DESC;Parallel scans run on every storage engine except in the browser, and without ORDER BY, rows can now arrive in any order. SURREAL_MEMORY_LIMIT sets how much memory a node's queries may hold before they spill.
Using several cores · Memory limits and spilling to disk · Results without ORDER BY
🐘 Talk to SurrealDB in PostgreSQL or MySQL
In 3.3, a PostgreSQL client could connect to SurrealDB, but it still had to send SurrealQL. We taught 4.0 both dialects: the --postgres-bind listener now runs PostgreSQL SQL, and the new --mysql-bind listener runs MySQL, over the same tables that SurrealQL reads and writes. Clients such as psql and mysql, drivers, and ORMs such as Drizzle, Prisma and TypeORM work with it as they are:
SELECT name, city, rank() OVER (PARTITION BY city ORDER BY age DESC) AS age_rank
FROM person;Joins, subqueries and window functions give the answers PostgreSQL and MySQL would. The pgsql and mysql RPC methods run the same dialects over WebSocket and HTTP, with the SQLSTATE codes that SQL client libraries expect.
PostgreSQL SQL · The MySQL dialect · The pgsql RPC method
🧩 Extensions that say who signed them
Running someone else's code inside your database calls for knowing who built it and limiting what it can reach. For 4.0 we renamed Surrealism modules, the WebAssembly packages that add your own functions to SurrealQL, to extensions. Each definition now names the key that signed the archive, or states plainly that it is unsigned, and grants capabilities one at a time:
DEFINE EXTENSION ext::colour FROM f"extensions:/acme-colour-1.0.0.surli"
SIGNER { key: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPhuVs9Jcx4/KCUWdMr/8Vv2BDOMj5v1qyDhCRlcDttN" }
CAPABILITIES { net: ["api.colour.io:443"], functions: ["http::get"] };An extension reaches no network, calls no function and writes nothing until its CAPABILITIES grant it, and every call starts on a fresh instance. surreal ext builds, signs and installs extensions. Modules built for 3.x need a rebuild before they run on 4.0.
DEFINE EXTENSION · surreal ext · Upgrading a module to 4.0
🔁 Type changes that bring stored records along
Changing a field's type used to change only its definition. Records already stored kept their old shape, so every query had to cope with both. A field change can now say what happens to the records that are already there:
ALTER FIELD age ON person TYPE int
MIGRATE EXISTING ROWS AS age_to_int USING <int>$value FALLBACK 0;Each record converts the first time it is read while a background job rewrites the table, and a value that cannot convert takes the FALLBACK. Because the migration has a name, it runs once, which keeps a schema script safe to run again. In a datastore created by 4.0, a SCHEMAFULL table with records asks for a migration whenever a change might not fit them. A datastore upgraded from 3.x keeps the old rules until you raise it with ALTER DATABASE COMPATIBILITY 4.
Migrating existing records · Compatibility level
🔢 Integers and floats with a declared width
Every whole number in SurrealDB used to be a 64-bit int and every fraction a 64-bit float, so a schema could not say that a sensor id fits in two bytes or that an embedding needs only 32-bit precision. 4.0 brings integer and float types from one byte to eight. A field declared with one stores its values at that size and turns away any value that does not fit:
DEFINE FIELD sensor ON reading TYPE u16;
DEFINE FIELD level ON reading TYPE f32;
CREATE reading:1 SET sensor = 65535, level = 1.25;
-- [{ id: reading:1, level: 1.25f32, sensor: 65535u16 }]
CREATE reading:2 SET sensor = 65536, level = 1;
-- "Couldn't coerce value for field `sensor` of `reading:2`: Expected `u16` but found `65536`"Arithmetic on sized values fails rather than wrapping round, so 255u8 + 1u8 is an error instead of a quiet 0. SDKs on the new CBOR v2 protocol get the exact width back, while 3.x SDKs carry on over the original protocol.
Sized numbers · Sized number fields · CBOR v2
🧾 Serializable transactions, and reads that never write
Snapshot isolation, the default, lets two transactions each read something the other is about to change. Two receptionists booking the last free Monday slot can both see an empty calendar, and both bookings commit. BEGIN learned to ask for a stronger guarantee:
BEGIN ISOLATION LEVEL SERIALIZABLE;
LET $booked = SELECT VALUE id FROM booking WHERE day = 'monday';
IF $booked.is_empty() {
CREATE booking SET doctor = doctor:ana, day = 'monday';
};
COMMIT;When two of these run at once, the second COMMIT now fails with a conflict you can retry. The in-memory engine and SurrealDS offer the level, while SurrealKV refuses it outright rather than quietly running at a weaker one. BEGIN READ ONLY turns away every write, and on SurrealDS, MAX STALENESS 5s lets a report read a snapshot up to five seconds old.
Serializable isolation · Read-only transactions
💾 One storage engine from server to browser
On-disk storage used to come in several engines, with RocksDB on servers and IndexedDB in the browser. From 4.0, SurrealKV is the one engine on a server, in an embedded SDK and in the browser, where it keeps the database in the Origin Private File System. A rocksdb:// or indxdb:// path still opens, and SurrealKV converts it on the first start that sets SURREAL_EXPERIMENTAL_UPGRADE_FROM_3X=true. To keep the original directory, convert into a new one ahead of time:
skv migrate path/to/rocksdb-database path/to/surrealkv-database
SURREAL_EXPERIMENTAL_UPGRADE_FROM_3X=true surreal db start --user root --pass secret surrealkv://path/to/surrealkv-databaseSince the beta, SurrealKV also keeps dead blocks out of its cache, which cut a server's peak memory in one 5-million-record benchmark from 35.7 GiB to 8.0 GiB.
Opting in to the upgrade · Moving a RocksDB database to SurrealKV · RocksDB and IndexedDB are removed
🌐 SurrealDS 1.0, with the data in object storage (Enterprise)
A database that has to keep serving through the loss of a node, or of a whole zone, needs each write in more than one place before it says yes. In 4.0, SurrealDS 1.0 becomes the distributed storage engine of SurrealDB Enterprise, in place of the ds-* engines. Every node is a full SurrealDB server that keeps a commit log on its own disk, while the data lives in object storage:
surreal start --bind 0.0.0.0:8000 "surrealds://?config=/opt/surrealdb/etc/node.json"A write is acknowledged once it is on disk in two zones, and adding nodes adds read capacity without bigger disks. The object store can be Amazon S3 or an S3-compatible service, Azure Blob Storage or Google Cloud Storage. Moving from the ds-* engines takes an export and an import.
SurrealDS · Node configuration · The Kubernetes operator
Also new
Named types:
DEFINE TYPEgives a rule such as'sad' | 'ok' | 'happy'a name that any field can use like a built-in type, and a union sorts in the order you declared it. For data from a SQL database,SQL TYPEon a field keeps the exact column type, such asnumeric(10,2), and checks it on every write. (learn more)Named id parts: You can now name the parts of an array record id, as in
TYPE [city: string, time: datetime], and query them like fields, so one city's week of readings is a key-range scan and the latest ten read backwards from the newest. (learn more)Stable file storage: Buckets and file values no longer need
--allow-experimental files, a bucket can belong to the root or a namespace, and presigned URLs let a browser upload or download a file without your credentials. (learn more)An index for places: "Which cities are within 400 km of London?" no longer checks the geometry of every record, because the new
SPATIALindex keeps geometries on a grid over the globe and reads only the cells a query asks about. It works alongside other indexes and can narrow a vector search to an area. (learn more)Cookie sign-in: Browser apps can let SurrealDB hold their session for them. With
--cookie-auth, signing in through/signin/cookieputs the token in anHttpOnlycookie that page scripts never see, with a rotating refresh cookie for record access definedWITH REFRESH. (learn more)APIs with caller permissions:
DEFINE API ... SECURITY INVOKERruns an endpoint with the caller's own permissions, so it returns exactly what that user could read with a direct query. (learn more)Stored back-references:
MATERIALIZE INTOkeeps a list of the records that point at a record on the record itself, so an author's posts are one field read away. (learn more)Unique nulls:
UNIQUE NULLS NOT DISTINCTtreatsNULLas a value, so only one record can leave a unique fieldNULL. (learn more)Keeping the rest: Destructuring learned
..., which keeps every field you did not name, soperson.{ address: address.{ city }, ... }trims the address and leaves the rest alone. (learn more)Automatic retries: A statement outside a transaction that loses a write conflict now runs again by itself, unless it reaches outside the database with a call such as
http::get. (learn more)Scoped URLs: An HTTP request can now name its namespace and database in the path, as in
POST /ns/shop/db/prod/sql, so a tool or proxy needs no extra headers. (learn more)Shaped results: Clients can ask for results that send each row's shape once and then only the values. (learn more)
Query graph tracing: A
querycall can ask for atraceof the relations, references and links its statements followed, so a tool can draw the graph behind a result. (learn more)Distance-ordered vector search:
ORDER BY vector::distance::cosine(embedding, $q) LIMIT 10is now answered by an HNSW or DiskANN index, and DiskANN indexes now work in every WebAssembly build, the browser included. (learn more)Finer capabilities:
--allow-net "*.example.com"covers every subdomain, and--allow-mcpand--deny-mcppick out individual MCP tools. (learn more)Rust and browser SDKs: The Rust SDK can call
DEFINE APIendpoints withSurreal::api(), and the browser build shrank by 1.9 MB. (learn more)Faster lookups: A query that names its records, such as
id IN [...], now reads them by key, and a subquery that does not depend on the outer row runs once per statement instead of once per row. Single-record requests also use less server CPU, and large results come back faster over WebSocket.Ranked full-text search:
ORDER BY search::score(1) DESC LIMIT 10now skips the documents that cannot reach the top results, and a per-node cache keeps the postings of frequent terms in memory. Existing indexes take the faster layout when you rebuild them. (learn more)Faster vector search: HNSW now scores vectors with the CPU's SIMD instructions, DiskANN walks compact 8-bit codes before an exact final ranking, and a filtered search scores its candidates from the index instead of reading their records. Rebuilt indexes adopt the new layout. (learn more)
pgvector compatibility: PostgreSQL connections now accept pgvector's
vectortype, its distance operators andCREATE INDEX ... USING hnsw, which becomes a SurrealDB HNSW index, so an application written for pgvector can keep its queries. (learn more)PostgreSQL token sign-in: A PostgreSQL client can send a token that SurrealDB issued, such as a record user's, as its password, and its queries then run under that user's table permissions. (learn more)
Surreal CLI components: The database command line is now the
dbcomponent of the Surreal CLI, which installs and upgrades it for you, andversion,is-readyandvalidatecan answer in JSON for scripts. (learn more)Replica reads (Enterprise): A transaction on a SurrealDS 1.0 node that is still catching up now has its reads answered by the sequencer instead of failing, and
VERSION <datetime>works on every node of a group. (learn more)
Upgrade notes
The 3.x to 4.0 upgrade guide covers each of these in detail.
Opt in to the upgrade: Start 4.0 on a 3.x datastore with
SURREAL_EXPERIMENTAL_UPGRADE_FROM_3X=true, or theexperimental_upgrade_from_3xoption on an embedded engine. Without it, 4.0 refuses to start and leaves the files unchanged. A new datastore needs no opt-in. (learn more)One-way upgrade: Take an export before upgrading, because once 4.0 has upgraded a datastore, no 3.x release starts on it. (learn more)
PostgreSQL clients: Send SurrealQL over HTTP, RPC or an SDK instead of the PostgreSQL wire protocol, which now runs PostgreSQL SQL and refuses
SET dialect = 'surrealql'. (learn more)Extensions: Rebuild every
.surliarchive for the 4.0 interface and define each module again as an extension, because 4.0 refuses a 3.x archive withUnsupported ABI versionwhen it is called. (learn more)SurrealML: Remove machine learning models on 3.x before upgrading, because SurrealML is removed and 4.0 refuses to start on a datastore that still holds a model. (learn more)
TiKV: Run
surreal-tikv, built from thesurrealdb/surrealdb-tikvrepository, because the standard binary and images no longer accepttikv://paths. The paths, flags andSURREAL_TIKV_*settings are unchanged. SurrealDB Enterprise no longer builds TiKV by default either. (learn more)Buckets: Remove
filesfrom--allow-experimentalandSURREAL_CAPS_ALLOW_EXPERIMENTAL, which now refuse it, and give everyDEFINE BUCKETaBACKEND. (learn more)SDKs first: Upgrade every SDK before the server, because 4.0 refuses the text forms of datetimes, UUIDs and durations that some earlier Python, PHP and Go SDKs send, and 3.x Rust SDKs refuse a 4.0 server. (learn more)
Storage conversion: Leave room on disk for a second copy of a RocksDB or SurrealKV datastore, and give health checks extra time on the first opted-in start, because the conversion runs before the server answers
/health. Runskv migratebeforehand to keep the original directory. (learn more)Clusters: Upgrade every node to the latest 3.3 release first, and hold off on
LIVEqueries and DiskANN writes until every node runs 4.0. A TiKV datastore switches to the 4.0 format only once every node is started withSURREAL_FEATURE_LEVEL=4.0. (learn more)Index rebuilds: Rebuild HNSW indexes that use
JACCARDorPEARSONand full-text indexes whose records were updated and later deleted, and redefine any DiskANNTYPE I8orTYPE U8index above 33025 dimensions. (learn more)Configuration: Move
SURREAL_KNN_PREFILTER_EF_BOOSTtoSURREAL_KNN_PREFILTER_HNSW_EF_BOOSTif you tuned it for HNSW, and removegqlfrom--allow-experimental, which now refuses it. (learn more)Earlier storage engines (Enterprise): Move a deployment on
ds-mem,ds-rocksdb,ds-cloudords-singletosurrealds://with an export and an import, because 4.0 no longer has those engines. (learn more)Isolation (Enterprise): Start a transaction with
BEGIN ISOLATION LEVEL SERIALIZABLEwherever it needs serializable isolation, because SurrealDS 1.0 runs transactions at snapshot isolation by default. (learn more)Rust SDK: Replace the
kv-rocksdbandkv-indxdbfeatures withkv-surrealkv, and importAolMode,SnapshotModeandSyncModefromsurrealdb::opt. (learn more)Row order: Add
ORDER BYto any query that relies on the order of its rows, or onLIMITreturning the first records by key, because a scan split across threads returns rows in any order. (learn more)Behaviour changes: Check your queries against the behaviour changes in the guide. The ones most likely to matter are exact float and decimal comparison,
SPLITnaming the result's field, KNN operators inUPDATEandDELETE, and writes that create a table. (learn more)
All changes
SQL dialects
The
--postgres-bindlistener runs PostgreSQL SQL, and the new--mysql-bindlistener runs MySQL. Both read and write the same tables as SurrealQL. A PostgreSQL connection refusesSET dialect = 'surrealql'withthe surrealql dialect is not available over the PostgreSQL protocol.The
pgsqlandmysqlRPC methods run SQL over WebSocket and HTTP, with column metadata, command tags, SQLSTATE codes and transaction status, so PostgreSQL and MySQL client libraries can use them.Window functions (
row_number,rank,dense_rank,percent_rank,cume_dist,ntile,lag,lead,first_value,last_value,nth_value, andsum,avg,count,minandmaxover a frame) run withPARTITION BY,ORDER BY, namedWINDOWs andROWSframes, and spill to disk when a window is large.GROUPSframes andRANGEwith a numeric offset are refused.PostgreSQL connections accept SQL
PREPARE,EXECUTEandDEALLOCATE,generate_series, the catalogue queries behindpsql's\l, and the statementspgbench -isends before it loads data. MySQL connections accept user variables,PREPARE ... FROM,SHOW TABLE STATUSandSHOW TRIGGERS, andcaching_sha2_passwordauthentication without TLS, where the client asks for the server's RSA public key with--get-server-public-key. (learn more)DROP SCHEMA public CASCADEremoves every table of the database, andpg_matviewsanswers with an empty list.PostgreSQL connections accept pgvector's
vector(n)type, the<->,<=>,<#>and<+>operators andCREATE INDEX ... USING hnsw, which becomes a SurrealDB HNSW index servingORDER BY ... LIMIT k.PostgreSQL connections answer
information_schemaandpg_catalogqueries andCOPY, and errors carry PostgreSQL's SQLSTATE codes, such as23505for a unique violation.A PostgreSQL client can send a SurrealDB-issued token as its password, and
SET ROLEandrequest.jwt.claimscan only narrow the session's privileges.The PostgreSQL port offers the
postgresqlALPN protocol, sopsql17 connects withsslmode=require.
Types
DEFINE TYPE <name> AS ...names a union of values, an object shape or a checked scalar, with optionalASSERTandDEFAULT. The name works as a field type, insideoption<...>and as a cast.ALTER TYPE ... ADD VALUEandRENAME VALUEchange a union,REMOVE TYPEremoves one, andINFO FOR DBlists them undertypes.A union of values sorts in declaration order, and
enum::rank,enum::min,enum::maxandenum::valuesread that order.The
date,time,timestamp,intervalandbigdecimaltypes are new, with the literalspd'2026-10-26',pt'06:30:00',ts'2026-10-26T06:30:00',ivl'8 hours'and thebigdecsuffix.DEFINE FIELD ... SQL TYPE POSTGRESQL | MYSQL | DYNAMODB '<type>'records the column type a SQL client sees and checks it on every write, SurrealQL writes included. Every built-in PostgreSQL 17 and MySQL 8.4 column type maps to a SurrealDB type, and a type with no mapping is refused by name.
Files and buckets
Buckets and file values are stable.
filesis no longer an experimental capability, and the Rust SDK no longer hasExperimentalFeature::Files.DEFINE BUCKET ... ON ROOT | NAMESPACE | DATABASEsets a bucket's level, andDEFINE BUCKETneeds aBACKEND, such as"memory"or"global://path", failing otherwise withDEFINE BUCKET needs a BACKEND. A 3.3 bucket without a backend keeps its objects.file::presign_getandfile::presign_putreturn presigned URLs signed withSURREAL_BUCKET_PRESIGN_SECRET, andALTER BUCKET ... REVOKE SIGNATURESinvalidates every URL already issued.file::putstores acontent_type, andfile::listtakesprefix,delimiter,startandetagon every backend.The
/bucketHTTP routes answerGET,HEAD,PUT,DELETEandPOSTcopy and rename, at/bucket/{name}/...,/ns/{ns}/bucket/{name}/...or/ns/{ns}/db/{db}/bucket/{name}/....
Queries
A condition
id IN [...]on a list literal, or a parameter bound to one, reads the listed records by key. A subquery that does not read the outer row runs once per statement, including one that runs a KNN or full-text search, andx IN (SELECT ...)probes the subquery's rows instead of scanning them for each outer row.Every statement runs on one executor, which plans it, compiles it to bytecode and caches the compiled plan per statement.
--planner-strategyandSURREAL_PLANNER_STRATEGYhave no effect.A table's
PERMISSIONS FOR selectpredicate is planned with the statement that reads the table, instead of being evaluated on each record after the read. A permission that tests membership in a subquery, such asowner IN (SELECT VALUE id FROM team WHERE ...), runs the subquery once as a join rather than once per record.A read-only scan whose
WHEREkeeps a small share of the records it reads is split into parts that worker threads read at once, on every storage engine except in the browser.SURREAL_MORSEL_PLACESlimits the threads one statement can hold,SURREAL_MORSEL_OLTP_RESERVEkeeps threads free for short statements (1by default), andSURREAL_MORSEL_SPLIT_PASS_PPMsets the share below which a scan is split. Index builds and background compaction share the same pool.Without
ORDER BY, a split scan returns rows in any order, soLIMITorSTARTwithoutORDER BYreturns some rows rather than the first by key, and which failing row's error is reported is unspecified. WithORDER BY, the order is exact, ties included.Destructuring accepts a trailing
..., which keeps every field the pattern did not name, on objects and on record links.UPDATEandDELETEuse indexes for conditions on bound parameters, such asDELETE t WHERE time < $cut, and evaluate aWHEREon stored values before decoding records.Aggregates run by record users no longer derive
COMPUTEDfields that the query does not read.A standalone statement that loses a retryable write conflict is planned and run again, up to 10 attempts in all within its timeout. Statements with an external effect, such as an
http::*call, are not retried.array::min()andarray::max()work asGROUP BYaggregates, andarray::group()returns the unique values of a group.A
GROUP BYprojection that does not read the record is evaluated once per group, so a constant expression gives one value.A group key or aggregate argument that ran a subquery, block, custom function or script and then failed returns the error instead of
NONE. Nested aggregates inGROUP BYfail withNested aggregate functions are not supported.SPLITnames a field of the result, under its alias where it has one, soSELECT tags AS t FROM person SPLIT tagsfails withMissing split idiom `"tags"` in statement selection.SELECT * FROM ONLY [item:404]returnsNONEwhen the record does not exist, where 3.3 failed withExpected a single result output when using the ONLY keyword.Nested arrays in
FROMare flattened, soSELECT VALUE $this FROM [[1, 2], [3]]returns[1, 2, 3].A record id on a table that does not exist is an error rather than
[]orNONE.A float equals a decimal only when the decimal is exactly the float's value, so
0.1f = 0.1decisfalse.An array slice past the end, such as
[1, 2][0..10], returns the elements it covers instead ofNONE.LETcannot set$this,$self,$parent,$value,$input,$before,$afteror$eventinside a block, loop, condition, function or closure, which fails with'parent' is a protected variable and cannot be set. ALETused as the value of an expression, including as a branch ofIF ... THEN ... END, fails withLET statements can only appear at the top level of a query or inside a block expression.A top-level
RETURNno longer skips the statements after it.GeoJSON objects from parameters, HTTP responses or JSON fields are accepted wherever a geometry is expected, including in the geometry operators.
A range passed to a
function()script arrives as aRangeobject, and a returnedRangeconverts back.
Transactions
BEGIN READ ONLYstarts a transaction that refuses writes and returns a description of its snapshot.MAX STALENESS <duration>lets it read a published snapshot no older than the bound, andSTRICTfails it when none is recent enough. Only SurrealDS publishes snapshots; every community engine reads the current state, which meets any bound.SURREAL_READ_SNAPSHOT_MAX_STALENESS_SECS(3600 by default) caps the bound, andSURREAL_READ_SNAPSHOT_FALLBACKsets the behaviour when no snapshot qualifies.BEGIN ISOLATION LEVEL SNAPSHOT | SERIALIZABLEselects the isolation level. The in-memory engine and SurrealDS offerSERIALIZABLE, and SurrealKV and TiKV refuse it withThe isolation level SERIALIZABLE is not available on this datastore; it offers SNAPSHOT. It cannot be combined with aMAX STALENESSabove zero.The
beginRPC method takesread_onlyandisolationoptions, HTTP/sqltakesread_only_max_stalenessandread_only_strict, and the Rust SDK hasBegin::isolation(),Begin::client()andTransaction::client().A failing statement cancels its transaction, and
LETvalues set in a cancelled transaction are discarded.A
DEFINE APIhandler or middleware that fails rolls back everything it wrote, including events, index entries and sequence draws, and so does a failedsurrealdb.querycall that a script catches.
Schema and writes
DEFINE FIELDandALTER FIELDacceptMIGRATE EXISTING ROWS AS <name> USING <expression> [ FALLBACK <value> ]. A record converts the first time it is read, and a background job rewrites the table.USINGreads$valueand may call only built-in functions, and a migration name runs once.ALTER TABLE ... MIGRATE EXISTING ROWS AS <name> REMOVE UNDECLARED FIELDSremoves the fields the schema does not declare.A database has a compatibility level,
3or4, set withDEFINE DATABASE ... COMPATIBILITY,ALTER DATABASE COMPATIBILITYorALTER SYSTEM COMPATIBILITY. At level 4, aSCHEMAFULLtable with records refuses a field change its records might not satisfy unless the statement migrates them. A datastore created by 3.x stays at level 3, and a new 4.0 datastore starts at level 4.Sized number types
i8,u8,i16,u16,i32,u32,u64,f16andf32are available in fields, casts and literals (255u8,1.5f32), withtype::conversion andtype::is_checks for each.i64andf64are aliases ofintandfloat. Arithmetic on two values of the same sized type fails on overflow, and mixed types widen to the smallest type that holds both.The elements of an array record id can be named in the
idfield's type, as inTYPE [city: string, time: datetime]. Each name reads as a field, conditions on the names become key-range scans, andORDER BYon a following component reads in key order.REFERENCE ... MATERIALIZE INTO <table>.<field> [ WHERE <condition> ]stores on each referenced record a sorted list of the records that reference it, kept current in the same transaction.DEFINE FIELD OVERWRITE ... REFERENCEandALTER FIELDon a populated field write reference keys for existing records.COMPUTED,PERMISSIONS,ASSERT,VALUEandDEFAULTclauses may not have side effects, and the check follows custom functions they call.A
CREATE,UPSERT,INSERTorRELATEthat implicitly defines a table needs permission to runDEFINE TABLE. A databaseVIEWERnow getsIAM error: Not enough permissions to perform this action. Record users are unaffected.A nested field needs a parent whose type can hold it, and
DEFINE FIELD id.<part>needsiditself defined first. A view may not read its own table, and changing a table betweenNORMALandRELATIONchecks its records.A whole-record
PATCHreplace with a value that is not an object fails withCannot use 5 in a CONTENT clauseand leaves the record unchanged.Integer overflow in
math::sumis an error, and a decimal literal with more than 28 decimal places is a parse error.
Indexes
DEFINE INDEX ... SPATIALindexes any geometry type on a grid of cells, servingINSIDE,CONTAINS,INTERSECTS,CONTAINSANY,CONTAINSALL,ANYINSIDE,ALLINSIDEandgeo::distance(...) < r, alone or combined with other indexes, and pre-filters KNN searches by area.UNIQUE NULLS NOT DISTINCTmakesNULLtake part in uniqueness.NONEis still not compared.A
DEFINE INDEXorREBUILD INDEXwithoutCONCURRENTLYcommits its definition before it builds and returns once the index is online. A build that fails removes the definition afterwards, and aUNIQUEindex whose build failed refuses writes. A blockingDEFINE INDEXafter writes to the same table in the same transaction is refused.An unchanged
DEFINE INDEX OVERWRITEkeeps its index instead of rebuilding it.Standard and
UNIQUEindex builds scan in parallel batches, set bySURREAL_INDEX_BUILD_PARALLELISM, and DiskANN indexes build in parallel.count()overIN [...]orORconditions on a B-tree index is answered from the index without reading records.An index records whether a column has ever held an array, so a column that never has can serve
ORDER BY ... LIMITand ranges from index order.A
UNIQUEindex overs.*on a set field uses the whole set as its key, ands.*over a set returns a set.
Vector and full-text search
HNSW scores vectors with the CPU's SIMD instructions, and a filtered KNN search scores the candidates its pre-filter admits from the vectors the index stores.
DiskANN searches walk 8-bit quantised codes on indexes defined or rebuilt on 4.0, controlled by
SURREAL_DISKANN_QUANTIZED_SEARCH, withSURREAL_DISKANN_SEARCH_BEAM_WIDTHfor the beam width.Full-text indexes defined or rebuilt on 4.0 store each term's postings in blocks, so a query ranked by
search::scoreskips blocks that cannot reach its top results. A per-node cache of compacted terms is sized bySURREAL_FULLTEXT_CACHE_SIZE.A KNN operator in the
WHEREof anUPDATEorDELETEneeds a vector index on the field and is answered from it. AnUPSERTwith a KNN operator always fails.The KNN query vector cannot depend on the record being scanned, which fails with
The KNN query vector cannot depend on the record being scanned.HNSW indexes using
JACCARDorPEARSONrank by distance.DiskANN
TYPE I8andTYPE U8indexes are limited toDIMENSION 33025.Pre-filtered KNN is tuned by
SURREAL_KNN_PREFILTER_HNSW_EF_BOOSTandSURREAL_KNN_PREFILTER_EXACT_COST.SURREAL_KNN_PREFILTER_EF_BOOSTnow applies to DiskANN only.Vector measures over eight or more floats sum their terms in a different order, so results can differ in their last digits.
ORDER BY vector::distance::<metric>(field, $q) LIMIT kis answered by an HNSW or DiskANN index on the field, with pre-filtering, andvector::distance::cosineis new.WITH INDEXcombines with a KNN search: the vector index still runs the search, and the hint picks the indexes that build its pre-filter.DiskANN indexes work in every WebAssembly build, including
wasm32-unknown-unknownin the browser and at the edge.
Storage
Sorts, grouped aggregates,
DISTINCTand joins spill to files inSURREAL_TEMPORARY_DIRECTORYonce they pass their share of the node's query memory, whichSURREAL_MEMORY_LIMITsets. It defaults to half ofSURREAL_MEMORY_THRESHOLD, or 2 GiB when no threshold is set.SurrealKV is the only on-disk engine, with a new on-disk format. The RocksDB and IndexedDB engines are removed:
rocksdb://andindxdb://paths open with SurrealKV, which converts existing data on the first start withSURREAL_EXPERIMENTAL_UPGRADE_FROM_3X=true, andskv migrateconverts a RocksDB directory into a new one.SURREAL_ROCKSDB_*settings are ignored with a warning.A 4.0 node refuses to start on a 3.x datastore, including one converted with
skv migrate, unlessSURREAL_EXPERIMENTAL_UPGRADE_FROM_3X=trueor the embeddedexperimental_upgrade_from_3xoption is set, and leaves its files unchanged.The TiKV backend is built from its own repository as
surreal-tikv. The standard binary, the container images and the Rust SDK no longer include it, and SurrealDB Enterprise drops it from its default build.SurrealKV keeps dead blocks out of its block cache, bounds its in-memory write buffers by the size of their values, and keeps compaction off query workers, which lowers peak memory and stops writers stalling under heavy load.
In the browser, the Wasm engine connects with
surrealkv://name, stores data in the Origin Private File System from a dedicated worker, and copies in an IndexedDB database of the same name on first open.SurrealKV supports
ALTER ... COMPACT. Its grouped-commit settings have no effect.The first opted-in 4.0 start applies a data migration and, on the in-memory engine and SurrealKV, switches the datastore to the 4.0 record format, after which no 3.x release can open it. TiKV keeps the 3.x format until every node runs 4.0 with
SURREAL_FEATURE_LEVEL=4.0.
Server, HTTP and RPC
The database command line is the
dbcomponent of the Surreal CLI, andversion,is-readyandvalidatetake--json.--cookie-authwith an explicit--allow-originlist enablesPOST /signin/cookie,/signup/cookie,/refresh/cookieand/signout, which keep the access token, and a refresh token for record access definedWITH REFRESH, inHttpOnlycookies checked against the request's origin.DEFINE API ... SECURITY INVOKERruns an endpoint's handlers and middleware with the caller's permissions.HTTP RPC sessions are stored in the datastore, so any node of a cluster serves them, and
--durable-sessionshas no effect.Clients can opt in to
application/vnd.surrealdb.shaped, or theshapedWebSocket subprotocol, which sends each row shape once and then only values.A CBOR request the server cannot decode is answered with the decoder's reason instead of
Parse error. The server refuses the text forms of datetimes, UUIDs and durations (tags0,9and13).--allow-netand--deny-netaccept wildcard subdomains such as*.example.com, and a*.rule now matches subdomains.--allow-mcpand--deny-mcpallow or deny individual MCP tools.The server logs its capability summary at startup, and warns when guest access or scripting is on.
--planner-strategyis deprecated,SURREAL_MAX_CONCURRENT_TASKSis removed, and--allow-experimentalrefusesgqlandfiles.An HTTP request can name its scope in the path, as in
/ns/{ns}/db/{db}/sql,/ns/{ns}/db/{db}/rpcor/ns/{ns}/db/{db}/ac/{access}/signin. The path sets where the session starts,USEcan still move it, credentials must belong to that scope, and a header that conflicts with the path answers400.The
queryandquery_streamRPC methods take atraceoption that reports the relations, references, links, variables and subscriptions each statement walked.CBOR v2 carries a
regexas tag 193.SurrealML is removed: the
surreal mlcommand, the/mlroutes,SURREAL_HTTP_MAX_ML_BODY_SIZEand the SDK model import and export are gone,DEFINE MODELis refused,ml::calls fail withMachine learning computation is not enabled, and a datastore that holds a model is refused at startup.Single-record requests use less server CPU, and full documents return faster over WebSocket, where large messages are fragmented and CBOR is decoded in place.
surreal upgradeno longer downloads a release, because the Surreal CLI installs and upgrades the database, andsurreal --versionprints a shorter line.
Security and access
Bearer tokens are checked against their grant, so tokens issued before the upgrade are refused.
$auth.idreturns the signed-in record id without reading the record.
Import and export
POST /importanswers422when part of an import fails.DEFINE ACCESSwith a signing key is not restored from a dump, and table values in a 3.x dump are lost on import.An import drops a UTF-8 byte order mark, refuses UTF-16 with an error naming the encoding, and refuses a
DEFINE FIELDwhoseDEFAULTdoes not fit itsTYPE.In the 4.0 Docker image,
/dataand/logsare owned by uid and gid65532, so a new named volume is writable without running as root.
SDKs and embedded
The Rust SDK adds
Surreal::api()forDEFINE APIendpoints, honours a custom TLS configuration ongrpcs://and refuses one ongrpc://, makes cloning a WebSocket client cheap, and round-trips integers abovei64::MAXas decimals.surrealdb::opt::SyncMode,AolModeandSnapshotModeset the durability of local engines.Config::datastore_optionsets storage options by their server names, path parameters reach the storage engine,Surreal::shutdownwaits until storage is released, and embedded engines can allow localfile:bucket folders.The
kv-rocksdb,kv-indxdbandkv-tikvfeatures are removed,parseis no longer a default feature,unstable_from_datastoreneeds theunstablefeature, and a dropped transaction rolls back.The WebAssembly build is 1.9 MB smaller.
Extensions
Surrealism modules are renamed extensions.
DEFINE EXTENSION,ALTER EXTENSION,REMOVE EXTENSIONandext::replaceMODULEandmod::, which still parse as deprecated forms, andINFO FOR DBlists them underextensions.A definition requires
SIGNER, with an SSH key or a Sigstore identity, orUNSIGNED. It may pin aDIGESTof the archive, and it grantsCAPABILITIESfor network access, function calls, queries, scripting, writes, memory and timeouts. An emptyCAPABILITIESgrants nothing.Each call runs on a fresh instance. Archives built for 3.x are refused with
Unsupported ABI version.surreal extbuilds, signs and installs extensions.SURREAL_SURREALISM_MAX_CONCURRENT_INVOCATIONSlimits how many calls run at once.
SurrealDS (Enterprise)
surrealds://opens a SurrealDS 1.0 node, which keeps a commit log on its local disk and the data in an object store, and acknowledges a write once it is on disk in two zones. Theds-mem,ds-rocksdb,ds-cloudandds-singleengines are removed.SURREALDS_OBJECT_KINDselectss3,azureorgcs, so a group can keep its data in Amazon S3 or an S3-compatible store, Azure Blob Storage or Google Cloud Storage.Transactions run at snapshot isolation by default, and
BEGIN ISOLATION LEVEL SERIALIZABLEasks for serializable isolation.A transaction started on a node that is catching up, or on one that is still joining, has its reads answered by the sequencer, and
VERSION <datetime>works on every node.
Bug fixes
Fixes already released in 3.3.1 to 3.3.5 are included and not repeated here.
Queries
Fixed
GROUP BYgiving different answers for equivalent constant expressions, and aggregates over the wrong kind of value returning0or-Infinityinstead of a result or an error.Fixed
UPSERT ... WHERE ... RETURN NONEcreating an extra empty record when the condition matched existing rows.Fixed
UPDATEandDELETE ... WHERE <field> IN [...]on a compositeUNIQUEindex changing no rows.Fixed range conditions on the leading column of a composite
UNIQUEindex returning the wrong rows.Fixed indexed reads returning duplicate rows and a wrong
count()when records stored before aDEFINE FIELD ... TYPEstill held arrays.Fixed
CONTAINSandINSIDEover an index onfield.*missing records whose value is a string, object, range or geometry.Fixed a
.*index on asetfield returning no rows forCONTAINS,CONTAINSANY,CONTAINSALLandIN.Fixed
CONTAINSALLover a list that mixes floats and decimals rejecting matching rows unpredictably.Fixed
ORDER BY ... LIMITover an index on a column that may hold arrays returning the wrong rows or a record twice.Fixed index-ordered reads and ranges over datetimes returning rows out of order or leaving some out.
Fixed a closed range after an equality on a compound index using only one bound, and an equality against an array or object record id scanning the table.
Fixed a
FROMexpression that yields a record range reading nothing.Fixed a record id read from a string, such as
type::record("value:focus:outline-none"), keeping only the firsttable:key.Fixed closures ignoring outer parameters used only in
STARTorTIMEOUT.Fixed
record::exists()deriving every computed field of the record, so an erroring computed field made it fail.Fixed
SHOW CHANGES FOR TABLE ... SINCE <datetime>returning[]on the memory and SurrealKV engines, and itsLIMITcounting entries from other tables.Fixed
VERSIONreads on a versioned SurrealKV store returning records deleted before that version.
Schema and writes
Fixed fields typed as sets of arrays, sets or objects storing a wrapped value or failing to read back.
Fixed a field typed
array | array<int>making its table unreadable, including on databases upgraded from 3.0 to 3.2.Fixed
SCHEMAFULLtables accepting undeclared nested keys under a union with a literal.Fixed unions with an
object, literal oranymember refusing valid values for their elements.Fixed
ALTER FIELDaccepting a type or aREFERENCEthatDEFINE FIELDrefuses, which made exports fail to import.Fixed fields named with a keyword or needing backticks failing to define beside an implied element definition, and failing in
DEFINE INDEXonSCHEMAFULLtables.Fixed a
COMPUTEDfield whose subquery selects a field of the same name failing as a cyclic dependency.Fixed
UPSERTof a named record andINSERT ... ON DUPLICATE KEY UPDATEevaluating their clauses against an empty record.Fixed an
UPSERTthat conflicted with a record its own event created silently returning[].Fixed
math::sumwrapping on integer overflow,math::meanof large integers giving a result that depended on their order, andmath::productandmath::spreadwrapping.Fixed views with
math::sum,math::min,math::maxormath::meanrefusing writes of records that lack the field.Fixed
DELETEon aDROPtable leaving index entries andREFERENCEkeys behind.Fixed redefining a view disconnecting the views that read it,
DEFINE TABLE OVERWRITEdropping a view's own fields, and a view that sets its ownidbeing keyed inconsistently.Fixed foreign views seeing
NONEfor their source table'sCOMPUTEDfields.Fixed
REMOVE TABLEon an edge table leaving its edges reachable from their endpoints.Fixed a repeated clause in
DEFINE TABLEsilently replacing the earlier one, and two index kinds in oneDEFINE INDEXsilently keeping the last.Fixed a decimal literal with more than 28 decimal places being rounded or becoming
0.Fixed a literal array or object type validating its members without converting them.
Fixed JSON Patch paths being split on
., so a key that contains a dot could not be patched.Fixed
id.xdefinitions not being checked against the record key, andidreadingNONEinCREATE ... SETwhen the id is known.Fixed a sequence at the top of the
i64range wrapping round instead of failing, andsequence::nextvalpanicking there.Fixed
time::from_uuidreturning a wrong year for UUIDs dated before 1970.Fixed a cold sequence allocator blocking every other sequence-backed allocation on the node while it loaded.
Indexes
Fixed an index rebuilt in a transaction that failed to commit reporting ready while returning nothing.
Fixed index builds that could miss writes from older transactions, or apply a write twice during
REBUILD INDEX.Fixed a
UNIQUEindex whose concurrent build failed accepting duplicates.Fixed a
DELETEfrom a snapshot taken before a full-text index build finished leaving a stale entry.Fixed
DEFINE INDEXafterREMOVE INDEXfailing while document ids were still being reclaimed.
Vector and full-text search
Fixed indexed reads and vector searches disagreeing with table scans on equal numbers of different kinds.
Fixed a multi-word
@@match used as a filter underOR, or in a write'sWHERE, matching any of the words instead of all of them.Fixed
MATCHESreturning nothing over record ids, record ranges and graph hops.Fixed BM25 scoring a term that appears in about half the documents or more as
0.Fixed an
ngramanalyzer missing a word longer than its maximum gram size, andsearch::highlightcovering only the last of several predicates that share one reference.Fixed a full-text index keeping a deleted record counted under a term it kept through an update, which lowered BM25 scores. Existing indexes need
REBUILD INDEX.Fixed a KNN query whose vector is only known at run time returning no rows or searching with the wrong vector.
Fixed
JACCARDandPEARSONvector searches ranking the least similar records first, and integer vector distances overflowing.Fixed KNN queries returning no rows while a vector index is still being built
CONCURRENTLY.Fixed a DiskANN search stalling compaction and later searches under write load.
Import and export
Fixed
surreal importlosingINSERTbatches with a write conflict on a table whose DiskANN index is defined before its data.Fixed exports of union types that imply element definitions failing to import.
Fixed exports writing a view before its source table.
Fixed table values in a record exporting as a bare name that imported as
NONE.Fixed
surreal exportto standard output mixing log lines into the dump, andsurreal exportfailing against an HTTP/2 endpoint such as SurrealDB Cloud.Fixed
--import-fileretrying a file that does not parse for a minute and skipping a file withoutUSE.
Server, HTTP and RPC
Fixed one writer's live-query notifications arriving out of commit order.
Fixed a
LIVE SELECTregistered during an in-flight write missing that write.Fixed writes by an
ASYNCevent never reaching live-query subscribers.Fixed concurrent
LIVE SELECTandKILLon one table failing with a transaction conflict.Fixed clients dropping
KILLEDandERRORlive notifications, which left the stream open and silent.Fixed live notifications stopping after
REMOVE TABLEunder therouterlive query engine.Fixed a WebSocket request that fails to decode being answered without its
id, which left SDK calls waiting.Fixed JSON RPC strings that begin with a UUID or a datetime being turned into that value.
Fixed JSON values in
/sqlquery parameters being bound as strings.Fixed memory-sized defaults ignoring a cgroup limit set below the root, such as a systemd
MemoryMax.Fixed
surreal mcpwriting log lines to standard output, and MCP tool schemas that some model providers reject.Fixed JWTs whose
nbfis slightly ahead of the server clock being rejected, and HTTP clients with an expired token being unable to sign in.Fixed database-level
BEARERgrant tokens being refused for every operation.Fixed a batch stopped by
--query-timeoutnever appearing in the slow query log.Fixed
surreal sqlexiting with0after a failed statement in piped input.Fixed a SurrealKV commit with
sync=everybeing visible to other transactions before it was durable.Fixed a datastore reading every process on the host at startup.
GraphQL
Fixed required literal-union fields being exposed as nullable, tables without fields producing an empty update input,
GRAPHQL_ALIASon nested fields being ignored, and a dropped subscription leaving itsLIVEquery behind.
SDKs and embedded
Fixed a
KILLstatement being left out of query results in the Rust SDK, which shifted later statement indexes.Fixed
tx.commit()on an embedded engine returning an internal error instead ofTransactionConflict.Fixed live query streams from a cloned client ending early, and every dropped authenticated HTTP client leaking a server session.
Fixed
any::connectcreating a directory with percent-encoding left in the path.Fixed
#[derive(SurrealValue)]reading a unit variant only in its object form, and#[surreal(crate = ..., tag = ...)]failing to compile withoutValuein scope.
SurrealDS (Enterprise)
Fixed a SurrealDS 1.0 node refusing every later transaction as
Unavailableafter a write conflict, until the process restarted.Fixed a single-node SurrealDS 1.0 database refusing all writes after one failed disk write while still reporting ready.
Fixed SurrealDB hanging at startup when a single-node SurrealDS 1.0 log was damaged.
Fixed reads on a SurrealDS 1.0 replica failing under sustained writes.
Security
This release addresses a set of issues surfaced through SurrealDB's internal security review process and external reviewers. Each affected v3.3.5 and earlier, and each fix ships in v4.0.0 and is enabled by default.
Path traversal out of filesystem buckets High - GHSA-7pqw-x84x-frxc, GHSA-6c37-x4jm-529x, GHSA-cph5-pm57-9w9c
Scripting bypasses the query and function capabilities High - GHSA-fq69-wr4w-v3gm, GHSA-5w6j-qm42-4rc2
Statement injection through MCP tool identifiers High - GHSA-cr79-9p8r-p5wx
Unbounded GraphQL WebSocket messages High - GHSA-p3c2-wh5f-jwqm
REFERENCE ON DELETEactions bypass the target table's permissions High - GHSA-fh2q-8f75-m4h6Computed fields with escaped names bypass field-level
SELECTpermissions High - GHSA-5xcv-fm6g-4hf3Model export requests redirected to another host High - GHSA-7r2m-g5wf-pj9j
Network capability bypass (SSRF) from extension sockets High - GHSA-q83r-f38r-rwvj
Parameters shadow
$auth,$access,$tokenand$sessionHigh - GHSA-ffvm-mqh3-7986Unsound
SendandSyncin thereblessiveexecutor stack High - GHSA-m9qr-4rcq-3jhc/exportignores table and fieldSELECTpermissions Moderate - GHSA-qh3v-rr48-x3cqTransactions commit writes that an event refused Moderate - GHSA-623g-mhxq-5hmf
DDL statements create a namespace or database without authorization Moderate - GHSA-3287-hpm5-3f8r
LIVEquery notification expressions can write Moderate - GHSA-pvv9-h693-m8r4Errors disclose
SELECT-restricted values and record ids Moderate - GHSA-ff2q-h4x7-cpj4, GHSA-3rcm-c653-wgmr, GHSA-cff7-q66j-4hc8Overlapping array field permissions disclose a denied field Moderate - GHSA-wjh3-m4pv-q6cp
VIEWERusers define tables implicitly Low - GHSA-m887-2246-mgw3CLI help prints credential environment variables Low - GHSA-whfh-76h8-2r66
The release also carries these security fixes, which have no separate advisory:
Network capability rules match IPv4-mapped IPv6 addresses and hostnames with a trailing dot, and
http::*response bodies are capped at 64 MiB./exportleaves out password hashes and access method secrets unless secrets are requested, andINFOredacts credentials in a bucket's backend URL.A session ends when its token expires, and a refresh token exchange checks the record and the access method's
AUTHENTICATEclause again. Empty root credentials are refused, sign-in errors no longer say which part failed, Basic authentication is rate-limited, and WebSocket/rpcupgrades honour the origin allow-list.GraphQL enforces the query capability and applies body, depth and complexity limits by default, and the MCP tools bind filters as parsed expressions and cap their output.
SHOW CHANGESrefuses callers whose permissions are checked.Crash and denial-of-service fixes cover a CBOR duration whose nanoseconds overflow,
search::rrf()with a very large limit,duration::from::*,math::pow,array::insertand other functions on extreme arguments, allocation caps onstring::repeat,array::repeat,array::windowsandarray::clump, boundedscryptcost parameters, and a stored value nested past the depth limit.Dependency updates clear
RUSTSEC-2026-0375toRUSTSEC-2026-0379andRUSTSEC-2026-0420toRUSTSEC-2026-0424(wasmtime),RUSTSEC-2026-0381toRUSTSEC-2026-0383(rustls-webpki), andRUSTSEC-2026-0194andRUSTSEC-2026-0195(quick-xml).
Upgrade or install
Get SurrealDB v4.0.0
Upgrade a Cloud instance from SurrealDB Studio, or copy the command for your platform.
Upgrade a Cloud instance to v4.0.0 in four steps:
- Open SurrealDB Studio
- Select your organisation and instance
- On the dashboard, select “Upgrade”
- The instance updates and restarts automatically
Released Oct 28, 2026
4.0.0-beta.1
PRE-RELEASEThis release introduces the first beta of SurrealDB 4.0. Numbers keep their size and one storage engine runs everywhere. We would love to hear how it goes. The upgrade is one-way, so read the upgrade notes before trying it on data you care about.
Highlights
🔢 Numbers that keep their size
Until now, every whole number in SurrealDB was a 64-bit int and every fraction a 64-bit float, so a schema had no way to say that a sensor id fits in two bytes or that an embedding only needs 32-bit precision. 4.0 brings sized numbers, from i8 and u8 up to u64, plus f16 and f32. A field declared with one stores its values at that size and turns away any value that does not fit:
DEFINE FIELD sensor ON reading TYPE u16;
DEFINE FIELD level ON reading TYPE f32;
CREATE reading:1 SET sensor = 65535, level = 1.25;
-- [{ id: reading:1, level: 1.25f32, sensor: 65535u16 }]
CREATE reading:2 SET sensor = 65536, level = 1;
-- "Couldn't coerce value for field `sensor` of `reading:2`: Expected `u16` but found `65536`"Literals can carry their size as well, as in 255u8 or 1.5f32, and arithmetic on them fails rather than wrapping round, so 255u8 + 1u8 is an error instead of a quiet 0. SDKs that speak the new CBOR v2 protocol get the exact width back, and 3.x SDKs carry on over the original protocol.
Sized numbers · Sized number fields · CBOR v2
🧾 Transactions that ask for what they need
Snapshot isolation, the default, lets two transactions each read something the other is about to change. Two receptionists booking the last free Monday slot can both see an empty calendar, and both bookings commit. BEGIN learned to ask for a stronger guarantee:
BEGIN ISOLATION LEVEL SERIALIZABLE;
LET $booked = SELECT VALUE id FROM booking WHERE day = 'monday';
IF $booked.is_empty() {
CREATE booking SET doctor = doctor:ana, day = 'monday';
};
COMMIT;When two of these run at once, the second COMMIT now fails with a conflict you can retry. The in-memory engine and SurrealDS offer the level, while SurrealKV and TiKV refuse it outright rather than quietly running at a weaker one. Reads got their own option too: BEGIN READ ONLY turns away every write, and on SurrealDS, MAX STALENESS 5s lets a report read from a snapshot up to five seconds old.
Serializable isolation · Read-only transactions
⏱ Time series ids you can query by name
Array record ids such as reading:['London', d'2026-10-01T09:00:00Z'] keep each city's readings together in time order, which makes them a natural fit for time series. Reading a slice of one, though, meant writing a record range by position. You can now name the parts of the id once and query them like ordinary fields:
DEFINE FIELD id ON reading TYPE [city: string, time: datetime];
SELECT time, temp FROM reading
WHERE city = 'London' AND time >= d'2026-10-01' AND time < d'2026-10-08';The WHERE becomes a scan of the keys between those two points, so the query reads one city's week and nothing else. ORDER BY time DESC LIMIT 10 reads backwards from the newest reading and stops after ten, which keeps "the latest readings for London" cheap at any table size.
Naming the components of an array id
🗺 An index for places
Questions like "which cities are within 400 km of London?" used to check the geometry of every record in the table. The new SPATIAL index stores geometries on a grid over the globe, so a query reads only the cells around the area it asks about:
DEFINE INDEX city_location ON city FIELDS location SPATIAL;
SELECT VALUE name FROM city
WHERE geo::distance(location, (-0.1276, 51.5072)) < 400000;It serves INSIDE, INTERSECTS, CONTAINS and the other geometry operators as well as a radius written with geo::distance, and it works alongside other indexes, so status = 'open' AND location INSIDE $area uses both. A nearest-neighbour vector search can be narrowed to an area the same way.
💾 SurrealKV everywhere
On-disk storage used to come in several engines, with RocksDB on servers and IndexedDB in the browser. From 4.0, SurrealKV 1.0 is the one engine on a server, in an embedded SDK and in the browser, where it keeps the database in the Origin Private File System. Existing data comes along on its own: a rocksdb:// or indxdb:// path still opens, and SurrealKV converts what it finds there the first time it starts. To keep the original directory untouched, convert it into a new one ahead of time:
skv migrate path/to/rocksdb-database path/to/surrealkv-database
surreal db start --user root --pass secret surrealkv://path/to/surrealkv-databaseSurrealKV also takes compaction requests from ALTER ... COMPACT now, which only RocksDB answered before.
Moving a RocksDB database to SurrealKV · RocksDB and IndexedDB are removed
Also new
Cookie sign-in: Browser apps can let SurrealDB hold their session for them. With
--cookie-auth, signing in through/signin/cookieputs the token in anHttpOnlycookie that page scripts never see, with a rotating refresh cookie for record access definedWITH REFRESH. (learn more)APIs with caller permissions:
DEFINE API ... SECURITY INVOKERruns an endpoint with the caller's own permissions, so it returns exactly what that user could read with a direct query. (learn more)Stored back-references:
MATERIALIZE INTOkeeps a list of the records that point at a record on the record itself, so an author's posts are one field read away. (learn more)Unique nulls:
UNIQUE NULLS NOT DISTINCTtreatsNULLas a value, so only one record can leave a unique fieldNULL. (learn more)Keeping the rest: Destructuring learned
..., which keeps every field you did not name, soperson.{ address: address.{ city }, ... }trims the address and leaves the rest alone. (learn more)Automatic retries: A statement outside a transaction that loses a write conflict now runs again by itself, unless it reaches outside the database with a call such as
http::get. (learn more)Shaped results: Clients can ask for results that send each row's shape once and then only the values. (learn more)
Finer capabilities:
--allow-net "*.example.com"covers every subdomain, and--allow-mcpand--deny-mcppick out individual MCP tools. (learn more)Rust and browser SDKs: The Rust SDK can call
DEFINE APIendpoints withSurreal::api(), and the browser build shrank by 1.9 MB. (learn more)
Upgrade notes
The 3.x to 4.0 upgrade guide covers each of these in detail.
One-way upgrade: Take an export before upgrading, because once 4.0 has opened a datastore, no 3.x release starts on it. (learn more)
SDKs first: Upgrade every SDK before the server, because 4.0 refuses the text forms of datetimes, UUIDs and durations that some earlier Python, PHP and Go SDKs send, and 3.x Rust SDKs refuse a 4.0 server. (learn more)
Storage conversion: Leave room on disk for a second copy of a RocksDB or SurrealKV datastore, and give health checks extra time on the first start, because the conversion runs before the server answers
/health. Runskv migratebeforehand to keep the original directory. (learn more)Clusters: Upgrade every node to the latest 3.3 release first, and hold off on
LIVEqueries and DiskANN writes until every node runs 4.0. A TiKV datastore switches to the 4.0 format only once every node is started withSURREAL_FEATURE_LEVEL=4.0. (learn more)Index rebuilds: Rebuild HNSW indexes that use
JACCARDorPEARSONand full-text indexes whose records were updated and later deleted, and redefine any DiskANNTYPE I8orTYPE U8index above 33025 dimensions. (learn more)Configuration: Move
SURREAL_KNN_PREFILTER_EF_BOOSTtoSURREAL_KNN_PREFILTER_HNSW_EF_BOOSTif you tuned it for HNSW, and removegqlfrom--allow-experimental, which now refuses it. (learn more)Rust SDK: Replace the
kv-rocksdbandkv-indxdbfeatures withkv-surrealkv, and importAolMode,SnapshotModeandSyncModefromsurrealdb::opt. (learn more)Behaviour changes: Check your queries against the behaviour changes in the guide. The ones most likely to matter are exact float and decimal comparison,
SPLITnaming the result's field, KNN operators inUPDATEandDELETE, and writes that create a table. (learn more)
All changes
Queries
Destructuring accepts a trailing
..., which keeps every field the pattern did not name, on objects and on record links.UPDATEandDELETEuse indexes for conditions on bound parameters, such asDELETE t WHERE time < $cut, and evaluate aWHEREon stored values before decoding records.Aggregates run by record users no longer derive
COMPUTEDfields that the query does not read.A standalone statement that loses a retryable write conflict is planned and run again, up to 10 attempts in all within its timeout. Statements with an external effect, such as an
http::*call, are not retried.array::min()andarray::max()work asGROUP BYaggregates, andarray::group()returns the unique values of a group.A
GROUP BYprojection that does not read the record is evaluated once per group, so a constant expression gives one value.A group key or aggregate argument that ran a subquery, block, custom function or script and then failed returns the error instead of
NONE. Nested aggregates inGROUP BYfail withNested aggregate functions are not supported.SPLITnames a field of the result, under its alias where it has one, soSELECT tags AS t FROM person SPLIT tagsfails withMissing split idiom `"tags"` in statement selection.SELECT * FROM ONLY [item:404]returnsNONEwhen the record does not exist, where 3.3 failed withExpected a single result output when using the ONLY keyword.Nested arrays in
FROMare flattened, soSELECT VALUE $this FROM [[1, 2], [3]]returns[1, 2, 3].A record id on a table that does not exist is an error rather than
[]orNONE.A float equals a decimal only when the decimal is exactly the float's value, so
0.1f = 0.1decisfalse.An array slice past the end, such as
[1, 2][0..10], returns the elements it covers instead ofNONE.LETcannot set$this,$self,$parent,$value,$input,$before,$afteror$eventinside a block, loop, condition, function or closure, which fails with'parent' is a protected variable and cannot be set. ALETused as the value of an expression, including as a branch ofIF ... THEN ... END, fails withLET statements can only appear at the top level of a query or inside a block expression.A top-level
RETURNno longer skips the statements after it.GeoJSON objects from parameters, HTTP responses or JSON fields are accepted wherever a geometry is expected, including in the geometry operators.
A range passed to a
function()script arrives as aRangeobject, and a returnedRangeconverts back.
Transactions
BEGIN READ ONLYstarts a transaction that refuses writes and returns a description of its snapshot.MAX STALENESS <duration>lets it read a published snapshot no older than the bound, andSTRICTfails it when none is recent enough. Only SurrealDS publishes snapshots; every community engine reads the current state, which meets any bound.SURREAL_READ_SNAPSHOT_MAX_STALENESS_SECS(3600 by default) caps the bound, andSURREAL_READ_SNAPSHOT_FALLBACKsets the behaviour when no snapshot qualifies.BEGIN ISOLATION LEVEL SNAPSHOT | SERIALIZABLEselects the isolation level. The in-memory engine and SurrealDS offerSERIALIZABLE, and SurrealKV and TiKV refuse it withThe isolation level SERIALIZABLE is not available on this datastore; it offers SNAPSHOT. It cannot be combined with aMAX STALENESSabove zero.The
beginRPC method takesread_onlyandisolationoptions, HTTP/sqltakesread_only_max_stalenessandread_only_strict, and the Rust SDK hasBegin::isolation(),Begin::client()andTransaction::client().A failing statement cancels its transaction, and
LETvalues set in a cancelled transaction are discarded.A
DEFINE APIhandler or middleware that fails rolls back everything it wrote, including events, index entries and sequence draws, and so does a failedsurrealdb.querycall that a script catches.
Schema and writes
Sized number types
i8,u8,i16,u16,i32,u32,u64,f16andf32are available in fields, casts and literals (255u8,1.5f32), withtype::conversion andtype::is_checks for each.i64andf64are aliases ofintandfloat. Arithmetic on two values of the same sized type fails on overflow, and mixed types widen to the smallest type that holds both.The elements of an array record id can be named in the
idfield's type, as inTYPE [city: string, time: datetime]. Each name reads as a field, conditions on the names become key-range scans, andORDER BYon a following component reads in key order.REFERENCE ... MATERIALIZE INTO <table>.<field> [ WHERE <condition> ]stores on each referenced record a sorted list of the records that reference it, kept current in the same transaction.DEFINE FIELD OVERWRITE ... REFERENCEandALTER FIELDon a populated field write reference keys for existing records.COMPUTED,PERMISSIONS,ASSERT,VALUEandDEFAULTclauses may not have side effects, and the check follows custom functions they call.A
CREATE,UPSERT,INSERTorRELATEthat implicitly defines a table needs permission to runDEFINE TABLE. A databaseVIEWERnow getsIAM error: Not enough permissions to perform this action. Record users are unaffected.A nested field needs a parent whose type can hold it, and
DEFINE FIELD id.<part>needsiditself defined first. A view may not read its own table, and changing a table betweenNORMALandRELATIONchecks its records.A whole-record
PATCHreplace with a value that is not an object fails withCannot use 5 in a CONTENT clauseand leaves the record unchanged.Integer overflow in
math::sumis an error, and a decimal literal with more than 28 decimal places is a parse error.
Indexes
DEFINE INDEX ... SPATIALindexes any geometry type on a grid of cells, servingINSIDE,CONTAINS,INTERSECTS,CONTAINSANY,CONTAINSALL,ANYINSIDE,ALLINSIDEandgeo::distance(...) < r, alone or combined with other indexes, and pre-filters KNN searches by area.UNIQUE NULLS NOT DISTINCTmakesNULLtake part in uniqueness.NONEis still not compared.A
DEFINE INDEXorREBUILD INDEXwithoutCONCURRENTLYcommits its definition before it builds and returns once the index is online. A build that fails removes the definition afterwards, and aUNIQUEindex whose build failed refuses writes. A blockingDEFINE INDEXafter writes to the same table in the same transaction is refused.An unchanged
DEFINE INDEX OVERWRITEkeeps its index instead of rebuilding it.Standard and
UNIQUEindex builds scan in parallel batches, set bySURREAL_INDEX_BUILD_PARALLELISM, and DiskANN indexes build in parallel.count()overIN [...]orORconditions on a B-tree index is answered from the index without reading records.An index records whether a column has ever held an array, so a column that never has can serve
ORDER BY ... LIMITand ranges from index order.A
UNIQUEindex overs.*on a set field uses the whole set as its key, ands.*over a set returns a set.
Vector and full-text search
A KNN operator in the
WHEREof anUPDATEorDELETEneeds a vector index on the field and is answered from it. AnUPSERTwith a KNN operator always fails.The KNN query vector cannot depend on the record being scanned, which fails with
The KNN query vector cannot depend on the record being scanned.HNSW indexes using
JACCARDorPEARSONrank by distance.DiskANN
TYPE I8andTYPE U8indexes are limited toDIMENSION 33025.Pre-filtered KNN is tuned by
SURREAL_KNN_PREFILTER_HNSW_EF_BOOSTandSURREAL_KNN_PREFILTER_EXACT_COST.SURREAL_KNN_PREFILTER_EF_BOOSTnow applies to DiskANN only.Vector measures over eight or more floats sum their terms in a different order, so results can differ in their last digits.
Storage
SurrealKV 1.0 is the only on-disk engine, with a new on-disk format. The RocksDB and IndexedDB engines are removed:
rocksdb://andindxdb://paths open with SurrealKV, which converts existing data on first start, andskv migrateconverts a RocksDB directory into a new one.SURREAL_ROCKSDB_*settings are ignored with a warning.In the browser, the Wasm engine connects with
surrealkv://name, stores data in the Origin Private File System from a dedicated worker, and copies in an IndexedDB database of the same name on first open.SurrealKV supports
ALTER ... COMPACT. Its grouped-commit settings have no effect.The first 4.0 start applies a data migration and, on the in-memory engine and SurrealKV, switches the datastore to the 4.0 record format, after which no 3.x release can open it. TiKV keeps the 3.x format until every node runs 4.0 with
SURREAL_FEATURE_LEVEL=4.0.
Server, HTTP and RPC
--cookie-authwith an explicit--allow-originlist enablesPOST /signin/cookie,/signup/cookie,/refresh/cookieand/signout, which keep the access token, and a refresh token for record access definedWITH REFRESH, inHttpOnlycookies checked against the request's origin.DEFINE API ... SECURITY INVOKERruns an endpoint's handlers and middleware with the caller's permissions.HTTP RPC sessions are stored in the datastore, so any node of a cluster serves them, and
--durable-sessionshas no effect.Clients can opt in to
application/vnd.surrealdb.shaped, or theshapedWebSocket subprotocol, which sends each row shape once and then only values.A CBOR request the server cannot decode is answered with the decoder's reason instead of
Parse error. The server refuses the text forms of datetimes, UUIDs and durations (tags0,9and13).--allow-netand--deny-netaccept wildcard subdomains such as*.example.com, and a*.rule now matches subdomains.--allow-mcpand--deny-mcpallow or deny individual MCP tools.The server logs its capability summary at startup, and warns when guest access or scripting is on.
--planner-strategyis deprecated,SURREAL_MAX_CONCURRENT_TASKSis removed, and--allow-experimental gqlis refused.surreal upgradeno longer downloads a release, because the Surreal CLI installs and upgrades the database, andsurreal --versionprints a shorter line.
Security and access
Bearer tokens are checked against their grant, so tokens issued before the upgrade are refused.
$auth.idreturns the signed-in record id without reading the record.
Import and export
POST /importanswers422when part of an import fails.DEFINE ACCESSwith a signing key is not restored from a dump, and table values in a 3.x dump are lost on import.An import drops a UTF-8 byte order mark, refuses UTF-16 with an error naming the encoding, and refuses a
DEFINE FIELDwhoseDEFAULTdoes not fit itsTYPE.In the 4.0 Docker image,
/dataand/logsare owned by uid and gid65532, so a new named volume is writable without running as root.
SDKs and embedded
The Rust SDK adds
Surreal::api()forDEFINE APIendpoints, honours a custom TLS configuration ongrpcs://and refuses one ongrpc://, makes cloning a WebSocket client cheap, and round-trips integers abovei64::MAXas decimals.surrealdb::opt::SyncMode,AolModeandSnapshotModeset the durability of local engines.Config::datastore_optionsets storage options by their server names, path parameters reach the storage engine,Surreal::shutdownwaits until storage is released, and embedded engines can allow localfile:bucket folders.The
kv-rocksdbandkv-indxdbfeatures are removed,parseis no longer a default feature,unstable_from_datastoreneeds theunstablefeature, and a dropped transaction rolls back.The WebAssembly build is 1.9 MB smaller.
Bug fixes
Fixes already released in 3.3.1 to 3.3.5 are included and not repeated here.
Queries
Fixed
GROUP BYgiving different answers for equivalent constant expressions, and aggregates over the wrong kind of value returning0or-Infinityinstead of a result or an error.Fixed
UPSERT ... WHERE ... RETURN NONEcreating an extra empty record when the condition matched existing rows.Fixed
UPDATEandDELETE ... WHERE <field> IN [...]on a compositeUNIQUEindex changing no rows.Fixed range conditions on the leading column of a composite
UNIQUEindex returning the wrong rows.Fixed indexed reads returning duplicate rows and a wrong
count()when records stored before aDEFINE FIELD ... TYPEstill held arrays.Fixed
CONTAINSandINSIDEover an index onfield.*missing records whose value is a string, object, range or geometry.Fixed a
.*index on asetfield returning no rows forCONTAINS,CONTAINSANY,CONTAINSALLandIN.Fixed
CONTAINSALLover a list that mixes floats and decimals rejecting matching rows unpredictably.Fixed
ORDER BY ... LIMITover an index on a column that may hold arrays returning the wrong rows or a record twice.Fixed index-ordered reads and ranges over datetimes returning rows out of order or leaving some out.
Fixed a closed range after an equality on a compound index using only one bound, and an equality against an array or object record id scanning the table.
Fixed a
FROMexpression that yields a record range reading nothing.Fixed a record id read from a string, such as
type::record("value:focus:outline-none"), keeping only the firsttable:key.Fixed closures ignoring outer parameters used only in
STARTorTIMEOUT.Fixed
record::exists()deriving every computed field of the record, so an erroring computed field made it fail.Fixed
SHOW CHANGES FOR TABLE ... SINCE <datetime>returning[]on the memory and SurrealKV engines, and itsLIMITcounting entries from other tables.Fixed
VERSIONreads on a versioned SurrealKV store returning records deleted before that version.
Schema and writes
Fixed fields typed as sets of arrays, sets or objects storing a wrapped value or failing to read back.
Fixed a field typed
array | array<int>making its table unreadable, including on databases upgraded from 3.0 to 3.2.Fixed
SCHEMAFULLtables accepting undeclared nested keys under a union with a literal.Fixed unions with an
object, literal oranymember refusing valid values for their elements.Fixed
ALTER FIELDaccepting a type or aREFERENCEthatDEFINE FIELDrefuses, which made exports fail to import.Fixed fields named with a keyword or needing backticks failing to define beside an implied element definition, and failing in
DEFINE INDEXonSCHEMAFULLtables.Fixed a
COMPUTEDfield whose subquery selects a field of the same name failing as a cyclic dependency.Fixed
UPSERTof a named record andINSERT ... ON DUPLICATE KEY UPDATEevaluating their clauses against an empty record.Fixed an
UPSERTthat conflicted with a record its own event created silently returning[].Fixed
math::sumwrapping on integer overflow,math::meanlosing precision, andmath::productandmath::spreadwrapping.Fixed views with
math::sum,math::min,math::maxormath::meanrefusing writes of records that lack the field.Fixed
DELETEon aDROPtable leaving index entries andREFERENCEkeys behind.Fixed redefining a view disconnecting the views that read it,
DEFINE TABLE OVERWRITEdropping a view's own fields, and a view that sets its ownidbeing keyed inconsistently.Fixed foreign views seeing
NONEfor their source table'sCOMPUTEDfields.Fixed
REMOVE TABLEon an edge table leaving its edges reachable from their endpoints.Fixed a repeated clause in
DEFINE TABLEsilently replacing the earlier one, and two index kinds in oneDEFINE INDEXsilently keeping the last.Fixed a decimal literal with more than 28 decimal places being rounded or becoming
0.Fixed a literal array or object type validating its members without converting them.
Fixed JSON Patch paths being split on
., so a key that contains a dot could not be patched.Fixed
id.xdefinitions not being checked against the record key, andidreadingNONEinCREATE ... SETwhen the id is known.Fixed a sequence at the top of the
i64range wrapping round instead of failing, andsequence::nextvalpanicking there.Fixed
time::from_uuidreturning a wrong year for UUIDs dated before 1970.Fixed a cold sequence allocator blocking every other sequence-backed allocation on the node while it loaded.
Indexes
Fixed an index rebuilt in a transaction that failed to commit reporting ready while returning nothing.
Fixed index builds that could miss writes from older transactions, or apply a write twice during
REBUILD INDEX.Fixed a
UNIQUEindex whose concurrent build failed accepting duplicates.Fixed a
DELETEfrom a snapshot taken before a full-text index build finished leaving a stale entry.Fixed
DEFINE INDEXafterREMOVE INDEXfailing while document ids were still being reclaimed.
Vector and full-text search
Fixed indexed reads and vector searches disagreeing with table scans on equal numbers of different kinds.
Fixed a multi-word
@@match used as a filter underOR, or in a write'sWHERE, matching any of the words instead of all of them.Fixed
MATCHESreturning nothing over record ids, record ranges and graph hops.Fixed BM25 scoring a term that appears in about half the documents or more as
0.Fixed an
ngramanalyzer missing a word longer than its maximum gram size, andsearch::highlightcovering only the last of several predicates that share one reference.Fixed a full-text index keeping a deleted record counted under a term it kept through an update, which lowered BM25 scores. Existing indexes need
REBUILD INDEX.Fixed a KNN query whose vector is only known at run time returning no rows or searching with the wrong vector.
Fixed
JACCARDandPEARSONvector searches ranking the least similar records first, and integer vector distances overflowing.Fixed KNN queries returning no rows while a vector index is still being built
CONCURRENTLY.Fixed a DiskANN search stalling compaction and later searches under write load.
Import and export
Fixed
surreal importlosingINSERTbatches with a write conflict on a table whose DiskANN index is defined before its data.Fixed exports of union types that imply element definitions failing to import.
Fixed exports writing a view before its source table.
Fixed table values in a record exporting as a bare name that imported as
NONE.Fixed
surreal exportto standard output mixing log lines into the dump, andsurreal exportfailing against an HTTP/2 endpoint such as SurrealDB Cloud.Fixed
--import-fileretrying a file that does not parse for a minute and skipping a file withoutUSE.
Server, HTTP and RPC
Fixed one writer's live-query notifications arriving out of commit order.
Fixed a
LIVE SELECTregistered during an in-flight write missing that write.Fixed writes by an
ASYNCevent never reaching live-query subscribers.Fixed concurrent
LIVE SELECTandKILLon one table failing with a transaction conflict.Fixed clients dropping
KILLEDandERRORlive notifications, which left the stream open and silent.Fixed live notifications stopping after
REMOVE TABLEunder therouterlive query engine.Fixed a WebSocket request that fails to decode being answered without its
id, which left SDK calls waiting.Fixed JSON RPC strings that begin with a UUID or a datetime being turned into that value.
Fixed JSON values in
/sqlquery parameters being bound as strings.Fixed a RocksDB commit stall freezing the whole server.
Fixed memory-sized defaults ignoring a cgroup limit set below the root, such as a systemd
MemoryMax.Fixed
surreal mcpwriting log lines to standard output, and MCP tool schemas that some model providers reject.Fixed JWTs whose
nbfis slightly ahead of the server clock being rejected, and HTTP clients with an expired token being unable to sign in.Fixed database-level
BEARERgrant tokens being refused for every operation.Fixed a batch stopped by
--query-timeoutnever appearing in the slow query log.Fixed
surreal sqlexiting with0after a failed statement in piped input.Fixed a SurrealKV commit with
sync=everybeing visible to other transactions before it was durable.Fixed a datastore reading every process on the host at startup.
GraphQL
Fixed required literal-union fields being exposed as nullable, tables without fields producing an empty update input,
GRAPHQL_ALIASon nested fields being ignored, and a dropped subscription leaving itsLIVEquery behind.
SDKs and embedded
Fixed a
KILLstatement being left out of query results in the Rust SDK, which shifted later statement indexes.Fixed
tx.commit()on an embedded engine returning an internal error instead ofTransactionConflict.Fixed live query streams from a cloned client ending early, and every dropped authenticated HTTP client leaking a server session.
Fixed
any::connectcreating a directory with percent-encoding left in the path.Fixed
#[derive(SurrealValue)]reading a unit variant only in its object form, and#[surreal(crate = ..., tag = ...)]failing to compile withoutValuein scope.Fixed
REMOVE MODELdeleting the model file before the transaction committed, and a refused model import leaving its file behind.
SurrealDS (Enterprise)
Fixed a SurrealDS 1.0 node refusing every later transaction as
Unavailableafter a write conflict, until the process restarted.Fixed a single-node SurrealDS 1.0 database refusing all writes after one failed disk write while still reporting ready.
Fixed SurrealDB hanging at startup when a single-node SurrealDS 1.0 log was damaged.
Fixed reads on a SurrealDS 1.0 replica failing under sustained writes.
Newer patch available
Upgrade to 4.0.0
This is the 4.0.0-beta.1 changelog. 4.0.0 is the newest patch in this release line, with the latest fixes and improvements.
View 4.0.0 release notes