SQLite · Terminal database manager

TablePro

A terminal database manager for SQLite. Connect to a database file, browse and edit tables, and run queries — from a clean CLI or an interactive REPL. Built on schema introspection, so it adapts to whatever database you point it at. Pure Python standard library, no runtime dependencies.

Pythonsqlite3Schema introspection Paged browsingSafe edits by PKCSV / JSON export

Try it here

Browse a sample database

This page is a small in-browser demo of the same sample dataset TablePro ships with — paging, sorting and filtering, running entirely in your browser. The real tool is the Python CLI; see the example session below and the repository.

What it does

From a database file to an editable grid

A generic tool that discovers a schema it knows nothing about in advance.

connect

Connection

Open any SQLite file, with an optional read-only mode for safe inspection.

discover

Schema introspection

List tables and views; read columns, types, primary key, foreign keys and indexes.

browse

Paged browsing

Page through rows with LIMIT/OFFSET, pick columns, filter with WHERE, sort with ORDER BY.

query

SQL runner

Run arbitrary SQL. SELECT renders a grid; DML reports affected rows; bad SQL is an error, not a crash.

edit

Edits by primary key

Insert, update and delete by the table's real PK — bound parameters only, no injection.

export

CSV / JSON export

Export a table or query result to CSV or JSON in a line.

The real tool

A CLI and a REPL

The browser demo above is read-only. The actual TablePro is a Python program — a set of argparse subcommands plus a cmd-based REPL over the tablepro.db.Database class. A real session:

$ python -m tablepro.seed          # build the sample database
$ python -m tablepro sample.db schema books
TABLE books
┌───────────┬─────────┬────────────────────┐
│ column    │ type    │ constraints        │
├───────────┼─────────┼────────────────────┤
│ id        │ INTEGER │ PK                 │
│ title     │ TEXT    │ NOT NULL           │
│ price     │ REAL    │ NOT NULL DEFAULT 0 │
└───────────┴─────────┴────────────────────┘
foreign keys:
  author_id → authors.id

$ python -m tablepro sample.db insert authors name="N. K. Jemisin" born=1972
inserted row, id=6
$ python -m tablepro sample.db update authors 6 country="United States"
updated 1 row(s)
$ python -m tablepro sample.db delete authors 6 --yes
deleted 1 row(s)

Architecture

Discover, then present

Every database opened follows the same flow:

  1. Connect

    Open the SQLite file; optionally read-only.

  2. Introspect

    Query sqlite_master and PRAGMAs for tables, columns, keys and indexes.

  3. Render

    Show the schema and page any table as a box-drawn grid.

  4. Edit

    Translate edits into parameterised SQL keyed on the real primary key.

  5. Query / export

    Run ad-hoc SQL, and export tables or results to CSV / JSON.