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?

More than 1 year has passed since last update.

supabase ローカル環境構築 備忘録

Last updated at Posted at 2024-07-01

前提条件

・Node.js がインストールされている
(以下ケースでは、npm コマンドを使用しています
・Docker Desktop がインストールされている
(内部的に docker のイメージを使用するため、docker のコマンドが通る様になっている必要があります。Docker Desktop じゃないといけないわけではないですが、今回は簡単に用意できる Docker Desktop を用意することを想定して作業していきます)

インストール・構築(コマンド)

supabase をインストール

npx npm install supabase --save-dev

supabaseを初期化
(コマンドを実行したディレクトリにsupabaseフォルダが生成されます)

npx supabase init

続けて以下コマンドを実行
-> コマンド実行が終わると、ローカル環境用の情報が出力されます

npx supabase start

リモートDBとローカルDBをリンクする

npx supabase link --project-ref 「プロジェクトID」

「プロジェクトID」は、リモート環境のURL末尾を参照する
https://supabase.com/dashboard/project/「プロジェクトID」
コマンド実行後にパスワードを聞かれるため、リモート環境のパスワードを入力する

リモートDBの情報を取得する

npx supabase db pull
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?