PostgreSQL

Store and query relational data in a persistent PostgreSQL database.

  • database
  • sql

Guides: Give Claude Code a database, Run tests against real services, Connect to a database from outside

Run it

briq run postgres

Fields

NameTypeOptionsDefault
imagestring—"postgres:16"
envrecord{ key: string | { secret, value?, literal?, scope?, hosts?, locations? } }{}
cmdstring | string[]——
sizeenumpico, micro, nano, small, medium, large, xlarge"small"
volumeobject{ gb? }{"gb":2}
filesrecord{ key: string | { base64 } }—
egressobject{ hosts }—

Outputs

Returned by briq_run once the stack is healthy. Hosts resolve inside your team network; secrets are generated per run.

DATABASE_URL
postgres://postgres:<POSTGRES_PASSWORD>@db.<stack>.internal:5432/app
PGHOST
db.<stack>.internal
PGPORT
5432
PGUSER
postgres
PGPASSWORD
<POSTGRES_PASSWORD>
PGDATABASE
app

What it runs

BriqImagePortsSizeVolume
dbpostgres:165432small2 GB at /var/lib/postgresql/data

When to use it

  • Migrations, seeds or an ORM schema need a real database to be checked against.
  • An integration suite expects DATABASE_URL and you want neither mocks nor Docker.
  • Vector search, such as an agent's memory recalled by meaning: image: "pgvector/pgvector:pg16", the image with pgvector. Another version is another tag: image: "postgres:17".

Tips

  • Run SQL inside the briq. DATABASE_URL is private: briq_files_put a file, then briq_exec with psql -U postgres -d app -v ON_ERROR_STOP=1 -f /file.sql.
  • nano is enough for schema checks and small fixtures.
  • Data survives stops, so keep the briq while iterating and destroy it at the end.
  • From another briq, use DATABASE_URL as is.
  • Connect from outside: briq_expose port 5432 with protocol: "postgres" gives a connection string over TLS, for psql or a BI tool. See Connect to a database from outside.
  • No TLS inside the stack: the connection stays on the stack's private network. An app set up to require SSL (sslmode=require, or settings written for a hosting platform, such as ssl_require=True in Django) refuses to connect: turn that requirement off in the app's settings.
  • Need a bigger database? The volume starts small: set volume: { gb: 20 }. Set it when the briq is created, and it counts toward your plan's disk.

On this page

Free to try

Try briq, on us.

Every new account starts with €10 of credits. No card.

Start building

How can we help?

Message to the briq team