Socket
Book a DemoInstallSign in
Socket

prisma-generator-cli

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

prisma-generator-cli

Generates a CLI from your Prisma schema that allows you to query, seed, and export data

unpublished
latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

Prisma CLI Generator

CI

A Prisma generator that generates a command-line interface from your Prisma schema using oclif. Use the CLI to run queries, seed records, or export your query results to a CSV file.

View the example project to see it in action.

Getting Started

  • Install the generator and oclif:

    npm install prisma-generator-cli @oclif/core --save-dev
    
  • Add the generator to your Prisma schema:

    generator cli {
      provider = "prisma-generator-cli"
    }
    
  • Run Prisma's generate command to generate the CLI in the ./prisma/cli/ directory:

    npx prisma generate
    
  • Add the following configuration for oclif to your package.json:

    "oclif": {
      "commands": "./prisma/cli/commands",
      "topicSeparator": " "
    }
    

    For more information about oclif's configuration, refer to their documentation.

CLI Usage

Run ./prisma/cli/bin/run --help to view available commands for your generated CLI.

Exporting to CSV

Use the --_csv flag to output the query results as comma-separated values.

Disable Generator

You can prevent the CLI from being generated by setting the following environment variable:

PRISMA_GENERATOR_CLI=false

Keywords

prisma

FAQs

Package last updated on 27 Nov 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts