Files
morteza a8a6f085d0
deploy to danak / build_and_deploy (push) Has been cancelled
add cursor rules
2026-07-02 15:53:23 +03:30

23 lines
525 B
Plaintext

---
description: MikroORM
globs:
- "src/**/*.entity.ts"
- "src/**/*.service.ts"
alwaysApply: true
---
Use MikroORM best practices.
- Never write raw SQL unless necessary.
- Prefer EntityRepository.
- Use populate instead of manual joins.
- Use wrap(entity).assign() for updates.
- Use transactions when updating multiple entities.
- Use Collection for OneToMany relations.
- Use references when appropriate.
- Avoid N+1 queries.
- Always type repository injections.
- Use indexes where needed.---
alwaysApply: true
---