127.0.0.1:1993
zetta on Postgres: a filtered and sorted table, with the inspector following a foreign key
  • 1.4MB

    To download, under 3 MB unpacked

  • 0deps

    Beyond libc, nothing is linked

  • 2engines

    Postgres and SQLite, both native

  • 5builds

    For macOS, Linux and Windows

Try it right here, with nothing to install.

The live demo is zetta itself, compiled to WebAssembly and running in this browser tab against a sample shop database. Nothing you do leaves the page.

  • 1,200 customers
  • 4,000 orders
  • 9,000 order items
  • 180 products
  • Read-only
Open the live demo

A one-time download of about 2.6 MB.

How it runs

  1. This browser tabThe same UI the zetta binary serves
  2. A service workerCatches the UI's /api/ calls before they reach the network
  3. zetta.wasmzetta's own handlers and SQLite, compiled to WebAssembly
  4. demo.dbA sample shop, held in memory

Add it to your docker-compose.yml.

Your dev database already runs in Compose. Put zetta beside it and every developer on the project gets a database UI with docker compose up.

  • Waits for your databaseIt keeps trying for 30 seconds while the database starts, so it needs no health check.
  • A 1.5 MB imageA static binary on scratch for amd64 and arm64, pulled in a moment.
  • Safe on a shared databaseSet ZETTA_READ_ONLY and the adapter refuses every write.
docker-compose.yml
services:
  db:
    image: postgres:17
    environment:
      POSTGRES_PASSWORD: postgres

  zetta:
    image: workflowjd/zetta
    ports: ["127.0.0.1:1993:1993"]
    environment:
      ZETTA_TOKEN: ${ZETTA_TOKEN}
      DATABASE_URL: postgres://postgres:postgres@db:5432/postgres
    depends_on: [db]

Put a token from openssl rand -hex 16 in .env as ZETTA_TOKEN, then open the link docker compose logs zetta prints.

The whole database, one tab away.

Every schema, table, view and function, a grid that pages through any table, and a SQL editor that knows your columns. It opens in the browser you already have.

Browse

Filter and sort without writing SQL.

Build them from the column list, or type your own WHERE and ORDER BY. The grid pages through tables of any size.

Inspect

Read any row, follow any key.

JSON pretty-printed, foreign keys one keystroke away, and each table's structure, indexes, triggers, DDL and relationships.

Query

An editor that knows your schema.

Highlighting and completion. Run the statement at the caret, the selection or the whole script. It asks before anything that destroys data.

Share

Every view lives in the URL.

Send a link and the other person lands on the same table, filter and row. Copy cells and rows as CSV, TSV, JSON or Markdown, or save them as a file.

Keyboard

Keyboard first.

  • /search tables
  • Ctrl↵run at the caret
  • ↑↓←→move between cells
  • Oopen a foreign key
  • Escclose the inspector

Postgres or SQLite, the same interface.

zetta on SQLite: a query in the SQL editor, its results, and a JSON value formatted in the inspector
zetta on Postgres: a filtered and sorted table, with the inspector following a foreign key
A query in the SQL editor, its results, and a JSON value formatted in the inspector.Schemas, views and functions, a filtered and sorted table, and a foreign key followed.

Or script it from the shell.

zetta query prints a table, CSV or JSON. Results go to stdout and diagnostics to stderr, so it pipes cleanly. Every flag has an environment variable, and DATABASE_URL keeps a password out of the process list.

  • zetta ./app.dbBrowse a SQLite file
  • zetta postgres://me@localhost/app --read-onlyBrowse Postgres without writes
  • zetta query app.db -f csv < report.sql > report.csvScript a report
  • zetta tables app.dbList schemas and tables
  • zetta completion fishCompletions for bash, zsh and fish

~/shop❯zetta query shop.db "select name, city, round(balance, 2) as balance from customers order by balance desc limit 4"

       name        |    city     | balance
-------------------+-------------+---------
 Sara Tesfaye 1081 | Adama       | 1265.67
 Abebe Kebede 135  | Hawassa     |  1265.0
 Abebe Kebede 270  | Addis Ababa | 1263.33
 Abebe Kebede 405  | Hawassa     | 1261.67
(4 rows)

Local by default.

An explorer holds the keys to your data, so zetta treats the browser tab as a guest rather than a trusted client.

  1. Loopback and a fresh token

    serve listens on 127.0.0.1 with a new one-time token each run. A non-loopback host is refused unless you pass both --token and --allow-plain-http.

  2. Hosts and origins checked

    A Host that is not an IP, localhost or on your --allowed-hosts list is refused, and so is any API call from another origin. The page's CSP allows inline code only by hash.

  3. Read-only where it counts

    --read-only is enforced inside the database adapter, not the UI. SQLite opens the file read-only; Postgres runs each statement in a read-only transaction and refuses DO and CALL.

  4. Secrets stay secret

    Tokens, cookies and passwords never reach a log, and the password in any DSN is redacted before it is printed.

Written in Zig, from the wire protocol up.

zetta speaks the Postgres wire protocol itself, with TLS from the Zig standard library, and compiles the official SQLite amalgamation in. The binary links libc and nothing else.

zettaone static binary
Web UISolid, built into one page and embedded in the binary
HTTP serverHost and origin guard, hashed CSP, one token per run
CLIOne comptime spec makes the parser, help and completions
PostgresNative wire protocol, TLS from std.crypto.tls
SQLiteOfficial amalgamation, compiled in
links: libc

Postgres support

  • SCRAM-SHA-256
  • MD5
  • cleartext
  • trust
  • sslmode disable to verify-full
  • sslrootcert
  • system trust store
  • TCP
  • IPv6
  • Unix sockets
  • PG* variables
  • ~/.pgpass
  • libpq URLs and keyword strings

Install it in one line.

curl -fsSL https://raw.githubusercontent.com/dagimg-dot/zetta/main/install.sh | sh

Picks the build for your system, checks it against the release's SHA256SUMS and installs to /usr/local/bin, or ~/.local/bin when that is not writable. Set ZETTA_VERSION to pin a release.

Prebuilt for
  • macOS · Apple Silicon
  • Linux · x86_64
  • Linux · arm64
  • Windows · x64
  • Windows · arm64
All releases

Questions, answered.

Anything else, ask in the issue tracker.

What is zetta?

zetta is a free, open-source database explorer for Postgres and SQLite. It is one binary under 3 MB that serves its UI to the browser you already have, so you can browse schemas, filter tables, follow foreign keys and run SQL. The same binary also runs queries from the shell.

Which databases does zetta support?

Postgres and SQLite. zetta speaks the Postgres wire protocol itself, with SCRAM-SHA-256, MD5 and every sslmode, and compiles the official SQLite amalgamation in. A database is a postgres:// URL, a libpq keyword string or a path to a SQLite file.

Do I need libpq, OpenSSL or a database client installed?

No. The binary links libc and nothing else. Its Postgres client and TLS are written in Zig, SQLite is compiled in, and the web UI is embedded. There are prebuilt binaries for macOS, Linux and Windows, and a 1.5 MB Docker image.

Is it safe to point zetta at a real database?

zetta listens on 127.0.0.1 with a new one-time token each run, and refuses other hosts and origins. With --read-only it refuses writes inside the database adapter, not just in the UI, and passwords never reach a log. For a hard guarantee on Postgres, connect as a read-only role.

How is zetta different from a desktop database client?

There is nothing to install beyond one small binary or one docker run, and every view lives in the URL, so a link opens the same table, filter and row for someone else. It also fits in a docker-compose.yml beside the database your project already runs.

Can I use zetta from scripts and CI?

Yes. zetta query prints a table, CSV or JSON to stdout with diagnostics on stderr, and zetta tables lists schemas and tables. Every flag has an environment variable, and DATABASE_URL keeps a password out of the process list.

Is zetta free?

Yes. zetta is open source under the MIT license, and the live demo on this site runs it in your browser with nothing to install.

Open your database.
Nothing else to install.

Try it in this tab first, then install it in one line. Free and open source under MIT.

Try the live demo