Build

Querying & the CRUD service

Use generated find/write APIs, where-operators, transactions, and optional read-cache/event/logging features.

Every model registered on a module service receives generated accessors: service.<model>.find, findMany, create, update, and related methods.

Choose singular methods when one row is expected and bulk methods only when the business operation intentionally affects several rows. In particular, update() changes every match; use updateOne() when only one row may change.

Method families

Read methods

MethodReturnsTypical use
find(options)T | nullLookup by custom filters
findMany(options)T[]Paged list/search query
findById(id)T | nullPrimary-key lookup
findOne(where)T | nullConvenient first-match helper

Write methods

MethodReturnsTypical use
create({ data })TInsert one row
createMany({ data })T[]Insert multiple rows
upsert({ data, onConflict, ... })TInsert-or-update
upsertMany({ data, onConflict, ... })T[]Bulk insert-or-update
update({ where, data })T[]Update matching rows
updateOne({ where, data })T | nullUpdate one row
delete({ where })numberRemove rows
softDelete({ where })T[]Mark as deleted when .softDelete() exists
restore({ where })T[]Restore soft-deleted rows
count({ where })numberCount matching rows
exists({ where })booleanExistence check

Soft delete is enabled by default on ORM models and can be disabled with .softDelete(false). Normal reads exclude deleted rows unless withDeleted: true is supplied.

Continue to the next pages for the options, filters, transaction behavior, and service-level telemetry: