pgxcli vs pgcli
pgcli is a mature PostgreSQL CLI developed over many years, which has set the standard for interactive PostgreSQL clients.
pgxcli takes the simpler approach, focusing on speed and minmal setup. It is a singe Go binary with fast startup and TOML configuration. If you need a lightweight, It may be good fit. for a more feature-rich, established experience, pgcli remains the benchmark.
Where pgxcli stands out:
Now
- Single binary: No external runtime dependencies (like Python).
- Performance: Fast startup and better overall performance.
Planned
- Modern CLI Interface: Enhanced user experience.
- Streaming query results: Better handling of large tables.
- Browser-based Table view: View results via localhost.
- Direct Table export: Export to SQL INSERT, CSV, MD tables, Excel, and HTML.
Which one should I use?
Right now, I would definitely choose pgcli. I think no explanation is needed.
That could change as pgxcli matures. I would really appreciate if you give pgxcli a try and share your feedback. If you want to contribute, that would be even better.
Feature Comparison Matrix
| Category | Feature | pgcli (Python) | pgxcli (Go, v0.1.0) | Status |
|---|---|---|---|---|
| TL;DR | Overall | Feature-rich, mature | Fast, simple, single-binary | - |
| SQL Editing | Multi-line mode | Roadmap v0.2.0 | ||
| Vi/Emacs toggle | Out of scope | |||
| Completion | Keyword completion | Stable | ||
| Schema-aware completion | Roadmap v0.2.0 | |||
| Output | Pager support | Stable | ||
| Table formatting | Stable | |||
| Colored output + themes | Stable | |||
| Syntax highlighting | (rich) | Stable | ||
| Commands | Backslash meta-commands | Stable Expanding | ||
| Built-in commands | (clear) | Expanding | ||
| History | Persistent history | Stable | ||
| History based completion | Roadmap | |||
| Connection | Standard flags | Stable | ||
| DSN/URI support | Stable | |||
| Environment variables | Stable | |||
| SSH tunnels | Roadmap | |||
| Security | Keyring integration | Roadmap | ||
| Execution | Multi-statement | Stable | ||
| Explain mode | Roadmap | |||
| Timing display | Stable | |||
| Config | Auto-created config | Stable | ||
| Config format | INI | TOML | Different approach | |
| UI | Status toolbar | Deferred |
Legend: Available Planned Deferred Out of scope
Tech Stack Comparison
| Category | dbcli/pgcli | |
|---|---|---|
| Language | Python | Go |
| Postgres Driver | psycopg | jackc/pgx |
| CLI Framework | click | spf13/cobra |
| Interactive Prompt | prompt-toolkit | jedib0t/go-prompter |
| Configuration | configobj | spf13/viper |
| SQL Parser | sqlparse | Custom Splitter |
| Tabular Output | tabulate | olekukonko/tablewriter |
| Testing | pytest | stretchr/testify |
Note: The feature comparison above reflects our understanding at the time of writing. As pgcli is an actively maintained project, we recommend checking the official pgcli documentation for the most up-to-date information on its features.