Crates.io | pgqb |
lib.rs | pgqb |
version | 0.1.0 |
created_at | 2025-09-25 01:13:12.592776+00 |
updated_at | 2025-09-25 01:13:12.592776+00 |
description | An interactive PostgreSQL query builder for the terminal |
homepage | |
repository | https://github.com/PKWadsy/pgqb |
max_upload_size | |
id | 1854013 |
size | 63,288 |
A sleek and interactive PostgreSQL query builder for the terminal! 🚀
pgqb
is a command-line tool that helps you build and execute SQL queries interactively. No more typing complex queries by hand – just select your tables, columns, filters, and more through an intuitive interface!
Install directly from crates.io:
cargo install pgqb
Or build from source:
git clone https://github.com/PKWadsy/pgqb.git
cd pgqb
cargo build --release
cargo install --path .
pgqb "postgresql://user:password@localhost/dbname"
This starts the interactive query builder. Follow the prompts to select your table, columns, and options.
--conn <CONNECTION_STRING>
: PostgreSQL connection string (required)--details
: Show table and column descriptions--exec
: Execute the generated query--no-confirm
: Skip confirmation prompts--format <FORMAT>
: Output format (csv, json, jsonl, tsv)--output <DEST>
: Output destination (file path)Interactive mode with descriptions:
pgqb --conn "postgresql://user:pass@localhost/db" --details
Execute query and save as CSV:
pgqb --conn "postgresql://user:pass@localhost/db" --exec --format csv --output results.csv
Pipe to pager:
pgqb --conn "postgresql://user:pass@localhost/db" --exec --format table | less
*
).The tool generates clean, properly formatted SQL queries and handles various PostgreSQL data types.
Contributions welcome! Please feel free to submit issues, feature requests, or pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.
Made with ❤️ and lots of ☕