Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameter for prisma init to supply connection string to be used in datasource #2577

Closed
janpio opened this issue May 27, 2020 · 1 comment
Closed
Assignees
Labels
kind/improvement An improvement to existing feature and code. tech/typescript Issue for tech TypeScript. topic: dx topic: prisma init CLI: prisma init
Milestone

Comments

@janpio
Copy link
Member

janpio commented May 27, 2020

Problem

Right now we need to tell people to use prisma init and then open and edit prisma/.env to add their connection string: https://twitter.com/nikolasburk/status/1265617985986801664
image

This is cumbersome, especially if you just want people to get to a working Introspection as quickly as possible.

Suggested solution

We could add a param --database (or --connection-string or --url or similar) that takes and validates the connection string, extracts the provider (mysql:// => mysql etc) and persists both in the newly generated schema.prisma and .env automatically.

Alternatives

We keep the manual workflow that tells people to edit the file.

@timsuchanek
Copy link
Contributor

This is now implemented with --url.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/improvement An improvement to existing feature and code. tech/typescript Issue for tech TypeScript. topic: dx topic: prisma init CLI: prisma init
Projects
None yet
Development

No branches or pull requests

2 participants