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.

[Redwood.js] provider = "redwood"

See original GitHub issue

Redwood wants to enable their users to use SQLite in dev, and Postgres in production. To enable that, they need some special logic:

  • Redwood creates the schema with a (virtual) provider called redwood
  • When calling Prisma commands, Redwood uses --schema to supply a dynamically generated version of the schema where redwood is replaced depending on the environment (with sqlite or postgres)

(Internal context: https://www.notion.so/prismaio/provider-redwood-fd04ffcc9c684a9bb5cdb5d5a5fc2ecc + https://prisma-company.slack.com/archives/CL0AJEVSA/p1580897189010000)


Tasks:

  • Double check that --schema works for this
  • Schema validator and VSCode (and whoever else looks at the provider) have to be happy about redwood
  • (Optional) Our CLI could detect redwood specific stuff (like redwood) and point user to use it instead of Prisma directly (because directly we will not do the replacing things and stuff might break)

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
janpiocommented, Feb 12, 2020

I think Redwood should already be able to fully build what they are aiming for, --schema works and if they call all the Prisma CLI commands with that behind the scenes, provider=redwood should never make it to Prisma CLI to fail this way.

We now have to decide where and how we want to either a) enable redwood as a valid value or b) fail with a nicer error message that tells people to use the Redwood CLI.

@schickling? Do we know what the Redwood.js CLI will look like that people should prefer using here?

Suggestion:

  • Make redwood a ~~warning~ ~valid value in VS Code, and somehow point to Redwood in the description suggest that Redwood generates a comment next to it that links to an explanation how the replacing works
  • Handle all the CLI/Engine cases with a error message, but fail anyway (as we can not really run the command without the real provider value)
1reaction
cannikincommented, Feb 27, 2020

We got it! It looks like this is working for us, thanks so much!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Authentication | RedwoodJS Docs
You will need to instantiate your authentication client and pass it to the <AuthProvider> . See individual auth docs in the menu for...
Read more >
Authentication | RedwoodJS Docs
Redwood provides a zeroconf experience when using our Auth package! GraphQL Query and Mutations​. GraphQL requests automatically receive an Authorization JWT ...
Read more >
RedwoodJS: The App Framework for Startups | RedwoodJS.com
Focus on building your startup,not fighting your framework. Redwood is the full-stack web framework designed to help you grow from side project to...
Read more >
Side Quest: How Redwood Works with Data | RedwoodJS Docs
Redwood likes GraphQL. We think it's the API of the future. Our GraphQL implementation is built with Apollo (on the client) and GraphQL...
Read more >
Authentication | RedwoodJS Docs
Redwood includes integrations for several of the most popular third-party auth providers: Auth0 · Clerk · Netlify Identity · Netlify GoTrue-JS · Magic...
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