This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
---
|
||||
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
|
||||
---
|
||||
Reference in New Issue
Block a user