Queries
Queries
The calls on a table: read, write, shape, search, and raw SQL.
The table is declared. First schema covers insert, find, one, count, exists, update, and delete. These pages are the rest of the surface.
one returns the row or null. More than one match is not_unique: one() on notes matched more than one row. Pass orderBy to take the first, or narrow where. A caller-supplied filter goes through filters.
I want to …
| I want to … | Use | Documented on |
|---|---|---|
| Read several rows | find | Read rows |
Read one row or null | one | Read rows |
| Count matching rows | count | Read rows |
| Test whether a row matches | exists | Read rows |
| Page with a cursor | page | Read rows |
| Walk rows in batches | .stream() | Read rows |
| Insert a row | insert | Write rows |
| Update rows | update | Write rows |
| Delete rows | delete | Write rows |
Families
| Family | You use it for |
|---|---|
| Read rows | find, one, count, exists, page, distinct, stream, and explain |
| Write rows | Insert, update, claim, and sync |
| Shape results | Aggregate, include, windows, and period |
| Search and trees | Search, a tree, and a fragment |
| Where operators | Equality, comparison, patterns, and the rest of a where |
| Transactions | A transaction and a batch |
| Typed raw SQL | A typed raw call |
| Presets | A named where |
| Request filters | What a caller may send |