Repository navigation
feat: open options, query cursors, fact log and log writer (v3) - #6
Merged
Merged
Conversation
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). Swift idiom on top: forEachBatch/forEachRecord (a Sequence cannot throw), MiniGrafError.message and validTimeForever. A new swift-test CI job compiles the generated bindings with Sources/MinigrafKit and runs Tests/swift/main.swift on macOS; before it, CI compiled no Swift. 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
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.
The Swift part of project-minigraf/minigraf#462, #465 and #467. It uses the UniFFI shim shared with minigraf-python#6, minigraf-java#9 and minigraf-android#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:options:),query(datalog:)→MiniGrafCursor,factLog(filter:)→MiniGrafFactLog,currentTxCount(), andMiniGrafLogWriter(create,append,appendBatch,advanceTxCount,txCount,finish,close,isOpen).Sources/MinigrafKit/MinigrafKit+Iteration.swiftaddscursor.forEachBatch(size:_:),log.forEachRecord(batchSize:_:),MiniGrafError.messageandvalidTimeForever. #462 asked for aSequence, but a SwiftSequencecannot throw and a batch read can fail, so these take a throwing closure. The release job already copiesSources/MinigrafKit/with the generated bindings.swift-testCI job on macOS. It builds the shim, generates the Swift bindings, compiles them withSources/MinigrafKitand runsTests/swift/main.swift. Until now CI compiled no Swift at all.Branching
Targets the new
v3branch, a copy ofmain.minigrafis a git dependency on the corev3commit from PR #468. CI now also runs on pushes tov3.Testing
cargo test: 25 shim tests passed.Tests/swift/main.swiftcovers batches of 1/7/1000 equal toexecute(), a cursor fixed at open and after close, API-012, two read-only handles, API-014, the writer refused, STG-042, record values (ref, keyword, forever), filters, API-017, a round trip with identical records andcurrentTxCount, a hole, API-015 with batch index, API-018, STG-043, and close leaving no file. No Swift toolchain was available locally, so this job's first run is on CI.🤖 Generated with Claude Code
https://claude.ai/code/session_015GgLEs8YozJjYhwPEYgTUn