Skip to content

feat(prepared): copyable PreparedQuery and browser limit setters (#872) - #883

Merged
adityamukho merged 2 commits into
v3from
feat/872-binding-overrides
Nov 10, 2026
Merged

adityamukho merged 2 commits into
v3from
feat/872-binding-overrides

Conversation

@adityamukho

Copy link
Copy Markdown
Collaborator

Core part of #872 (refs #872; part of #862). The language bindings can't derive a prepared query with different limits without this.

What changes

  • PreparedQuery: Clone. Every binding holds a prepared query behind a shared handle, and core's limit setters consume self. A copy is an independent statement over the same database: a setter applied to one leaves the other unchanged. Test: prepared_query_clone_is_independent (tests/limit_keywords_test.rs).
  • BrowserPreparedQuery setters. withMaxDerivedFacts(n), withQueryMemoryLimit(bytes) and withMaxIterations(n) each return a new BrowserPreparedQuery that keeps the database open, and leave the receiver unchanged. The argument is a non-negative integer JS number. At or above the platform's usize::MAX (2^32 − 1 on wasm32) it means no limit. A negative, fractional or non-finite number throws [API-017]. BrowserDb still takes no options.
  • Docs. docs/CONFIGURATION.md gains a section on which settings every binding exposes, and on BrowserDb taking no open options. Also CHANGELOG.md, docs/TEST_COVERAGE.md and the CLAUDE.md test count.

No new error codes. No file-format or query-language change.

Verification

  • cargo test: 2,112 passed, 0 failed, 21 ignored. --features test-hooks: 2,150 passed, 30 ignored.
  • wasm-pack test --headless --firefox --features browser: 68 passed, 2 of them new (prepared_setters_derive_new_queries, prepared_setters_reject_bad_counts).
  • Browser and WASI clippy are clean. cargo semver-checks --baseline-rev origin/v3: 223 pass.
  • Size gate (--profile dist): 1,264,024 B before and after, under the 1,269,760 B limit.

The binding PRs follow as drafts pinned to this branch's head. They are re-pinned to the v3 merge commit once this merges.

🤖 Generated with Claude Code

https://claude.ai/code/session_01H2a7QouMzKp3tAWxgVsxRf

… setters (#872)

PreparedQuery derives Clone so language bindings, which hold a prepared
query behind a shared handle, can return a new prepared object from each
limit setter. BrowserPreparedQuery gains withMaxDerivedFacts,
withQueryMemoryLimit and withMaxIterations, each returning a new query
that keeps the database open. A number at or above usize::MAX means no
limit; a negative, fractional or non-finite one is API-017.

Part of #862.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H2a7QouMzKp3tAWxgVsxRf
@codecov

codecov Bot commented Nov 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Android has no options builder and no Minigraf object: its override
list is an OpenOptions field and its defaults a top-level
OVERRIDABLE_DEFAULTS. Swift's setters carry their argument labels.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H2a7QouMzKp3tAWxgVsxRf
@adityamukho
adityamukho merged commit d9755c0 into v3 Nov 10, 2026
19 checks passed
@adityamukho
adityamukho deleted the feat/872-binding-overrides branch November 10, 2026 10:51
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