Skip to main content

read_samples

Function read_samples 

Source
pub fn read_samples(
    card_id: &str,
    q: SamplesQuery,
) -> Result<Vec<Value>, String>
Expand description

Read per-case samples from {card_id}.samples.jsonl.

Streams the JSONL file line by line; rows are parsed, optionally filtered by q.where_, then paged by offset + limit. Offset applies to the post-filter stream, matching Prisma/SQL semantics.

Returns an empty Vec if no samples file exists (Cards without per-case details are the common case, not an error).