b9036c50583a67e19536efe507503d7fbe4f54e6
- Author
- Pavle Portic <git@theedgeofrage.com>
- Committer
- Pavle Portic <git@theedgeofrage.com>
- Date
Message
Update dpsql function and add dpsqluri function
Diff
1diff --git a/dot_config/zsh/functions/dpsql b/dot_config/zsh/functions/dpsql
2index 96d90e83701f1805c8dbc37e878b504140f4617c..477907583d739ad54f9e7f4444430029f4715d0e 100644
3--- a/dot_config/zsh/functions/dpsql
4+++ b/dot_config/zsh/functions/dpsql
5@@ -1,4 +1,4 @@
6 # vim: ft=zsh
7 # connect to dune RDS instance
8
9-PGPASSWORD=$(aws secretsmanager get-secret-value --secret-id ${1}_${2}_db_${2}_user_password --output text --query SecretString) psql -U ${2} -h ${1}-${2}-db.dune.com.beta.tailscale.net ${2}
10+PGPASSWORD=$(aws secretsmanager get-secret-value --secret-id ${1}_${2}_db_${2}_user_password --output text --query SecretString) psql -U ${2} -h ${1}-${2}-db.tailf3b9f.ts.net ${2}
11diff --git a/dot_config/zsh/functions/dpsqluri b/dot_config/zsh/functions/dpsqluri
12new file mode 100644
13index 0000000000000000000000000000000000000000..07aa134eb2153ef824252a4422f7fc61d9d78967
14--- /dev/null
15+++ b/dot_config/zsh/functions/dpsqluri
16@@ -0,0 +1,5 @@
17+# vim: ft=zsh
18+# connect to dune RDS instance
19+
20+PGPASSWORD=$(aws secretsmanager get-secret-value --secret-id ${1}_${2}_db_${2}_user_password --output text --query SecretString)
21+echo "postgres://${2}:${PGPASSWORD}@${1}-${2}-db.tailf3b9f.ts.net/${2}?sslmode=disable"