🗄️ lsql
lsql is a terminal GUI for browsing and managing LanceDB databases. Pick a database and a table visually, then run slash commands against whatever's selected — no more retyping paths and table names for every single query.
✨ Features
- 🖥️ Four-panel layout — database picker, table list, command input, and results, all on one screen
- 📁 Folder-browser dialog — open an existing database by browsing to it, no need to memorize or hand-type paths
- ⚡ Slash commands with auto-suggestion — type
/and see every available command, filtered live as you type - 🖱️ Click a table to preview it — instantly runs
select * from <table> limit 100for you - 🔍 Double-click any cell — pop open the full, untruncated value when a row is too wide to read comfortably, with buttons to copy it or edit and write it back
- 📄 Pagination — large result sets are paged 100 rows at a time instead of flooding the screen
- 🧮 Raw SQL via DuckDB —
/sqlruns across every table in the database - 🛟 Confirmation dialogs —
/drop,/empty, and/deletealways ask first - ⏪ Command history — up/down arrow recall, just like a shell
- 📚 Built-in help —
/helplists every command;/help <command>shows its flags - 🌓 Light/dark theme — a one-click toggle, defaulting to your OS's current setting
📦 Installation
pip install lsql
🚀 Quick Start
lsql # launch the TUI
lsql /path/to/database # launch pre-connected to a database
🧭 A tour of the four panels
1️⃣ Database — type a path or browse to one
Type a path directly and hit Enter, or click Open... to pick a folder visually (with an Up button to walk back up the directory tree). The 🌙/☀️ icon next to it toggles light/dark theme — it defaults to whatever your OS is currently using.
Opening a path that doesn't exist yet creates a database there — same as running
/create --path <path>.
2️⃣ Tables — click to preview
Click any table in the list to select it and immediately see its first 100 rows.
3️⃣ Command input — slash commands with live suggestions
Start typing / and a filtered dropdown of matching commands appears. Use ↑/↓ to
pick one, Tab or Enter to accept it, Esc to dismiss. ↑/↓ also recall previous
commands when the dropdown isn't open.
Forgot a flag? /help lists every command, and /help <command> shows its full usage:
4️⃣ Results — tables, schemas, and safety checks
/schema renders a table's columns and types right in the results panel:
Destructive commands always confirm first:
Large results are paginated — 100 rows per page, with < Prev / Next > controls:
And if a cell's value is too long to read in the table, double-click it to see the full text, copy it, or edit it and write the change back to the table:
⌨️ Command reference
Commands that operate on a table (query, schema, delete, empty, drop, update,
dump) always act on whichever table is currently selected in the table list — select
it there rather than naming it in the command.
| Command | What it does |
|---|---|
/create --path <path> |
Create (or open) a database at path |
/query [--where ...] [--limit 10] [--select "a,b"] [--output table|json] |
Query the current table |
/schema |
Show the current table's schema |
/sql <SQL query> |
Raw SQL across every table — the one command that ignores the table selection |
/update --set-clause "col='val'" --where "..." |
Update rows in the current table |
/delete --where "..." |
Delete rows from the current table |
/empty |
Delete all rows from the current table |
/drop |
Drop the current table entirely |
/load --path file.csv --table name [--overwrite] |
Load a CSV into a new table |
/dump --path out.csv [--overwrite] |
Dump the current table to CSV |
/refresh |
Refresh the table list and SQL views |
/help [command] |
Show all commands, or details for one |
/exit |
Quit |
/drop, /empty, and /delete pop a confirmation dialog before running. /load
creates a brand-new table, so it takes an explicit --table name instead of using the
current selection.
🛠️ Development
git clone https://github.com/wuqunfei/lsql.git
cd lsql
pip install -e ".[dev]"
Run the tests:
pytest
Regenerate the screenshots above after a visible UI change:
python scripts/generate_screenshots.py
Requirements
- Python 3.10+
- lancedb, duckdb, pandas, typer, rich, textual
🤝 Contributing
Contributions are welcome! Please feel free to open a PR.
🐛 Issues
Found a bug or have an idea? Open an issue.
📄 License
Apache License 2.0 — see LICENSE for details.
Metadata
Release files for lsql 2.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| lsql-2.0.1.tar.gz | 97.7 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| lsql-2.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 130.5 kB
Release files / lsql-2.0.1.tar.gz
| Download URL | lsql-2.0.1.tar.gz |
|---|---|
| Size | 97.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
de2b0a9330c8f912c0592203ecf4bc521cc4534c675dd51802d25110ff83a47b
|
|
BLAKE2b-256 checksum How to use checksums |
746e656449c70d47e239be878f3d75c07805a2f8bc4066a4ea365ecd576dbcc9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.13
|
Release files / lsql-2.0.1-py3-none-any.whl
| Download URL | lsql-2.0.1-py3-none-any.whl |
|---|---|
| Size | 32.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
50c01ac7d77d496b1e60c2695a26769b3f4519d3c9d2b470c946d9751bbb5134
|
|
BLAKE2b-256 checksum How to use checksums |
14a6229ebfadab99e19546302a4e835d4809b82e15ca40a00b0847fb080a8b9d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.13
|
Security for lsql 2.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.