Jadpo is experimental and not ready for production. These docs follow the compiler's main branch as of 5 Nov 2026. What's built · Install 0.3.0
jadpo
ReferenceErrors

ErrorsReads and writes · rule

query.limit_range

On this page

A query's limit: could be less than 1, either as written or because its value's type allows it.

Area 6, Reads and writes; not declinable; the next step is usually the agent's.

Why Jadpo refuses it

limit: is the most records a list query gives back. A limit of 0 would read nothing, and PostgreSQL refuses a negative one. So a limit is at least 1: a number written from 1, or a value whose type says min: 1 or more.

What it looks like

main.jadpo:

example
type Title = Text {    max_length: 80}entity Book {    id: Uuid    title: Title    subtitle: Title?    available: Bool}query shelf() -> List<Book> {    from: Book    order: [Book.title asc]    limit: 0}
jadpo checkcheck failed: 1 error, 1 file

error limit: 0 would read nothing

--> main.jadpo:15:12

   |15 |     limit: 0   |            ^ below 1
reason
limit: is how many records come back at most, so it is at least 1.
next
Give limit: a number from 1 (agent)
rule
query.limit_range
help
https://jadpo.dev/docs/errors/query.limit_range

(agent) at the end of the next: line means your coding agent can make the fix itself.

A limit given as a parameter is refused when its type lets it be below 1. Here ShelfSize has a max: but no min::

main.jadpo:

example
type Title = Text {    max_length: 80}type ShelfSize = Int {    max: 50}entity Book {    id: Uuid    title: Title}query shelf(size: ShelfSize) -> List<Book> {    from: Book    order: [Book.title asc]    limit: size}
jadpo checkcheck failed: 1 error, 1 file

error size can be below 1, so the limit could read nothing

--> main.jadpo:17:12

   |17 |     limit: size   |            ^^^^ `ShelfSize` has no `min:`
reason
limit: is how many records come back at most, so it is at least 1, and a value's type must say so with min: 1 or more, as the built-in PageSize (1 to 100) does.
next
Give ShelfSize min: 1, or type the value as PageSize (agent)
rule
query.limit_range
help
https://jadpo.dev/docs/errors/query.limit_range

How to fix it

If the limit is written as a number, write the most records the list should give, from 1:

example
    limit: 50

shelf gives up to 50 books, in title order.

If the limit is a parameter, give its type min: 1. main.jadpo becomes:

example
type Title = Text {    max_length: 80}type ShelfSize = Int {    min: 1    max: 50}entity Book {    id: Uuid    title: Title}query shelf(size: ShelfSize) -> List<Book> {    from: Book    order: [Book.title asc]    limit: size}

shelf gives up to size books. A number outside 1 to 50 can't be a ShelfSize, so it never reaches the query.

If 1 to 100 suits the list, the parameter can be typed as the built-in PageSize instead, and ShelfSize isn't needed.

Markdown for agents: /docs/errors/query.limit_range.md.Built from Jadpo main at aee2e8f.