Setup
- Docker
- Supabase CLI
- Deno CLI
Run project
- On root repo, execute:
supabase start
Supabase will setup Docker containers. When finish, Supabase access info will be printed to console. With docker ps
, you will see containers running as below screenshot.
See section Development Guide > Develop Edge Function
for starting Supabase function.
- Access:
- Postgres URL:
postgresql://postgres:postgres@localhost:54322/postgres
- Supabase Studio: http://localhost:54323
- API URL: http://localhost:54321
- Editor:
- Use any SQL client connect to Postgres URL.
- Or edit directly on Supabase Studio.
SQL client suggestions:
- Commit changes to create database migration
After any update, execute supabase db commit <change_name>
to create migration.
Preview changes
supabase db changes
Seeds data
- Add seed INSERT statement in supabase/seed.sql.
- Rerun migration and seed scripts
supabase db reset
.
New function
supabase functions new <func-name>
Run function locally (with .env
)
supabase functions serve <func-name> --env-file .env
Setup
- Install Deno CLI & setup dev env
- Tutorial
- Supabase example
- Deno development
- Preview changes:
supabase db push [--dry-run]
- Push changes:
supabase db push
supabase functions deploy <func-name>
Ex:
supabase functions deploy hello
supabase secrets set --env-file <path-to-dotenv-file>