Filters, sort, pagination, projection

Every list() and count() call takes an options bag — combine any of filters, sort, pagination, projection. Filters support equality, ranges, glob, null, and in; multi-filter is AND.

How it works

flowchart LR
    Q["list(entity, opts)"] --> P{index
available?} P -- yes, eq/range --> IX[Index scan] --> A[Apply remaining filters] P -- no --> FS[Full scan] --> A A --> S[Sort] --> PG[Paginate] --> PR[Project fields] --> R[rows] style IX fill:#c8e6c9,stroke:#2e7d32 style FS fill:#fff3e0,stroke:#ef6c00 style R fill:#e3f2fd,stroke:#1565c0

Try it — a four-step tour

  1. Click Seed test data to create 20 people with random age/city/score.
  2. Pick one of the Quick filter tests (e.g. gt: age > 30). The row fills in automatically and Execute query runs it — the result table shows the matching rows.
  3. Click + Add filter and combine multiple filters (e.g. city = New York AND age > 25). Execute to see both filters AND-ed.
  4. Set Sort to score desc and limit to 5 — you get the top 5 scorers.

Setup

Filters

Sort & pagination

Sort

Pagination

Projection

Uncheck a field to exclude it from the result.

Results

IDNameAgeCityScoreActive

Quick filter tests

Each preset fills the filter row(s) with a common pattern and executes immediately.

Automated test suite

Run all tests rebuilds a 6-record people list in people (Alice, Bob, Charlie, Diana, Eve, Anna) with known ages and scores, then runs these 8 checks:

  1. eq matches exactly Alice
  2. gt age > 30 returns 2 rows (Charlie, Eve)
  3. glob A* returns Alice + Anna
  4. sort age asc is monotonic
  5. sort score desc is monotonic
  6. offset=2 limit=2 returns 2 rows
  7. projection: ['name','age'] keeps only id/name/age
  8. Combined query (age ≥ 28, sort score desc, limit 3) returns 3 rows
Click the button to run.

Log