Skip to content

fix(schema): accept positive integers and false as valid default_limit#603

Merged
woylie merged 5 commits intowoylie:mainfrom
luhagel:fix/allow-default-limit-false
Feb 2, 2026
Merged

fix(schema): accept positive integers and false as valid default_limit#603
woylie merged 5 commits intowoylie:mainfrom
luhagel:fix/allow-default-limit-false

Conversation

@luhagel
Copy link
Contributor

@luhagel luhagel commented Nov 19, 2025

This should fix #602

Small Issue though:
Setting default_limit: false requires an explicit limit to be passed via the %Flop{} struct, otherwise queries just break on first/limit/page_size can't be blank.
The current behaviour of -1 though defaults to returning all results, just like using Repo.all, which is our current usecase.

So my proposal would be to update the typing to {:or, [:pos_integer, {:in, [false, -1]}]} and updating the docs to refelct that.

Thoughts? @woylie

@woylie
Copy link
Owner

woylie commented Dec 4, 2025

I think the limit is only required for pagination. If I'm not mistaken, setting pagination: false in the options passed to run/all/validate_and_run/validate should prevent a validation error for a missing limit.

@woylie
Copy link
Owner

woylie commented Dec 14, 2025

@luhagel I pushed a commit that prevents a limit from being required if pagination is disabled. Does this solve your use case without allowing -1?

@codecov
Copy link

codecov bot commented Dec 14, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.44%. Comparing base (c451fac) to head (bb96018).
⚠️ Report is 22 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #603   +/-   ##
=======================================
  Coverage   84.44%   84.44%           
=======================================
  Files          15       15           
  Lines        1022     1022           
=======================================
  Hits          863      863           
  Misses        159      159           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

@luhagel
Copy link
Contributor Author

luhagel commented Feb 2, 2026

@woylie Yes! That works like a charm!

(and sorry for the late reply, got swamped with github notifications)

@luhagel luhagel marked this pull request as ready for review February 2, 2026 13:44
@luhagel luhagel requested a review from woylie as a code owner February 2, 2026 13:44
@woylie woylie enabled auto-merge February 2, 2026 14:17
@woylie woylie merged commit 263fac8 into woylie:main Feb 2, 2026
18 checks passed
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.

[Bug] Document way to unset global default_limit in derive

2 participants