Merged
Conversation
macjuul
requested changes
Feb 5, 2026
Member
macjuul
left a comment
There was a problem hiding this comment.
Also required
- Update value classes
- Potentially update class mappers
Java: Value, ValueMut, RecordId, Surreal, ValueClassConverter, ValueBuilder. Rust: value, valuemut, recordid, surreal, id. Tests and VALUE_TYPES_VALIDATION.md. Co-authored-by: Cursor <cursoragent@cursor.com>
Add RecordId(String table, Array id) and RecordId(String table, Object id). Rust: newRecordIdWithArray, newRecordIdWithObject. Co-authored-by: Cursor <cursoragent@cursor.com>
Add Surreal.version() and Surreal.health(). Build script injects SURREALDB_VERSION from Cargo.lock; version() falls back to it for embedded. Co-authored-by: Cursor <cursoragent@cursor.com>
Add Surreal.run(name, args...) to run a SurrealDB function via RETURN query. Rust: Java_com_surrealdb_Surreal_run. Co-authored-by: Cursor <cursoragent@cursor.com>
Add Surreal.export(path) and Surreal.import_(path). Supported by HTTP and local engines. Co-authored-by: Cursor <cursoragent@cursor.com>
Add Surreal.selectLive(table) returning LiveStream. Blocking next() via LiveStream.next(), close() releases. LiveNotification has getAction(), getValue(), getQueryId(). Rust: spawn thread for stream, channel to Java. Co-authored-by: Cursor <cursoragent@cursor.com>
- Add RecordIdRange (table + optional start/end Id) for range queries - Rust: build_range_value(), value_to_record_id_key(), selectRecordIdRange, deleteRecordIdRange, updateRecordIdRangeValue, upsertRecordIdRangeValue - Surreal: select(RecordIdRange), select(Class, RecordIdRange), update(RecordIdRange, UpType, T), delete(RecordIdRange), upsert(RecordIdRange, UpType, T) - Update VALUE_TYPES_VALIDATION.md for record ID ranges Co-authored-by: Cursor <cursoragent@cursor.com>
- File: Value.isFile(), Value.getFile() -> FileRef (getBucket, getKey); ValueMut.createFile(bucket, key). New FileRef.java and fileref.rs. - Range: Value.isRange(), Value.getRangeStart(), Value.getRangeEnd() (Optional<Value> for bounds). Read-only. - Table: Value.isTable(), Value.getTable() -> String; ValueMut.createTable(name). - Regex: Value.isRegex(), Value.getRegex() -> pattern String; ValueMut.createRegex(pattern). - Set not implemented (no Value::Set in SDK). - Update VALUE_TYPES_VALIDATION.md. Co-authored-by: Cursor <cursoragent@cursor.com>
Regex semantics differ by language and are not transferrable across the boundary (same as other SDKs). Remove isRegex/getRegex/createRegex; encountering a regex value can result in a serialization error. Update VALUE_TYPES_VALIDATION.md. Co-authored-by: Cursor <cursoragent@cursor.com>
- Record ID: document array/object creation (RecordId(table, Array/Object)). - Remove resolved minor issue (isBigDecimal fixed in Stage 0). - Summary: record ID create path supports all key types. Co-authored-by: Cursor <cursoragent@cursor.com>
Tests: - ApiTests: version(), health() - RunTests: run() no-arg, single-arg, multi-arg (string args) - ExportImportTests: export/import round-trip - LiveQueryTests: selectLive(), next(), close() - RecordIdRangeTests: select/update/delete/upsert by RecordIdRange - ValueTypesTests: FileRef, Table, Range, BigDecimal (query + ValueMut) - TypeTests: RecordId with array key, RecordId with object key Fix: Surreal.run(String name, Object... args) now uses java.lang.Object so run() accepts any Java object (String, Number, etc.) in package com.surrealdb where Object is the SurrealDB Object type. Co-authored-by: Cursor <cursoragent@cursor.com>
This reverts commit e00c87c.
emmanuel-keller
approved these changes
Feb 12, 2026
macjuul
approved these changes
Feb 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR brings the Java client in line with SurrealDB 3.0: new credential types,
run()/export()/import(), live queries, client-side transactions,RecordIdRangeand related overloads, and value types (FileRef, Range, Table). It also includes CI/test improvements, input validation, Javadoc, and extra tests to make the PR reviewable.Breaking changes – credentials
Root,Namespace,Database(incom.surrealdb.signin).RootCredential,NamespaceCredential,DatabaseCredential(same constructors and getters).Credentialmarker interface;Surreal.signin(Credential)accepts all credential types.Signinis deprecated in favour ofCredential.getAccess()andgetRefresh()added;getToken()kept for compatibility.New features and API
RecordCredential(record signup/signin),BearerCredential(use existing JWT),Token(access, refresh).version(),health(),run(name, args...),export(path),import_(path),beginTransaction()→Transaction,selectLive(table)→LiveStream,useNs/useDb/useDefaults()storing server ns/db inNsDb-style response.RecordIdwith array/object keys;RecordIdRangefor range select/update/delete/upsert.query(),commit(),cancel().next(),close(); implementsAutoCloseablefor try-with-resources.CI, build, and tests
cargoBuild/cargoBuildReleasein Gradle, test depends oncargoBuild, 15s per-test timeout, single fork.build.rsreads SurrealDB version fromCargo.lock.test-with-timeout.shfor local runs.@EnabledOnOs(LINUX, MAC)) with TODO due to “Access is denied (os error 5)” on Windows CI.Code quality and reviewability (this PR)
RecordCredentialrequires non-nullaccess;BearerCredentialrequires non-nulltoken. Params may be null (documented).Transactioncommit/cancel (native throws on failure),LiveNotification.getValue()nullable,Native/FileReflifetime, andMIGRATION.mdfor credentials.AutoCloseable; tests use try-with-resources.kill(liveQueryId).