Port SlateDB integration to 0.12.x UniFFI bindings#280
Closed
em3s wants to merge 1 commit intonext/slatedb-uniffifrom
Closed
Port SlateDB integration to 0.12.x UniFFI bindings#280em3s wants to merge 1 commit intonext/slatedb-uniffifrom
em3s wants to merge 1 commit intonext/slatedb-uniffifrom
Conversation
- Replace io.slatedb:slatedb:0.11.0 (jextract) with
io.slatedb:slatedb-uniffi:0.12.1 (UniFFI).
- Drop SlateDbScheduler and per-call subscribeOn — UniFFI runs its own
multithreaded Tokio runtime, so callers stay on whatever scheduler they
pick.
- Use the lazy Mono.fromFuture { supplier } overload so each
CompletableFuture is created at subscription time, avoiding races in
chains like put.then(delete).then(get).
- Wrap batch() in Mono.defer + doFinally close so the WriteBatch handle
is pinned across the async db.write — without it UniFFI's cleaner could
free the Rust handle mid-flight.
- SlateDbTable.close() returns Mono<Void> for the new async db.shutdown();
test setUp/tearDown adjusted. Callers (SlateDbHashLabel,
SlateDbIndexedLabel, SlateDbStorage, SlateDbOptions) unchanged.
- New SlateDbNativeLibrary helper extracts the bundled OS/arch native
library to a temp file and sets uniffi.component.slatedb.libraryOverride
— workaround for IronCoreLabs/uniffi-bindgen-java#58 / #59 (FFM loader
does not extract from classpath). Isolated so it can be deleted whole
once upstream ships a classpath-aware loader.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
8153445 to
fc41691
Compare
Contributor
Author
|
Closing as experiment complete. Will resume once the v0.5.0 / v0.6.0 milestones reduce our tech debt and make storage backend extension easier. |
This was referenced Apr 26, 2026
Open
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
Port SlateDB from
io.slatedb:slatedb:0.11.0(jextract) toio.slatedb:slatedb-uniffi:0.12.1(UniFFI). Targetsnext/slatedb-uniffi, notmain.Closes #255
Changes
slatedb:0.11.0→slatedb-uniffi:0.12.1.SlateDbConnections/SlateDbTableagainst UniFFI's async API. DropSlateDbSchedulerand per-callsubscribeOn— UniFFI runs its own multithreaded Tokio runtime.SlateDbTable.close()returnsMono<Void>to bridge asyncdb.shutdown(); tests adjusted.SlateDbNativeLibraryhelper extracts the bundled OS/arch native lib to a temp file and setsuniffi.component.slatedb.libraryOverride. Workaround forIronCoreLabs/uniffi-bindgen-java#58/#59(FFM loader doesn't extract from classpath); isolated so it's a clean delete if upstream ships a classpath-aware loader.Non-obvious lifetime / scheduling subtleties are documented inline.
How to Test
AI Assistance
Tool / model: claude code (opus 4.7 1m)