@coti-z/nestjs-sql-inspector
v0.0.6
Published
Auto-detect SQL performance issues in NestJS
Downloads
21
Maintainers
Readme
@coti-z/nestjs-sql-inspector
inspect query performance issues in NestJS applications.
Installation
npm install @coti-z/nestjs-sql-inspectorUsage
import { Module } from "@nestjs/common";
import { SqlInspectorModule } from "@coti-z/nestjs-sql-inspector";
@Module({
imports: [
SqlInspectorModule.forRoot({
db: "postgres",
logLevel: "debug",
enabled: true,
}),
],
})
export class AppModule {}Options
| Option | Type | Default | Description |
| ---------- | ---------------------------- | ------------ | ---------------------------- |
| db | "postgres" | "postgres" | Database driver |
| logLevel | "debug" \| "log" \| "warn" | "debug" | Log level for query analysis |
| enabled | boolean | true | Enable/disable inspector |
Features
- Automatic query analysis using EXPLAIN
- Detects slow queries and inefficient scan types
- Logs query performance information
RoadMap
database
- [x] PostgreSQL
- [ ] MySQL
- [ ] MongoDB
option
- [ ] slowQueryThreshold
Requirements
- NestJS >= 9.0.0
- PostgreSQL with
pgdriver >= 8.0.0
License
MIT
