query
Installation
SKILL.md
Query System
Bknd provides a type-safe query builder built on top of Kysely. All queries start from a Repository and use WhereBuilder for filters.
Important: The em() function is used for schema definition in Code Mode. For runtime queries, use:
- API endpoints (Code Mode recommended):
api.data.readMany(),api.data.createOne(), etc. - Direct database access (Hybrid Mode):
app.em.repo(),app.em.mutator()afterapp.build()
What You'll Learn
- Get a Repository from EntityManager
- Build filter conditions with WhereBuilder
- Use auto-join for relationship filtering
- Configure pagination, sorting, and field selection
- Eagerly load relations with
with - Optimize query performance with indices