File tree 1 file changed +13
-1
lines changed
1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 7
7
PSQL_VERSION=" 15"
8
8
MIGRATION_FILE=" "
9
9
PORTNO=" @PGSQL_DEFAULT_PORT@"
10
+ PSQL_USER=" postgres"
10
11
11
12
# Function to display help
12
13
print_help () {
@@ -15,6 +16,7 @@ print_help() {
15
16
echo " Options:"
16
17
echo " -v, --version [15|16|orioledb-16] Specify the PostgreSQL version to use (required)"
17
18
echo " -f, --file FILE Provide a custom migration script"
19
+ echo " -u, --user USER Specify the user/role to use (default: postgres)"
18
20
echo " -h, --help Show this help message"
19
21
echo
20
22
echo " Description:"
@@ -29,6 +31,7 @@ print_help() {
29
31
echo " nix run .#start-client -- --version 15"
30
32
echo " nix run .#start-client -- --version 16 --file custom_migration.sql"
31
33
echo " nix run .#start-client -- --version 16 --port 5433"
34
+ echo " nix run .#start-client -- --version 16 --user supabase_admin"
32
35
}
33
36
34
37
# Parse arguments
@@ -52,6 +55,15 @@ while [[ "$#" -gt 0 ]]; do
52
55
exit 1
53
56
fi
54
57
;;
58
+ -u|--user)
59
+ if [[ -n " $2 " && ! " $2 " =~ ^- ]]; then
60
+ PSQL_USER=" $2 "
61
+ shift 2
62
+ else
63
+ echo " Error: --user requires an argument"
64
+ exit 1
65
+ fi
66
+ ;;
55
67
-h|--help)
56
68
print_help
57
69
exit 0
137
149
# psql -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U supabase_admin -p "$PORTNO" -h localhost -c 'SELECT extensions.pg_stat_statements_reset(); SELECT pg_stat_reset();' postgres || true
138
150
139
151
# Start interactive psql session
140
- exec psql -U postgres -p " $PORTNO " -h localhost postgres
152
+ exec psql -U " $PSQL_USER " -p " $PORTNO " -h localhost postgres
You can’t perform that action at this time.
0 commit comments