@anolilab/prisma-schema-reader
v2.0.0
Published
A prisma.schema reader and schema to object transformation class.
Downloads
9
Readme
A prisma schema reader and object transformation
Installation
Use npm or yarn to install
npm install @anolilab/prisma-schema-reader --save
Or
yarn add @anolilab/prisma-schema-reader
Usage
Basic usage
import { SchemaToObjectTransformer } from "@anolilab/prisma-schema-reader";
const prismaSchemaPath = "path to your prisma.schema";
const transformer = new SchemaToObjectTransformer(prismaSchemaPath);
transformer.transform();
The transformer will return a JSON object based on the prisma schema.
{
"enums": [
{
"fields": [
"ADMIN",
"USER",
],
"name": "Role",
},
...
],
"models": [
{
"documentation": "",
"fields": [
{
"documentation": "",
"isId": true,
"kind": "scalar",
"list": false,
"map": undefined,
"name": "id",
"relationField": false,
"required": true,
"type": "Int",
"unique": false,
},
]
},
...
],
}
Versioning
This project uses SemVer for versioning. For the versions available, see the tags on this repository.
Supported Node.js Versions
Libraries in this ecosystem make a best effort to track Node.js’ release schedule. Here’s a post on why we think this is important.
Contributing
If you would like to help take a look at the list of issues and check our Contributing guild.
Note: please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
Credits
License
The anolilab zod-prisma is open-sourced software licensed under the MIT license