inspect query performance issues in NestJS applications.
npm install @coti-z/nestjs-sql-inspectorimport { 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 {}| 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 |
- Automatic query analysis using EXPLAIN
- Detects slow queries and inefficient scan types
- Logs query performance information
-
database
- PostgreSQL
- MySQL
- MongoDB
-
option
- slowQueryThreshold
- NestJS >= 9.0.0
- PostgreSQL with
pgdriver >= 8.0.0
MIT