8000 feat: open options, query cursors, fact log and log writer (v3) by adityamukho · Pull Request #9 · project-minigraf/minigraf-java · GitHub
[go: up one dir, main page]

Skip to content

feat: open options, query cursors, fact log and log writer (v3) - #9

Merged
adityamukho merged 1 commit into
v3from
feat/etl-surface
Oct 7, 2026
Merged

adityamukho merged 1 commit into
v3from
feat/etl-surface

Conversation

@adityamukho
Copy link
Copy Markdown
Contributor

The JVM part of project-minigraf/minigraf#462, #465 and #467. It uses the UniFFI shim shared with minigraf-python#6 and the shape in minigraf's docs/superpowers/specs/2026-10-07-binding-etl-surface-design.md (minigraf PR #468).

What's new

  • MiniGrafDb.openWithOptions(path, OpenOptions), query() → MiniGrafCursor, factLog(FactFilter) → MiniGrafFactLog, currentTxCount(), and MiniGrafLogWriter (create, append, appendBatch, advanceTxCount, txCount, finish, abandon, isOpen).
  • Java facade: Minigraf.options() / Minigraf.filter() builders, openWithOptions, createLogWriter, batches(cursor, n) / records(log, n) iterables, errorMessage(e) and VALID_TIME_FOREVER. Kotlin gets cursor.batches() and log.records() extensions.
  • UniFFI objects are already AutoCloseable in Kotlin, so try-with-resources frees them, and closing a writer that never finished abandons its build. The shim's own close methods clash with that, so uniffi.toml renames them to release() (cursor, fact log) and abandon() (writer). The generateKotlinBindings task now lists uniffi.toml as an input, so a rename change regenerates the bindings.
  • Counts cross the FFI as signed Long/Int. Kotlin's ULong/UInt are name-mangled and cannot be called from Java. The shared shim was changed for this in minigraf-python#6.

Branching

Targets the new v3 branch, a copy of main. minigraf is a git dependency on the core v3 commit from PR #468. CI now also runs on pushes to v3; PRs already ran for every base.

Testing

  • cargo test: 25 passed.
  • ./gradlew test: 19 passed. The new tests are EtlTest.kt (6) and a Java interop test that uses builders, try-with-resources, the iterables and the record constructor. Together they cover batches of 1/7/1000 equal to execute(), a cursor fixed at open, API-012, read-only queries/API-014/STG-042/two readers/STG-02x, filters and API-017, a round trip with identical records and currentTxCount, a hole from a skipped transaction, API-015 with batch index, API-018, STG-043, and abandon/close leaving no file.

🤖 Generated with Claude Code

https://claude.ai/code/session_015GgLEs8YozJjYhwPEYgTUn

Exposes the v3 core's ETL surface with the shim shared by the UniFFI
bindings (minigraf-python#6), following minigraf's
docs/superpowers/specs/2026-10-07-binding-etl-surface-design.md:
open_with_options (project-minigraf/minigraf#465), query cursors
(#462), and the fact log and log writer (#467).

Java idiom on top: Minigraf.options() and Minigraf.filter() builders,
openWithOptions, createLogWriter, batches()/records() iterables, and
errorMessage(e). UniFFI objects are AutoCloseable, so the shim's own
close methods are renamed to release() and abandon() in uniffi.toml.

Depends on the unreleased v3 core by git revision; switches to the
crates.io release at v3.0.0. CI runs on pushes to v3.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015GgLEs8YozJjYhwPEYgTUn
@adityamukho
adityamukho merged commit 358d7d9 into v3 Oct 7, 2026
13 checks passed
@adityamukho
adityamukho deleted the feat/etl-surface branch October 7, 2026 06:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0