Add a Post-Disconnect Shell Script option to run a script when the database connection is terminated
- Dominant language
- Python
- Stars
- 486
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Description
## Enhancement request
It would be nice to have a Post-Disconnect (or Shutdown) Shell Script option like the Pre-Connect Shell Script that runs when the connection to the database is terminated.
My use case it that I use the Pre-Connect Shell Script to start up Google's `cloud_sql_proxy` in the background and there is no convenient way to stop the process when I disconnect from the database. The proxy is left running until I manually kill it from the command line.
I do something like this in the Pre-Connect
```
GOOGLE_APPLICATION_CREDENTIALS="$HOME/.credentials/.json"
export GOOGLE_APPLICATION_CREDENTIALS
/cloud_sql_proxy -instances=::=tcp:5432 &
```
and want to do something like this in the Post-Disconnect
```pkill cloud_sql_proxy```
## What software versions are you using?
Postico version:
2.1.1 (9692)
macOS version:
Sonoma 14.6.1 (23G93)
PostgreSQL version:
PostgreSQL 9.6.24 on x86_64-pc-linux-gnu, compiled by Debian clang version 12.0.1, 64-bit
Contributor guide
No contributing guide indexed for this repository
Research direction
No files or tests are named. Start by locating the existing Pre-Connect Shell Script option and tracing the database disconnect lifecycle; add the corresponding Post-Disconnect or Shutdown option and verify that its configured script runs when the connection terminates, including the cloud_sql_proxy cleanup use case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- gcp, postgresql, shell
- Domain
- databases, desktop
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100