Querier
A querier
is the nukak
's abstraction over database drivers to dynamically generate the queries for any given entity. It allows interaction with the different databases in a consistent way.
With a querier
you can:
- Manipulate the data related to any
entity
. - Use declarative and imperative transactions.
- Obtain repositories for specific
entities
.
import { getQuerier } from 'nukak'; import { User } from './shared/models/index.js'; const querier = await getQuerier(); const users = await querier.findMany( User, { $project: ['id'], $filter: { $or: [{ name: 'maku' }, { creatorId: 1 }] }, } ); await querier.release();