You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
Support RocksDB (rocksdb://, enabled by default through the kv-rocksdb Cargo feature; 32-bit and Android targets must build with --no-default-features --features portable) and gRPC (grpc://, enabled by default) #212.
Add Surreal.set(String, Object) and Surreal.unset(String) to define and remove a session variable for later queries, and Surreal.info() / Surreal.info(Class<T>) to read the signed-in record user's record ($auth), which is empty for root and anonymous sessions #208.
Add Surreal.refresh(Token) to exchange a refresh token for a new token pair and re-authenticate the session, and Surreal.revoke(Token) to revoke a refresh token. Both throw IllegalArgumentException when the token has no refresh part, because only record access methods defined WITH REFRESH issue one #208.
Add a RecordIdRange(table, start, startInclusive, end, endInclusive) constructor for ranges with exclusive bounds, and Value.isRangeStartInclusive() / Value.isRangeEndInclusive() to read the bound kinds. Ranges were always inclusive at both ends before, and the existing three-argument constructor still includes both #209.
Support the SurrealQL set type: read it with Value.isSet() / Value.getSet(), write it with ValueMut.createSet(Collection<?>), and convert set and array values into Set or List POJO fields. java.util.Set bindings and fields are still sent as arrays #209.
Add Surreal.selectLive(String table, boolean diff), which runs LIVE SELECT DIFF so each notification carries JSON Patch operations instead of the record. Diff mode is refused with a SurrealException on SurrealDB before 3.3.0, because earlier versions can leak fields hidden by field-level SELECT permissions (GHSA-pm6c-q8rh-92m8) #210.
Add UpType.REPLACE for UPDATE … REPLACE and UPSERT … REPLACE with every update and upsert overload #211.
Security: fix SurrealQL injection in the CRUD helpers and run(). Table names, record ids and contents are now bound as variables instead of being spliced into the query text, and run() accepts only identifier segments joined by :: with an optional numeric version (such as ml::model<1.0.0>), rejecting anything else before it is sent. Previously a table name such as victim; REMOVE TABLE victim ran the second statement #203.
Behaviour change: a String target passed to select, update, upsert, delete and the other table-taking methods is now always a table name, never parsed as a record id. select("person:tobie") used to work by accident and now addresses a table literally named person:tobie; use a RecordId for single records #203.
Fix update(String[], …), updateSync(String[], …), upsert(String[], …) and upsertSync(String[], …), which threw UnsatisfiedLinkError because the native symbol was missing #203.
Fix native memory safety: native objects are now freed exactly once, by a cleaner instead of finalize(), which removes double frees, use-after-free on temporaries passed to native calls, and leaks from native types that had no destructor. Calling close() twice is safe, and using a closed instance throws NullPointerException#205.
Make Response, Value, Array, Object, Entry, ValueIterator, EntryIterator and Transaction implement AutoCloseable, so results can be freed right away with try-with-resources instead of waiting for the garbage collector. Transaction.close() cancels a transaction that was neither committed nor cancelled. The SDK also closes the wrappers it creates internally when converting results to POJOs and records, which reduces memory growth in read-heavy loops. An instance that is never closed is still freed once it is garbage collected #205.
Fix durations losing precision: Value.getDuration() and bound java.time.Duration values now keep full nanosecond precision instead of being truncated to milliseconds. A negative java.time.Duration now throws SurrealException instead of wrapping into a huge value, since SurrealDB durations are unsigned, and a stored duration too large for java.time.Duration throws instead of wrapping #202.
Fix the namespace and database of a session created by newSession(): it now reports and uses the values it inherited from its parent instead of null, so getNamespace(), getDatabase() and signin/signup with a RecordCredential that omits them work on the new session #204.
Fix Surreal.kill(...) silently succeeding for an unknown, already-killed or foreign live query: it now throws a QueryException ("Cannot execute KILL statement using id: …") #206.
Upgrade to SurrealDB SDK 3.3.5, and run CI against SurrealDB server v3.3.5 (previously v3.1.5). SurrealDB calls now run on Tokio worker threads with 10 MiB stacks, as SurrealDB recommends, so a Java thread with a small stack (1 MiB by default on Linux) no longer overflows #212.
Run CI against the latest 3.x release on every JDK and against the latest patch of each earlier 3.x minor (v3.1.6 and v3.2.6) on JDK 17, and add server-backed tests over WebSocket and HTTP, with the test server taken from SURREALDB_URL (default ws://localhost:8000) #207.
Strip symbols from the release native libraries to reduce the size of the jar #212.
Refresh all dependencies in Cargo.lock to their latest compatible versions, including quinn-proto 0.11.19, xxhash-rust 0.8.19, rustls 0.23.46, aws-lc-rs 1.19.0 and tokio 1.54.1 #212.