Postgres
Every chart and table on this page reads from a live Postgres database. data.py
attaches it as the catalog pg, and each query below runs in your browser against
that connection, over the real pg.public.users and pg.public.orders, with no
export step and no local copy.
At a glance
Breakdowns
orders_by_status and users_by_country are SQL views defined in data.py with
@pg.view(). They evaluate in your browser against the attached tables; nothing is
copied into a local database.
Editable orders
data.py exposes public.orders as "readwrite". Edit a cell or add a row and
the change writes back to Postgres over the same connection: the UPDATE or
INSERT runs against the real table, not a local copy.
| Connecting… |
Read-only users
public.users is exposed as "read", so this grid browses but never writes.
| Connecting… |
Row-level security
Signed in, you see only your own orders, and that's enforced on the server, never
in the browser. login records who you are on the session, and my_orders() takes
no user id at all. It scopes every read to the identity login already set, so no
SQL you type in the browser can widen your view to another user's orders.
Log in below. The toggle calls login, and the same my_orders() returns only
that user's rows, nobody's while you're logged out.