psql straight into a Cloudflare Durable Object
// momentum
// why it's here
- Active: last commit today
- Built almost entirely by one person
// how to help
// readme
Duragres
Connect any PostgreSQL client to a Cloudflare Durable Object. The database name in the connection string picks the object, and connecting to a new name creates it. Each database runs PostgreSQL 19, compiled to WebAssembly by PGlite, inside its object. Postgresβs data directory is stored in the objectβs SQLite storage.
Claim a database
A new database is deleted 72 hours after it is created, unless you claim it. To claim it, give a role a password:
ALTER ROLE demo PASSWORD 'correct horse battery staple';
From then on, every connection to that database authenticates with SCRAM-SHA-256 against pg_catalog.pg_authid (roles with NOLOGIN, an expired VALID UNTIL, or a non-SCRAM password cannot sign in). Before a database is claimed, anyone who knows its name can connect.
Roles authenticate who can connect to a database, but they are not a security boundary inside it: every connection shares one Postgres backend and session state.
Branch a database
Connected to a database, copy it into a new one and drop the copy when youβre done: