如何解决'error - InvalidDatasourceError: Datasource URL should use prisma'



所以我在我的项目中使用Prisma作为ORM,与我使用AWS设置的数据库进行通信。对AWS服务不满意,我现在将我的数据库切换到railway.app-这对我来说很好。然而,我用AWS连接字符串在我的应用程序上设置了一个Prismadata proxy,现在我似乎不再想要/需要它了,我删除了它,但得到一个错误:

error - InvalidDatasourceError: Datasource URL should use Prisma:// protocol. 
If you are not using the Data Proxy, remove the data proxy from the preview features in your 
schema and ensure that PRISMA_CLIENT_ENGINE_TYPE environment variable is not set to data proxy.

因为得到错误,我已经从prisma.schema文件中删除了previewFeatures = ["dataProxy"],使其看起来像这样(回到它是什么之前配置与dataproxy):

generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
url= env("DATABASE_URL")
}

但错误仍然存在,我如何解决这个问题?

运行prisma generate修复此问题

相关内容

最新更新