Repository navigation
feat: user predicates and aggregates (minigraf#180) - #15
Merged
Merged
Conversation
Red until the shim exports the UDF traits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Urda7FD9CYYoxdeGGJa11x
Pin minigraf v3 to 02243f16 and add the binding template's UDF FFI (minigraf-binding-template#9): MiniGrafUdfError, the MiniGrafPredicate, MiniGrafAggregate and MiniGrafAccumulator protocols (AnyObject, Sendable), and MiniGrafDb.registerPredicate/registerAggregate. A throwing callback fails the query with QRY-014. README gains a User functions section. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Urda7FD9CYYoxdeGGJa11x
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.
#180 PR 6 (plan steps 17–20, spec §6, §6.1): Swift classes can be registered as predicates and aggregates.
7c8c5540→02243f16(minigraf#757). The old pin already had #181 and #316; #306 needed nothing here.src/lib.rs: the template's UDF FFI (minigraf-binding-template#9), applied unchanged from minigraf-android#16 (the two lib.rs files were identical):MiniGrafUdfError, the three#[uniffi::export(with_foreign)]traits,registerPredicate/registerAggregateovertry_register_*, handle locks that only clone theMinigraf. 44 Rust tests (CI'srust-testjob runs them).protocol MiniGrafPredicate/MiniGrafAggregate/MiniGrafAccumulator: AnyObject, Sendable, methodsthrows. Any Swift error other thanMiniGrafUdfErrorreaches the core as itsString(describing:).Tests/swift/main.swift: predicate, aggregate in:findand:over, cursor and prepared query calls,MiniGrafUdfErrorand a plain Swift error →MiniGrafError.Query[QRY-014], failing step (also in a cursor), non-UUID ref, a predicate querying its own db,INT-040, two threads inside one predicate at once.testUserFunctions(adult?/product/QRY-014 on a throw).The first commit holds only the tests, so CI shows them red before the implementation.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Urda7FD9CYYoxdeGGJa11x