@redredgroup/prisma-enum-generator
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

prisma enum value generator

This tool allows you to get the value of the enum table from prisma.

Installation

Install @redredgroup/prisma-enum-generator with npm OR yarn

  npm install -D @redredgroup/prisma-enum-generator
  //or
  yarn add -D @redredgroup/prisma-enum-generator

Usage/Examples

Please add enum module as below.

generator client {
  provider = "prisma-client-js"
}

generator enum {
  provider = "node node_modules/@redredgroup/prisma-enum-generator"
  output = "./generated"
}

datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
}
//And 
npx prisma db pull
//Build
npx prisma generate

Done!

Environment Variables

The two options below are optional, but can be modified if the properties below and the table names used are different.

ENUM_PREFIX enum table start prefix (Default: enum_*)

ENUM_TABLE_COLUMN Value column for table enum (Default: value)

ENUM_FILE_NAME File name to output | example NiceEnum Value -> NiceEnum.ts (The .ts will be added automatically.) | (Default: enum.ts)

Warning

v0.0.1 version only supports postgres SQL relational databases. Please note.

License

MIT

Package Sidebar

Install

npm i @redredgroup/prisma-enum-generator

Weekly Downloads

1

Version

1.0.5

License

MIT

Unpacked Size

30.1 kB

Total Files

30

Last publish

Collaborators

  • jieey1140