pgcli's equivalent to mycli's `--init-command`?
mycli supports --init-command option:
--init-command TEXT SQL statement to execute after connecting.
-
Does
pgclihave this? -
Is it possible to specify the init commands in the config file
~/.config/pgcli/config? Ideally I want to specify different--init-commandfor different DSNs defined in[alias_dsn].
pgcli does not have the feature. I imagine it would not be difficult to port from mycli, if you have the bandwidth.
Here is the mycli PR adding the feature:
https://github.com/dbcli/mycli/pull/874
@your-diary Can you try this pull-requests and let me know if that satisfies your request?
You can install pgcli from this branch using the following command:
pip install -U https://github.com/dbcli/pgcli/archive/refs/heads/amjith/init-command.zip
@amjith Thank you for your great work! It's working as expected :)
Dockerfile and compose.yaml files used for testing: https://github.com/dbcli/mycli/issues/1195#issuecomment-2816959292