Skip to content

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

@janpio

Description

@janpio

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions