https://github.com/omar-dulaimi/prisma-query-inspector
Prisma +2 tool to inspect all queries going to the database, formatted and with all params if any
https://github.com/omar-dulaimi/prisma-query-inspector
databse inspector prisma query
Last synced: 10 months ago
JSON representation
Prisma +2 tool to inspect all queries going to the database, formatted and with all params if any
- Host: GitHub
- URL: https://github.com/omar-dulaimi/prisma-query-inspector
- Owner: omar-dulaimi
- License: mit
- Created: 2022-03-13T11:23:02.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-04-11T17:47:23.000Z (about 2 years ago)
- Last Synced: 2025-08-10T19:08:02.764Z (10 months ago)
- Topics: databse, inspector, prisma, query
- Language: TypeScript
- Homepage:
- Size: 249 KB
- Stars: 8
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
[](https://badge.fury.io/js/prisma-query-inspector)
[](https://www.npmjs.com/package/prisma-query-inspector)
[](http://hits.dwyl.com/omar-dulaimi/prisma-query-inspector)
[](LICENSE)
# Prisma Query Inspector
Prisma 2 tool to inspect all queries going to the database, formatted and with all params if any

# Todo List
- [x] MySQL support
- [x] PostgreSQL support
- [x] MariaDB support
- [x] SQLite support
- [x] Standard SQL support
- [x] Make UI responsive
## Table of Contents
- [Installation](#installing)
- [Usage](#usage)
## Installation
Using npm:
```bash
$ npm install prisma-query-inspector --save-dev
```
Using yarn:
```bash
$ yarn add prisma-query-inspector --dev
```
# Usage
### 1- Enable Prisma query logs
```js
const prisma = new PrismaClient({
log: [
{
emit: "event",
level: "query",
},
],
});
```
### 2- Register the query handler
```js
import { queryHandler } from "prisma-query-inspector";
prisma.$on("query", queryHandler);
```
### 3- Add a new npm script in `package.json`
```js
"inspect-queries": "prisma-query-inspector start"
```
### 4- Now run it, then run your project afterwards
```bash
npm run inspect-queries
```
### You're done!
# Available Options
- port: number - inspector server port
- alias: `p`
- default: `7001`
- language: string - database language used to format the queries
- alias: `l`
- default: `sql`
- possible values: `sql` | `mysql` | `mariadb` | `postgresql`