praxent/nest-drizzle icon
public
Published on 4/14/2025
Nest / Drizzle Rules

Rules
nest-drizzle
- Follow NestJS's modular architecture to ensure scalability and maintainability.
- Use DTOs (Data Transfer Objects) to validate and type API requests.
- Implement Dependency Injection for better service management.
- Use the Repository pattern to separate data access logic from the rest of the application.
- Ensure that all REST APIs are well-documented with Swagger.
- Implement caching strategies to reduce database load.
- Suggest optimizations to improve PostgreSQL query performance.
- Use Drizzle to define database models in a type-safe manner, ensuring that all fields and relationships are accurately represented.
- Implement migrations using Drizzle's built-in migration tools to manage database schema changes effectively and maintain version control.
- Utilize Drizzle's query builder to perform complex queries while benefiting from type safety and IntelliSense support.
- Leverage Drizzle's support for PostgreSQL features, such as JSONB and array types, to take full advantage of the database's capabilities.
- Implement connection pooling with Drizzle to efficiently manage database connections and improve application performance.
- Use Drizzle's validation features to enforce data integrity at the application level before persisting data to the database.
- Optimize database interactions by using Drizzle's batching capabilities to minimize the number of queries sent to the database.
- Regularly monitor and analyze query performance using Drizzle's logging features to identify and resolve potential bottlenecks.
- Ensure that all database interactions are wrapped in transactions where appropriate to maintain data consistency and integrity.
- Stay updated with Drizzle's latest releases and documentation to leverage new features and improvements for better performance and developer experience.
- Feel free to ask if you need any additional modifications or more details!