ob_dump_reader 0.1.0-beta.3
ob_dump_reader: ^0.1.0-beta.3 copied to clipboard
Minimal ObjectBox LMDB reader toolkit for Dart and Flutter: reads data.mdb directly through a bundled LMDB (build hook).
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog,
and this project adheres to Semantic Versioning.
Generated from the repo root's CHANGELOG.md at publish time — see that
file if you're reading this in the published package and want the full
picture across the other packages in this repo too.
0.1.0-beta.3 - 2026-10-27 #
Changed #
- Breaking: one package now serves the Dart VM and Flutter. The native
LMDB library is compiled by a Dart build hook (
hook/build.dart,hooks+native_toolchain_c) from the vendored source insrc/lmdb/into a code asset, sodart run,dart test,flutter run/build/testand AOT release builds all resolve it the same way on Android, iOS, Linux, macOS and Windows -- nothing is downloaded. The LMDB bindings are now@Native(lib/src/lmdb_bindings.dart). - Requires Dart SDK
^3.10.0(build hooks / native assets). - Reading (
readObjectBoxRecords(),readToManyTargets()) now probes the native library first and throws anLmdbExceptionthat names the problem ("Could not load the native LMDB library ...") instead of anArgumentError("Couldn't resolve native function ...") from deep inside the first read.
Added #
- Known limitation (documented in
dart/README.md): inside the macOS App Sandbox LMDB's named POSIX semaphores are denied, so opening a store fails with "Operation not permitted"; the example is run unsandboxed on macOS in CI. - The build hook checks the library it just built, so a bad build fails the
build instead of the app at startup: the file must exist, export every
mdb_*function the bindings call (the Windows DLL gets its exports fromsrc/lmdb_exports_win.c: MSVC exports nothing by default) and, when the target is the machine doing the build, actually load and answer a call. Android libraries are linked 16 KB page aligned (Google Play requirement). dart/example: a small Flutter app that writes an ObjectBox-shaped store and reads it back. CI builds and runs it on every platform and as an offline Flatpak (see the CI entry below).- CI:
flutter testof the example on Linux/macOS/Windows; release builds of the example for Linux, macOS, Windows, Android and iOS, each checking that the library the hook compiled is in the bundle (Android: also 16 KB alignment and nolibc++_shared.sodependency) and that the built app reads a store and, with the library removed from the bundle, fails fast with a clear error; an Android emulator job that loads the library on a device; a console-app check that reading throws a clear error whenliblmdbis missing; apub publish --dry-runjob; and a manually started Flatpak workflow (flatpak.yml) that builds the example as an offline Flatpak for x86_64 and aarch64 with flutpak and runs it inside the sandbox.
Removed #
dart run ob_dump_reader:build(bin/build.dart,tool/build.dart, theexecutables:entry), the hand-writtenDynamicLibraryloader and itspackage_config.jsonlookup, and the CMake build ofsrc/lmdb: the build hook replaces all of it.- Dependency on
path(no longer used).
0.1.0-beta.2 - 2026-10-27 #
Fixed #
- The
liblmdbshared library is found underflutter teston Flutter 3.47+: thereIsolate.resolvePackageUriSyncthrowsUnsupportedError, so the library placed bydart run ob_dump_reader:buildwas unreachable. As a last resort the loader now reads.dart_tool/package_config.jsondirectly (local files only, no network), after the executable-relative lookup, so compiled and bundled builds are unchanged.
0.1.0-beta.1 - 2026-07-22 #
Changed #
- Version bump only — republished in lockstep with
flutter/py(see the intro above), no functional changes.
0.1.0-alpha.2 - 2026-07-06 #
Added #
dart run ob_dump_reader:build— compiles the vendored LMDB source into a shared library for the current desktop platform (Linux/macOS/ Windows), via a plain CMake configure+build. No network, no FetchContent, no prebuilt binary. Only needed for plain-Dart (non- Flutter) use;ob_dump_reader_flutterbundles its own build automatically as a real Flutter plugin.readToManyTargets()— resolves ObjectBoxToManyrelation links directly from LMDB (not part of the FlatBuffers tableflatc --dartoutput can decode).decodeFlex(),bytesToHex(),bytesToUuidString(),tryParseJsonString()— decode helpers forFlexfields and theUuid/Int128/Decimal128/Bson/Json/JavaScript/JsonToNativeExternalPropertyTypeannotations, whichflatc --dartoutput only gives you as raw bytes/strings. Mirrorsob-dump's own C++ decode exactly.
Changed #
- No longer depends on
dart_lmdb2— replaced with a small, purpose-builtdart:ffibinding over the vendored LMDB C source (src/lmdb/, LMDB_0.9.31 — the same commitob-dump's own C++ core builds and has verified). Reasons, both confirmed empirically rather than assumed:dart_lmdb2's own native-library path resolution (Isolate.resolvePackageUriSync()) throwsUnsupportedErroroutright in a compiled AOT release build — reproduced with a realflutter build linux --release, copying only the output bundle to an isolated directory (no source project, no pub cache) and running it. Not Flatpak-specific: breaks every compiled Flutter Linux/Windows release build depending on it.flutter_lmdb2(the Flutter-plugin wrapper) has no Linux or Windows support at all as published — both platforms are commented out in its ownpubspec.yaml.- This package's own loader (
src/lmdb_native_library.dart) doesn't repeat either mistake: triespackage:URI resolution first (unchangeddart run/flutter runbehaviour), then falls back per platform to where each platform's own native-library bundling convention actually places the library (confirmed against the officialflutter create --template=plugin_ffiscaffold, not guessed).
readObjectBoxRecords()no longer copies to a temporary directory — reads the original files directly, in place. The copy was only ever needed becausedart_lmdb2required a write-capable LMDB environment just to register the root database handle; this package's own binding opens the environment itselfMDB_RDONLYfrom the start (matchingob-dump's own C++LmdbReader), which is exactly what LMDB's MVCC design is for: any number of readers can safely run alongside one concurrent writer, in any process, with zero risk to the original data.
Removed #
readObjectBoxRecordsUnsafe()/readToManyTargetsUnsafe()— no longer needed now that the safe, default functions read in place with no copy (see above); there was no longer a distinction for these to make.