i want to use data source provider to be dynamic i...
# orm-help
r
i want to use data source provider to be dynamic in
schema.prisma
based on env variable But typescript complains that it is not allowed Is there any way to achieve this?
r
@Rahul Agrawal 👋 Currently there’s no way to provide a dynamic value to datasource. The database
provider
must be static as of now.
It would be great if you could add a 👍 to this request so that we can know the priority.
Also I would like to know your use case for dynamic datasource provider.
r
I am trying to make a application which would auto generate type safe CRUD API's and Backend Interface to talk to database tables User would be just required to provide there database type and connection URL I am able to make connection URL as dynamic as I have the facility to access that with env file So, I was looking for similar approach for provider type as well
r
If multiple users can specify their database and tables, you would need separate schema’s for them anyway so you could use them in that manner as a workaround.
r
interesting 🤔 thanks for suggesting the workaround👍
💯 1
r
Let me know how it goes and if you have any further queries 🙂
r
sure thanks 🙂