1.4.4 • Published 2 years ago

prisma-query-inspector v1.4.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

npm version npm HitCount npm

Prisma Query Inspector

Prisma 2 tool to inspect all queries going to the database, formatted and with all params if any prisma-query-inspector

Todo List

  • MySQL support
  • PostgreSQL support
  • MariaDB support
  • SQLite support
  • Standard SQL support
  • Make UI responsive

Table of Contents

Installation

Using npm:

$ npm install prisma-query-inspector --save-dev

Using yarn:

$ yarn add prisma-query-inspector --dev

Usage

1- Enable Prisma query logs

const prisma = new PrismaClient({
  log: [
    {
      emit: "event",
      level: "query",
    },
  ],
});

2- Register the query handler

import { queryHandler } from "prisma-query-inspector";
prisma.$on("query", queryHandler);

3- Add a new npm script in package.json

"inspect-queries": "prisma-query-inspector start"

4- Now run it, then run your project afterwards

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
1.4.4

2 years ago

1.4.3

2 years ago

1.4.2

2 years ago

1.4.1

2 years ago

1.4.0

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.2.0

2 years ago

1.1.0

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago