You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Team,
I have been working on some features for my daily work in my own fork, ofc (DiegoDAF/pgcli.daf), and maybe you want them.
Happy to open a PR for any of them. Just pick a number, and I will open the PR:
SSH/connectivity
pgcli_dump and pgcli_dumpall: wrappers around pg_dump / pg_dumpall that auto-open the same SSH tunnel pgcli uses, so backups work through bastions transparently.
pgcli_isready: a pg_isready wrapper that is SSH-tunnel aware.
Native paramiko SSH tunnels (replacing the sshtunnel lib): reads IdentityFile from ~/.ssh/config, supports ProxyCommand, configurable host key verification (host_key_policy), and allow_agent.
Config in directories (drop-in files)
5. dsn.d/: DSN aliases as individual *.conf files instead of one big section. 6. namedqueries.d/: named queries as individual files.
6. Server-versioned named queries (namedqueries.d, psqlrc-style). Files in namedqueries.d/ can carry a version suffix in the filename, like psql's ~/.psqlrc-17: activity-17.conf is only offered when the connected server is 17+, and among variants of one query name the highest version <= the server wins (a suffix-less file is the fallback). Queries whose requirements the server doesn't meet disappear from \n entirely. The server version comes from the connection's startup packet, so there's no extra round-trip.
Non-interactive / scripting
7. -c/--command and -f/--file: run SQL or a file and exit (repeatable).
8. -o/--output: redirect results to a file.
9. -y/--yes: skip destructive-query confirmations.
10. -t/--tuples-only: rows only, no headers/status. [pending as PR #1545]
11. --no-timings and --no-status: quieter output for scripts.
Autocompletion
13. SET <param> completion from live pg_settings.
14. SET ROLE <role> completion.
Output
15. Streaming NOTICE output: VACUUM VERBOSE, ANALYZE VERBOSE, REINDEX, etc. print server NOTICEs line by line as they arrive instead of buffering until the end.
18. stream_results config option: print each statement's result as soon as it finishes instead of buffering all of them until the end. Pasting several statements (select a; select b; select c;) shows each result live as its statement completes, similar to psql/pgAdmin. Off by default.
Safety
16. \restrict / \unrestrict support and blocking.
17. Password and path sanitization in logs.
Others
18. EXPLAIN analysis summary. With explain mode (F5) on, the plan tree is followed by a compact summary: slowest nodes by exclusive time, time grouped by relation, and the worst planner row-estimate misses. Inspired by pgAdmin's graphical explain. Config explain_summary, default off.
Query-tool niceties:\autocommit [on|off] (manual-transaction mode with a toolbar indicator), \hist [N] (this session's SQL with elapsed time and ok/error), and an F9 binding that runs only the selected text.
psql-style paste mode (paste_mode + F6): pasting a multi-statement block echoes each statement followed by its result, interleaved, like psql.
log_truncate_on_rotation (default off), like the PostgreSQL setting: with day-of-week/day-of-month log rotation, a slot's file is truncated when it comes around again instead of appending forever.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi Team,
I have been working on some features for my daily work in my own fork, ofc (DiegoDAF/pgcli.daf), and maybe you want them.
Happy to open a PR for any of them. Just pick a number, and I will open the PR:
SSH/connectivity
pgcli_dumpandpgcli_dumpall: wrappers aroundpg_dump/pg_dumpallthat auto-open the same SSH tunnel pgcli uses, so backups work through bastions transparently.pgcli_isready: apg_isreadywrapper that is SSH-tunnel aware.paramikoSSH tunnels (replacing thesshtunnellib): readsIdentityFilefrom~/.ssh/config, supportsProxyCommand, configurable host key verification (host_key_policy), andallow_agent..pgpassworks through SSH tunnels (original host preserved for lookup,hostaddrused for the actual connection). [pending as PR Enable .pgpass support for SSH tunnel connections #1546]Config in directories (drop-in files)
5.
dsn.d/: DSN aliases as individual*.conffiles instead of one big section.6.namedqueries.d/: named queries as individual files.6. Server-versioned named queries (
namedqueries.d, psqlrc-style). Files innamedqueries.d/can carry a version suffix in the filename, like psql's~/.psqlrc-17:activity-17.confis only offered when the connected server is 17+, and among variants of one query name the highest version <= the server wins (a suffix-less file is the fallback). Queries whose requirements the server doesn't meet disappear from\nentirely. The server version comes from the connection's startup packet, so there's no extra round-trip.Non-interactive / scripting
7.
-c/--commandand-f/--file: run SQL or a file and exit (repeatable).8.
-o/--output: redirect results to a file.9.
-y/--yes: skip destructive-query confirmations.10.
-t/--tuples-only: rows only, no headers/status. [pending as PR #1545]11.
--no-timingsand--no-status: quieter output for scripts.Logging
12.
log_rotation_mode(none / day-of-week / day-of-month / date) andlog_destination.Autocompletion
13.
SET <param>completion from livepg_settings.14.
SET ROLE <role>completion.Output
15. Streaming NOTICE output:
VACUUM VERBOSE,ANALYZE VERBOSE,REINDEX, etc. print server NOTICEs line by line as they arrive instead of buffering until the end.18.
stream_resultsconfig option: print each statement's result as soon as it finishes instead of buffering all of them until the end. Pasting several statements (select a; select b; select c;) shows each result live as its statement completes, similar to psql/pgAdmin. Off by default.Safety
16.
\restrict/\unrestrictsupport and blocking.17. Password and path sanitization in logs.
Others
18. EXPLAIN analysis summary. With explain mode (F5) on, the plan tree is followed by a compact summary: slowest nodes by exclusive time, time grouped by relation, and the worst planner row-estimate misses. Inspired by pgAdmin's graphical explain. Config
explain_summary, default off.Query-tool niceties:
\autocommit [on|off](manual-transaction mode with a toolbar indicator),\hist [N](this session's SQL with elapsed time and ok/error), and an F9 binding that runs only the selected text.psql-style paste mode (
paste_mode+ F6): pasting a multi-statement block echoes each statement followed by its result, interleaved, like psql.log_truncate_on_rotation(default off), like the PostgreSQL setting: with day-of-week/day-of-month log rotation, a slot's file is truncated when it comes around again instead of appending forever.All reactions