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

data.read_in_loop

Query or get inside a for loop.

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

example
type Title = Text {    max_length: 80}entity Book {    id: Uuid    title: Title    subtitle: Title?    available: Bool}type BookNotFound = Failure {    kind: FailureKind.not_found}type Count = Int {    min: 0}action available_count(book_ids: List<Book.id>) fails BookNotFound -> Count {    var mut count: Count = 0    for book_id in book_ids {        var book: Book = attempt Book.get(book_id)        if (book.available) {            count = Count(count + 1)        }    }    return count}
jadpo checkcheck failed: 1 error, 1 file

error Book.get reads once for every item of the loop

--> main.jadpo:23:34

   |23 |         var book: Book = attempt Book.get(book_id)   |                                  ^^^^^^^^ inside `for`
reason
A read inside a loop makes one database query per item. Read the whole set with one query, testing the field with in a list of the values, before the loop.
next
Read the records with one query using in before the loop (agent)
rule
data.read_in_loop
help
https://jadpo.dev/docs/errors/data.read_in_loop

Markdown for agents: /docs/errors/data.read_in_loop.md.Built from Jadpo main at aee2e8f.