Skip to content

feat(db): expose query complexity limits via OpenOptions (issue #76) - #92

Merged
adityamukho merged 1 commit into
mainfrom
fix/issue-76-query-complexity
Apr 6, 2026
Merged

adityamukho merged 1 commit into
mainfrom
fix/issue-76-query-complexity

Conversation

@adityamukho

Copy link
Copy Markdown
Collaborator

Summary

Add max_derived_facts and max_results configuration options to OpenOptions for controlling recursive rule complexity.

Changes

  • src/db.rs: Add max_derived_facts and max_results fields to OpenOptions with builder methods
  • src/db.rs: Add Minigraf::in_memory_with_options() for testing custom options
  • src/query/datalog/executor.rs: Add max_derived_facts and max_results fields to DatalogExecutor, add set_limits() method
  • Test: Verify limits are enforced on recursive queries

Issue #76

@codecov

codecov Bot commented Apr 6, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.71429% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.72%. Comparing base (949bf22) to head (a71019b).
⚠️ Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
src/query/datalog/executor.rs 62.50% 3 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (949bf22) and HEAD (a71019b). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (949bf22) HEAD (a71019b)
branch-coverage 1 0
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #92      +/-   ##
==========================================
- Coverage   90.68%   83.72%   -6.96%     
==========================================
  Files          26       26              
  Lines       14718     4806    -9912     
  Branches      557        0     -557     
==========================================
- Hits        13347     4024    -9323     
+ Misses       1304      782     -522     
+ Partials       67        0      -67     
Flag Coverage Δ
branch-coverage ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/db.rs 91.74% <100.00%> (-4.75%) ⬇️
src/query/datalog/executor.rs 93.45% <62.50%> (-3.45%) ⬇️

... and 24 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@adityamukho
adityamukho force-pushed the fix/issue-76-query-complexity branch from db1a7a3 to 902b8c6 Compare April 6, 2026 12:22
Add max_derived_facts and max_results builder methods to OpenOptions.
Thread limits through to DatalogExecutor via set_limits().
Add in_memory_with_options() for testing custom options.
Add test verifying limits are enforced on recursive queries.

Issue #76
@adityamukho
adityamukho force-pushed the fix/issue-76-query-complexity branch from 902b8c6 to a71019b Compare April 6, 2026 12:26
@adityamukho
adityamukho merged commit a438746 into main Apr 6, 2026
15 checks passed
@adityamukho
adityamukho deleted the fix/issue-76-query-complexity branch April 6, 2026 13:00
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