- Python 100%
| examples | ||
| lqs | ||
| .gitignore | ||
| CHANGELOG.md | ||
| FUTURE.md | ||
| LICENSE | ||
| pyproject.toml | ||
| README.md | ||
LQS
LQS is a small terminal database viewer and editor.
The current release is v0.1.3. It supports SQLite, MySQL, and TinyDB with a keyboard-driven Urwid interface inspired by tools like tig and htop.
Features
- Supports SQLite, MySQL, and TinyDB connections
- Filterable table list
- Query view with external
$EDITOR/nvimediting - Result table navigation with
hjkland arrow keys - Pending row edits before commit
- Transactional run for queued changes
- Insert, update, set
NULL, and delete row operations - Schema pane toggle for the selected table
Install
python3 -m venv .venv
source .venv/bin/activate
pip install -e .
Run
lqs
Open a SQLite database directly:
lqs path/to/database.sqlite
MySQL and TinyDB connections can be added from the in-app new connection flow.
TinyDB connections use a JSON database path. An example database is available at examples/tinydb.json.
Main Keys
ctrl-n: focus table listctrl-t: focus result tablectrl-e: edit query in$EDITORctrl-s: toggle schema viewctrl-u: discard pending changes and reloadctrl-r: run pending changes and current queryctrl-o: go back from relation/document navigation</>: load previous or next table page?: toggle full key helpctrl-q: quit with confirmation
In the saved connection list:
ctrl-d: delete selected connection with confirmation
In the result table:
enter/i: edit fieldd: set field toNULLD: delete rowctrl-i/tab: insert rowctrl-g: go to the selected relation or nested document value/: search and jump to column:: command modehjkl/ arrows: move cell
Foreign-key cells and nested document cells are shown in green. On SQL databases, ctrl-g opens the referenced table filtered to the referenced row. On TinyDB/document values, ctrl-g opens the selected array/object as a read-only virtual table and shows the document path above the result header.
Table commands:
s: enter column selection mode;spaceadds current column toSELECT,escexitsic <value> ...,ics: current column is in entered/selected valuesnic <value> ...,nics: current column is not in entered/selected valueseqcv,eqc <value>: current column equals current/entered valueneqcv,neqc <value>: current column does not equal current/entered valueltcv,ltc <value>: current column is less than current/entered valuegtcv,gtc <value>: current column is greater than current/entered valuelecv,lec <value>: current column is less than or equal to current/entered valuegecv,gec <value>: current column is greater than or equal to current/entered valuenc: current column isNULLncn: current column is notNULLnot,~not: open/closeNOT (...)or,~or: open/close(... OR ...)and,~and: open/close(... AND ...)
Built command queries are kept until ctrl-r runs them or ctrl-l cancels and reloads the table.
In schema view:
hjkl/ arrows: move through schema texty: copy schema to clipboard
Project Notes
Future work is tracked in FUTURE.md. Release notes are in CHANGELOG.md.
Source lives at https://g.arns.lt/zordsdavini/lqs.