Skip to content

Instantly share code, notes, and snippets.

@segevfiner
Created July 12, 2024 10:47
Show Gist options
  • Save segevfiner/faf1bbacbf8a942635c0115669d6a718 to your computer and use it in GitHub Desktop.
Save segevfiner/faf1bbacbf8a942635c0115669d6a718 to your computer and use it in GitHub Desktop.
Install pldbgapi in the local Supabase development PostgresSQL
#!/bin/bash
set -ex
project_id=$(sed -nr 's/project_id[[:space:]]*=[[:space:]]*"([^"]+)"/\1/p' supabase/config.toml)
major_version=$(sed -nr 's/major_version[[:space:]]*=[[:space:]]*([[:digit:]]+)/\1/p' supabase/config.toml)
docker exec -i supabase_db_$project_id bash <<EOF
set -x
/usr/share/postgresql-common/pgdg/apt.postgresql.org.sh
apt-get install -y postgresql-$major_version-pldebugger
psql -h localhost postgres supabase_admin -c "create extension pldbgapi with schema extensions;"
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment