| Crates.io | pgtui |
| lib.rs | pgtui |
| version | 0.9.0 |
| created_at | 2025-04-26 10:27:00.93276+00 |
| updated_at | 2026-01-20 22:34:39.70495+00 |
| description | A Postgres TUI client that utilizes your terminal text editor for inserts & updates. |
| homepage | |
| repository | https://codeberg.org/kdwarn/pgtui |
| max_upload_size | |
| id | 1650137 |
| size | 239,363 |
My favorite user interface on a computer is probably the terminal-based text editor. I enjoy typing, syntax highlighting, spellchecking, the navigation, etc. So why not use that as a simple way to insert and update data in a database? That's the goal here, wrapped in a TUI that has additional functionality and which provides the interface to the database overall. All you have to do is provide the connection string via environment variables and voilà! No browser! No forms! No oauth! Just your terminal, your terminal-based editor, and your database.
To insert or update a record in the database, your default terminal editor will open a templated-out TOML file, where each Postgres data type is mapped to a corresponding TOML type.1 Edit as necessary, save and close, and its values are parsed and used in the insert/update query. You can also abandon the insert/update after a file has already been opened by simply uncommenting a line for that purpose. (And, by saving that file elsewhere before abandoning it, you can save it as a draft for submitting later.)
Various usage notes:
? key.""" or '''. The first requires escaping special characters, while the latter does not. See the specification for more details.Installation:
cargo install pgtui.apt-get install <path to it>. (And please let me know about your experience doing so.)Format for the environment variable in a .env file:
DATABASE_URL="postgres://user:password@host:port/database"
Extra disclaimer, beyond the AGPL license: This is very much a work in progress and in active development, so don't use it on a database you care about/haven't first backed up.
Not all Postgres types are yet handled, and may never be. However the basic ones are - boolean, text, integers, floats, arrays (of text), etc. ↩