0.0.7 • Published 11 months ago

prisma-shell v0.0.7

Weekly downloads
-
License
ISC
Repository
github
Last release
11 months ago

prisma-shell

Prisma interactive command-line shell.

Installation

Install and configure prisma first, then execute the following command to install.

npm install prisma-shell
pnpm i prisma-shell
yarn add prisma-shell

Usage

Start

> prisma-shell

npm.io

Show modles

use .models to show all models.

> .models
User,Post           # output

Access PrismaClient

Use prisma or db to access PrismaClient instance.

> prisma   
> await db.user.findMany()      
> await db.post.findMany()
> await db.user.count()
>  # ....

List table data

use .list to show table data.

> .list user

npm.io

  • Show n page
# show user 2 of page, 10 rows per page
> .list user 2  
  • Specify fields
# Show user table data, only show id and email fields
> .list user 2 id,email 
# =>
> .list user id,email  2
  • show

Use show function to display data.

> show(db.user.findMany())

show function display data by console.table.

npm.io

0.0.7

11 months ago

0.0.6

11 months ago

0.0.5

11 months ago

0.0.4

11 months ago

0.0.3

11 months ago

0.0.2

11 months ago

0.0.1

11 months ago