question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Supply a custom path to Prisma schema file for CLI commands (i.e. `--schema`?)

See original GitHub issue

This is useful when you want to run the commands from the root folder of your project for example and your schema.prisma file is in a subdirectory. It avoids changing directories.

  • What is the naming of the flag/param? (path, schema, …)
  • Which commands require it?
  • Also available via ENV var? (e.g. PRISMA_SCHEMA_PATH)
  • How are the developers made aware of it being active?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

13reactions
aeharakecommented, Mar 10, 2021

@ Jolg42 Hello, did you manage to find a way to specify the path from .env?

This is useful when you want to run the commands from the root folder of your project for example and your schema.prisma file is in a subdirectory. It avoids changing directories.

* What is the naming of the flag/param? (path, schema, ...)

* Which commands require it?

* Also available via ENV var? (e.g. `PRISMA_SCHEMA_PATH`)

* How are the developers made aware of it being active?

Ok got it. We can set this from package.json:

  "prisma": {
    "schema": "prisma/schema.prisma"
  },
2reactions
Jolg42commented, Feb 6, 2020

@schickling I’m implementing it like this --schema=./directory/prisma.schema Spec will be in Notion soon!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Prisma schema (Reference)
The Prisma schema is the main configuration file when using Prisma. It is typically called schema.prisma and contains your database connection and data ......
Read more >
Prisma CLI Command Reference
Specifies the path to the desired schema.prisma file to be processed instead of the default path. Both absolute and relative paths are supported....
Read more >
Generating the client (Concepts) - Prisma
This page explains how to generate Prisma Client. It also provides additional context on the generated client, typical workflows and Node.js configuration.
Read more >
What is introspection? (Reference) - Prisma
You can introspect your database using the Prisma CLI in order to generate the data model in your Prisma schema. The data model...
Read more >
Environment variables - Prisma
Using .env files ... Prisma creates a default .env file at your projects root. You can choose to replace this file or create...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found