0.0.7 • Published 6 months ago

prisma-shell v0.0.7

Weekly downloads
-
License
ISC
Repository
github
Last release
6 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

6 months ago

0.0.6

6 months ago

0.0.5

6 months ago

0.0.4

6 months ago

0.0.3

6 months ago

0.0.2

6 months ago

0.0.1

6 months ago