はじめに
Prisma と Supabase を接続したいときに Connection string が必要になるのですが、確認する方法が分からなかったのでまとめます。
手順
1. Supabase プロジェクトにログイン
Supabase Dashboardにアクセスして、対象プロジェクトを選択
2. ヘッダー部分の Connect
をクリック
3. 確認する
Connect
をクリックするとモーダルが開かられるので、そこで Direct connection と Transaction pooler などを確認できます。
// Direct connection
postgresql://postgres:[YOUR-PASSWORD]@db.xxxxxxxx.supabase.co:5432/postgres
// Transaction pooler
postgresql://postgres.xxxxxxxx:[YOUR-PASSWORD]@aws-0-ap-northeast-1.pooler.supabase.com:6543/postgres
[YOUR-PASSWORD]は、プロジェクトを作成したときのパスワードに置き換えてください。
例) パスワードが hello world
なら
postgres://postgres:hello world@db.xxxxxxxx.supabase.co:5432/postgres
になります。
View parameters をクリックすると host や port 番号なども確認できます。
おわりに
確認方法はすごくシンプルでしたが、見つけるまでに 30 分ほどかかりました...