Skip to content
Pocket Homelab
Get the appComing soon to the App Store

Pocket Database

v0.1.2 · Self-hosted · MIT

Every database on your server, in one calm place.

Pocket Database finds the PostgreSQL, MySQL, MariaDB, Redis and SQLite databases your apps use and lets you browse tables, search rows and run SQL. Everything starts read-only, every change is one transaction and logged, and it tells you when a database goes down.

  • Included in Pocket Box
  • Sign in with Pocket Core
  • Works with PostgreSQL and MySQL and MariaDB and SQLite and Redis
The customers table of a demo shop database on an iPhone, with search, filter and a new row buttonThe customers table of a demo shop database on an iPhone, with search, filter and a new row button

SQL

Write a query, see the answer.

An editor with your tables at hand, results in a grid you can copy or download as CSV or JSON, and saved queries and history. Ask for a query in plain words, or ask what one does.

A SQL query counting a shop's orders and revenue per month, with twelve months in the results gridA SQL query counting a shop's orders and revenue per month, with twelve months in the results grid

Tables

Browse, filter and search rows.

Databases, schemas, tables and views in a tree with their row counts. Page through rows, search every column, filter, and export the table as CSV or JSON.

  • PostgreSQL, MySQL and MariaDB, SQLite, Redis and Valkey
  • A key browser and a console for Redis
  • Each person has their own connections and saved queries
The orders table of a demo shop: 2,066 rows with status, total, note and date, and the other tables on the leftThe orders table of a demo shop: 2,066 rows with status, total, note and date, and the other tables on the left

Structure

How a table is built.

Columns with their types, whether they may be empty and their defaults, the indexes, and the links to and from other tables. The DDL is one click away.

  • Keys and auto-increment columns marked
  • Links to other tables in both directions
  • Explain a query or fix one that failed with AI
The structure of an orders table: six columns, two indexes and its links to customers and order itemsThe structure of an orders table: six columns, two indexes and its links to customers and order items

Safe changes

Edit a row without the fear.

New connections are read-only. Turn changes on and you can edit a row on your phone, add or delete one, with deletes asking first and every change in the log.

  • Everything run together is one transaction
  • A SQLite file an app uses is changed only while that app is paused
  • A snapshot first, so a change can be undone
Editing a customer row on an iPhone: name, email, city, country and date fields with Save and DeleteEditing a customer row on an iPhone: name, email, city, country and date fields with Save and Delete

And the rest of it

  • Finds what you run

    Lists every database container with the credentials from its own settings and every SQLite file in the folders containers mount, ready to add in one go.

  • Watching

    Connections are checked every five minutes, with a push when one goes down and when it is back, and a size chart per database.

  • AI that helps, never acts

    Describe a query, ask what one does, or fix one that failed. It sees your tables' names, never their rows.

  • Sealed passwords

    Passwords are sealed with a key that never leaves the server, and only admins may open files and containers on it.

Install

Next to the databases it reads.

Host networking reaches database containers on their own networks, and the Docker socket finds them and pauses apps for safe changes. Without the socket it is a plain database client: add connections by hand or upload a SQLite file.

On a Pocket Box it is already installed.

Every setting in the README →

docker run -d --name pocket-database --network host \
  --group-add $(getent group docker | cut -d: -f3) \
  -v ./data:/data -v /var/run/docker.sock:/var/run/docker.sock \
  -v /srv:/srv -e BASE_URL=https://database.example.com \
  -e SECURE_COOKIES=true \
  ghcr.io/abjelosevic88/pocket-homelab-database:latest