File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22
3+ if [ -z " $BEEPER_ACCESS_TOKEN " ]; then
4+ echo ' ERROR: BEEPER_ACCESS_TOKEN environment variable is required but not set'
5+ exit 1
6+ fi
7+
38echo " ==> Detecting PostgreSQL Python executable"
49PYTHON_EXECUTABLE_PATH=$( pg_config --configure | grep -o " PYTHON=[^ ]*" | cut -d= -f2 | tr -d " '" )
510echo " PostgreSQL uses Python $PYTHON_EXECUTABLE_PATH "
@@ -29,8 +34,8 @@ if [ "$PG_MAJOR_VERSION" -ge 18 ]; then
2934 done
3035 POSTGRES_CONFIG=(-c extension_control_path=" $( realpath temp/install/share/postgresql) " )
3136else
32- # In PostgreSQL <18 we cannot point `postgres` to our local extensions directory. So we install directly to
33- # the system.
37+ # In PostgreSQL <18 we cannot point `postgres` to our local extensions directory. So we install
38+ # directly to the system.
3439 sudo make install PG_CONFIG=" $( command -v pg_config) "
3540fi
3641
6166echo " ==> Running setup.sql"
6267psql -d postgres -f test/sql/create_extension.sql
6368
69+ psql -d postgres --variable " value='$BEEPER_ACCESS_TOKEN '" -c ' ALTER DATABASE postgres SET beeper_desktop_api.beeper_access_token = :value;'
70+ if [ -n " $BEEPER_DESKTOP_BASE_URL " ]; then
71+ psql -d postgres --variable " value='$BEEPER_DESKTOP_BASE_URL '" -c ' ALTER DATABASE postgres SET beeper_desktop_api.base_url = :value;'
72+ fi
73+
6474if command -v pgcli & > /dev/null; then
6575 echo " ==> Starting pgcli REPL"
6676 pgcli postgres
6777else
6878 echo " ==> Starting psql REPL (TIP: Install pgcli for better autocomplete!)"
6979 psql -d postgres
70- fi
80+ fi
You can’t perform that action at this time.
0 commit comments