prismagen
v0.0.2
Published
Define your [Prisma](https://www.prisma.io/) schema across multiple files and in a directory structure of your choice.
Downloads
5
Readme
🔺 prismagen
Define your Prisma schema across multiple files and in a directory structure of your choice.
Compile it all into one schema.prisma
.
Example directory structure:
├── prisma
│ ├── user
│ │ ├── account.schema
│ │ ├── session.schema
│ ├── organization
│ │ ├── group.schema
│ │ ├── event.schema
└── base.schema (datasource and generators)
Resulting schema.prisma
:
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
generator js {
provider = "prisma-client-js"
}
model Account {
...
}
model Session {
...
}
model Group {
...
}
model Event {
...
}
...
Usage
prismagen <path to files> -b <base_filename.prisma?> -o <output_filename.prisma?>
Example: prisma .
= prisma . -b base.prisma -o schema.prisma
- Define your
datasource
andgenerator
s in abase.prisma
file. - Define enums, models, etc. in the current directory and in subdirectories.
- Run
prismagen .
to generate aschema.prisma
in the current directory.