aquameta.

The mental model

Five ideas.

Aquameta has one radical premise — everything is a row in PostgreSQL. From it, a small set of ideas explains the whole system.

01

Three shapes

Know the shape, know the API.

All data has one of three shapes. rows — zero or more records; may be empty. row — exactly one; it errors if it finds none or many. field — a single column value, returned raw with its own content type.

This taxonomy is consistent across every layer — the HTTP URL, the JavaScript data client, and the attributes that bind data to the interface:

-- the same three shapes, in every URL /api/data/{schema}/{relation}/rows /api/data/{schema}/{relation}/row/{pk}/{value} /api/data/{schema}/{relation}/field/{pk}/{value}/{column}
02

Three operations

Everything that ever happens to data.

Only three things occur: a row is created, a row is deleted, a field is modified. That’s the entire surface.

Because the catalog itself is exposed as writable data, this covers schema changes too — inserting a row into meta creates a table; deleting one drops it. So version control only has to track these three operations, and nothing else. No special handling for DDL, for code, for configuration. It is all just rows and fields.

03

Two version controls

One for the platform, one for what lives inside it.

Git tracks the SQL source files that define the platform on disk. Bundle is a git for database rows — it versions the content that lives inside PostgreSQL: your interface, your endpoints, your data, your schema.

They are separate systems with separate commits, and keeping them straight is the thing that most surprises newcomers. Git is infrastructure; bundle is content. Both are first-class, and both travel with the project.

04

One plane

Closure, not layers.

This is not an application sitting on a framework sitting on a runtime. It is a single plane. The schema is rows. The code is rows. The interface is rows. The version control is rows. The editor is rows.

There is no outside vantage point. The system is always looking at itself — and can rewrite itself in the same language it is written in.

05

It runs on itself

The tools live in the database they operate on.

The consequences are concrete. The HTTP layer is SQL functions that turn a request into a query. The filesystem mounts database tables as editable files. The development environment edits the database it runs inside.

Each tool can immediately see — and change — itself. The reference documentation is the clearest example: it is generated by querying the catalog, then served by the very HTTP layer it documents.