0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

prismaとsupabaseの連携仕様が変わった

Posted at

以前までのschema.prismaでは

schema.prisma
datasource db {
  provider          = "postgresql"
  url               = env("DATABASE_URL")
}
.env
DATABASE_URL=postgres://[db-user].[project-ref]:[db-password]@aws-0-[aws-region].pooler.supabase.com:6543/[db-name]?pgbouncer=true&connection_limit=1

今回の仕様

schema.prisma
datasource db {
  provider          = "postgresql"
  url               = env("DATABASE_URL")
  directUrl         = env("DIRECT_URL")
}
.env
DATABASE_URL=postgres://[db-user].[project-ref]:[db-password]@aws-0-[aws-region].pooler.supabase.com:6543/[db-name]?pgbouncer=true&connection_limit=1

DIRECT_URL=postgres://[db-user].[project-ref]:[db-password]@aws-0-[aws-region].pooler.supabase.com:5432/[db-name]

変更点

directUrlが必要になった。
prismaとデータベースの接続に関しては環境変数に原因があるので[db-user]、[project-ref]、[aws-region]、[db-name]の部分を見直してみてください。

詳しくは
https://supabase.com/partners/integrations/prisma

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?