Code Monkey home page Code Monkey logo

prisma-query-inspector's Introduction

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

Buy Me A Coffee

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

prisma-query-inspector's People

Contributors

omar-dulaimi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.