TUI database client app.
Find a file
2026-06-19 21:46:27 +03:00
examples TinyDb support; jumping between foreign keys or nested objects 2026-06-19 21:46:27 +03:00
lqs TinyDb support; jumping between foreign keys or nested objects 2026-06-19 21:46:27 +03:00
.gitignore moved to urwid; working sqlite example 2026-06-15 15:43:46 +03:00
CHANGELOG.md TinyDb support; jumping between foreign keys or nested objects 2026-06-19 21:46:27 +03:00
FUTURE.md added mysql connector; scheme full; wide table 2026-06-19 17:12:35 +03:00
LICENSE Initial commit 2023-12-11 16:30:27 +00:00
pyproject.toml TinyDb support; jumping between foreign keys or nested objects 2026-06-19 21:46:27 +03:00
README.md TinyDb support; jumping between foreign keys or nested objects 2026-06-19 21:46:27 +03:00

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 / nvim editing
  • Result table navigation with hjkl and 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 list
  • ctrl-t: focus result table
  • ctrl-e: edit query in $EDITOR
  • ctrl-s: toggle schema view
  • ctrl-u: discard pending changes and reload
  • ctrl-r: run pending changes and current query
  • ctrl-o: go back from relation/document navigation
  • < / >: load previous or next table page
  • ?: toggle full key help
  • ctrl-q: quit with confirmation

In the saved connection list:

  • ctrl-d: delete selected connection with confirmation

In the result table:

  • enter / i: edit field
  • d: set field to NULL
  • D: delete row
  • ctrl-i / tab: insert row
  • ctrl-g: go to the selected relation or nested document value
  • /: search and jump to column
  • :: command mode
  • hjkl / 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; space adds current column to SELECT, esc exits
  • ic <value> ..., ics: current column is in entered/selected values
  • nic <value> ..., nics: current column is not in entered/selected values
  • eqcv, eqc <value>: current column equals current/entered value
  • neqcv, neqc <value>: current column does not equal current/entered value
  • ltcv, ltc <value>: current column is less than current/entered value
  • gtcv, gtc <value>: current column is greater than current/entered value
  • lecv, lec <value>: current column is less than or equal to current/entered value
  • gecv, gec <value>: current column is greater than or equal to current/entered value
  • nc: current column is NULL
  • ncn: current column is not NULL
  • not, ~not: open/close NOT (...)
  • 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 text
  • y: 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.