No-bullshit database browser for schemaful databases; self-contained, embeddable, read-only. No separate DB client, no extra credentials, no extra infrastructure, no build step.
showcase.mp4
The library is named after Ashurbanipal Library.
Try it live: PGlite in your browser or the mobile-friendly light demo (synthetic data, no backend).
Most engineers just want to browse their database. Having such functionality in a corporate environment currently means:
- Did you request AWS access? Wait for approval.
- Approved? Now add your username and SSH key to a repo nobody's heard of, and wait for that owner to approve you too.
- Follow a Confluence page to wire up AWS + SSH + your pick of DBeaver/pgcli/psql/pgAdmin/TablePlus.
- ssh timed out, oh too bad, you should use
moshinstead
- ssh timed out, oh too bad, you should use
- Get your session killed by fucking Okta re-auth every 4 hours. Repeat.
- blindly accept the MFA prompt, or else your session dies and you have to start over
- The bastion host is being patched, so none of the above even works.
- "You don't need to have db access, you just need to slice your stories thinly enough so you can test your code without needing db access" a wise engineer in an unwise org.
- Can't deploy a sidecar container to run a db client, because...you get the point.
all I need is to just see a row in the db, so I can complete my feature story.
Ashurbanipal skips the whole chain by not needing a new connection: it runs inside the process that already has one. If your service can query its own database, then you can look at a table from your browser.
- Browse tables: paginated rows, click-to-sort columns, primary/foreign-key and column-comment hints.
- Filter rows with a subset of SQL
WHEREsyntax (no subqueries, no CTEs, no DML). - Join up to four tables with
INNERorLEFTequality joins, built in a form or typed as restricted SQL text; the result is read-only and paged without a total. - Works with Postgres, MySQL/MariaDB, and SQLite (supported versions).
- Register more than one database, even of different types, and switch between them; browse across schemas where the engine has them.
- Link sibling instances and see which are reachable.
- Ships as one static file compiled into your binary; nothing extra to host or deploy.
- No write access, no migrations, no schema changes.
- At the moment, this is not a replacement for a full-featured DB client like DBeaver, pgcli, however I do plan to support some of that functionality in the future
Ashurbanipal ships no authentication or authorization. Access is a perimeter concern: run the host service behind your corporate VPN, reachable by you and your team but not the outside world. If you want a login or per-user rules, add that in front of the mounted router.
Three things back that up:
- Host check (recommended): list the names the viewer is reached at in
allowed_hosts. A request with any otherHostgets a 404, so a web page can't read the viewer through DNS rebinding (spec/protocol.md§3.1). Without the list, the viewer logs a warning at startup. - Fail-safe default: the
enabledflag defaults to off. Ashurbanipal has no concept of "environment"; where to turn it on is the host's call. - Read-only by construction:
SELECTonly, no DDL or DML. On Postgres and MySQL/MariaDB every query that reads a table or the catalog also runs in a read-only transaction, so the database refuses a write even if one slips through.
For a second wall, give Ashurbanipal its own pool that logs in with a SELECT-only account, and pass that pool as its source instead of the app's (Spring: dataSourceBean). This is recommended, not required.
-- Postgres
create role viewer login password '…';
grant usage on schema public to viewer;
grant select on all tables in schema public to viewer;
-- Default privileges cover only tables the named role creates: name the role
-- your migrations run as.
alter default privileges for role app_owner in schema public grant select on tables to viewer;
-- MySQL / MariaDB
CREATE USER 'viewer'@'%' IDENTIFIED BY '…';
GRANT SELECT ON app.* TO 'viewer'@'%';SQLite has no accounts: where the driver allows, open the viewer's connection read-only with a file: URI ending in ?mode=ro. SQLite reads that option only when the driver turns URI filenames on. On MariaDB a SELECT-only account sees no constraints in Structure (docs/adapter-decisions.md, §5.10).
| Database | Supported versions |
|---|---|
| Postgres | 15 and later |
| MySQL | 8.4 and later |
| MariaDB | 10.11 and later |
| SQLite | 3.16 and later |
Rust / Axum
// cargo add ashurbanipal-axum
use ashurbanipal_axum::{Config, PgPoolSource};
app.merge(ashurbanipal_axum::router(config, vec![("primary".to_string(), PgPoolSource::new(pool))]));Rust / Actix-web
// cargo add ashurbanipal-actix-web
use ashurbanipal_actix_web::{app_state, service, Config, PgPoolSource};
App::new().service(service(app_state(config, vec![("primary".to_string(), PgPoolSource::new(pool))])));Spring Boot
# implementation("io.github.mt-empty:ashurbanipal-spring-boot-starter:0.15.0")
ashurbanipal:
enabled: true # Postgres is the default backendGo / net-http
// go get github.com/mt-empty/ashurbanipal/implementations/go-nethttp@latest
source := ashurbanipal.NewPostgresSource(db, timeoutSecs)
viewer := ashurbanipal.Router(cfg, []ashurbanipal.NamedSource{{Name: "primary", Source: source}})Node / Express
// pnpm install ashurbanipal-node-express
import { createRouter, PostgresSource } from "ashurbanipal-node-express";
const viewer = createRouter(config, [{ name: "primary", source: new PostgresSource(pool) }]);Python / Flask
# uv add 'ashurbanipal-flask[postgres]'
from ashurbanipal.db.postgres import PgSource
app.register_blueprint(router(config, [("primary", PgSource(dsn=os.environ["DATABASE_URL"]))]))Rust / Axum
// cargo add ashurbanipal-axum --features mysql
use ashurbanipal_axum::{Config, MySqlSource};
app.merge(ashurbanipal_axum::router(config, vec![("primary".to_string(), MySqlSource::new(pool))]));Rust / Actix-web
// cargo add ashurbanipal-actix-web --features mysql
use ashurbanipal_actix_web::{app_state, service, Config, MySqlSource};
App::new().service(service(app_state(config, vec![("primary".to_string(), MySqlSource::new(pool))])));Spring Boot
# implementation("io.github.mt-empty:ashurbanipal-spring-boot-starter:0.15.0")
ashurbanipal:
enabled: true
sources:
- name: primary
backend: mysql # covers MariaDB tooGo / net-http
// go get github.com/mt-empty/ashurbanipal/implementations/go-nethttp@latest
// go build -tags mysql
source := ashurbanipal.NewMySQLSource(db, timeoutSecs)
viewer := ashurbanipal.Router(cfg, []ashurbanipal.NamedSource{{Name: "primary", Source: source}})Node / Express
// pnpm install ashurbanipal-node-express mysql2
import { createRouter } from "ashurbanipal-node-express";
import { MySqlSource } from "ashurbanipal-node-express/dist/src/db/mysql.js";
const viewer = createRouter(config, [{ name: "primary", source: new MySqlSource(pool) }]);Python / Flask
# uv add 'ashurbanipal-flask[mysql]'
from ashurbanipal.db.mysql import MySqlSource, connect_kwargs_from_url
app.register_blueprint(router(config, [("primary", MySqlSource(**connect_kwargs_from_url(os.environ["MYSQL_URL"])))]))Rust / Axum
// cargo add ashurbanipal-axum --features sqlite
use ashurbanipal_axum::{Config, SqliteSource};
app.merge(ashurbanipal_axum::router(config, vec![("primary".to_string(), SqliteSource::new(pool))]));Rust / Actix-web
// cargo add ashurbanipal-actix-web --features sqlite
use ashurbanipal_actix_web::{app_state, service, Config, SqliteSource};
App::new().service(service(app_state(config, vec![("primary".to_string(), SqliteSource::new(pool))])));Spring Boot
# implementation("io.github.mt-empty:ashurbanipal-spring-boot-starter:0.15.0")
ashurbanipal:
enabled: true
sources:
- name: primary
backend: sqliteGo / net-http
// go get github.com/mt-empty/ashurbanipal/implementations/go-nethttp@latest
// go build -tags sqlite
source := ashurbanipal.NewSQLiteSource(db, timeoutSecs)
viewer := ashurbanipal.Router(cfg, []ashurbanipal.NamedSource{{Name: "primary", Source: source}})Node / Express
// pnpm install ashurbanipal-node-express sqlite3
import { createRouter } from "ashurbanipal-node-express";
import { SqliteSource } from "ashurbanipal-node-express/dist/src/db/sqlite.js";
const viewer = createRouter(config, [{ name: "primary", source: new SqliteSource(new Database("app.db")) }]);Python / Flask
# uv add ashurbanipal-flask
from ashurbanipal.db.sqlite import SqliteSource
app.register_blueprint(router(config, [("primary", SqliteSource(path="./demo.db"))]))Once mounted, the viewer is served under /__ashurbanipal (the default mount path; it's implementation-defined but never /, see spec/protocol.md §3). It answers only its own page and API routes, so your routes beside or under the mount keep working.
| Option | Default | Purpose |
|---|---|---|
enabled |
false |
Master on/off. Absent or malformed config means off. |
limits.default_page_size |
50 |
Rows per page when the request doesn't specify. |
limits.max_page_size |
100 |
Hard, server-enforced page-size cap. |
limits.query_timeout_secs |
5 |
Per-query timeout. |
siblings |
none | Other instances to show reachability for; each has name, base_url, health_path, and an optional label, typically an environment (dev, int) or a region (eu, us). Use one shared list, in the same order, on every instance, so the grid looks the same everywhere. A mistake (two siblings with the same name and label, an empty label, an incomplete instance) never breaks anything: every entry is still shown, and Other services lists a warning for each. |
allowed_hosts |
none (no check) | Names the viewer is reached at, each name or name:port (IPv6 in brackets: [::1]:4000). An entry without a port matches any port. A request with any other Host gets a 404; X-Forwarded-Host is never read, so behind a proxy that rewrites Host, list the name the app receives. A sibling opened from the grid is reached under its base_url's name, so that sibling's list must include it. |
instance |
none | This instance's own name and label, so the UI can mark it and link the same view elsewhere (spec/protocol.md §5.6). |
| Implementation | Package | Conformance CI |
|---|---|---|
rust/axum |
ashurbanipal-axum · crates.io |
|
rust/actix-web |
ashurbanipal-actix-web · crates.io |
|
spring-boot-starter |
io.github.mt-empty:ashurbanipal-spring-boot-starter · Maven Central |
|
go-nethttp |
github.com/mt-empty/ashurbanipal/implementations/go-nethttp · Go modules |
|
node-express |
ashurbanipal-node-express · npm |
|
flask-python |
ashurbanipal-flask · PyPI |
spec/protocol.md: the normative endpoint contract every port implements.spec/filter-dsl.md: the filter grammar and its test table.PORTING.md: how to add or review a language port.