Skip to content

investycorp/prisma-schema-import

Repository files navigation

prisma-schema-import

version license

Install

yarn add -D prisma-schema-import

And install your schema package (prisma-schema-*)

Features

Generate your schema package

yarn prisma-schema-import generate <schemaName>

prisma-schema-import will generate your schema package on '../prisma-schema-schemaName' directory.

Publish your schema package

Move to schema package directory, and edit package.json.

The package.json file generated by default does not contain author, repository, license, and publishConfig fields.

Fill in all the fields and deploy the package to an npm repository or private repository via npm or yarn's publish command.

Load your schema package

yarn add -D <prisma-schema-schemaName>
yarn prisma-schema-import load

Install your schema package and run prisma-schema-import load command.

prisma-schema-import will load your schema on schema package, and overwrite a /prisma/schema.prisma file.

Import other schema on schema

prisma-schema-import will process schema merge on schema is loaded.

If you want import other schema on prisma schema, write like below.

On prisma.schema

model User {
    ...
}

@import('./post.schema')

model Comment {
    ...
}

On post.schema

model Post {
    ...
}

Commands

load  Load prisma schema from prisma-schema-* package
generate [options] <name>  Generate prisma-schema-* package from prisma schema

Options

generate

-s --schema <schemaPath>    path for exist prisma schema (default: "")
-p --package <packagePath>  path for generated package (default: "")

About

Import prisma schema from other repository and import other schema on prisma schema

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published