briqbriq
Dashboard

cookbook / postgres

PostgreSQL

A PostgreSQL database with a persistent volume. Optional pgvector.

Run it

briq_run({
  recipe: "postgres",
  params: {
    "version": "16",
    "extensions": [],
    "size": "small"
  },
  wait: true
})

Parameters

NameTypeOptionsDefault
versionenum15, 16, 17"16"
extensionsenum[]pgvector[]
sizeenumnano, small, medium, large"small"

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:165432small10 GB at /var/lib/postgresql/data

When to use it

  • Your migrations, seeds or ORM schema need a real database to be verified against.
  • An integration test suite expects DATABASE_URL and you do not want mocks or Docker on the machine running it.
  • The agent needs vector search: pass extensions: ["pgvector"] and it gets the pgvector/pgvector image for the chosen major version.
  • You want a scratch database that disappears on its own. The default TTL is 60 minutes.

Pick size: "nano" for schema checks and small fixtures, small (the default) for anything with real data. The volume is 10 GB and mounted at /var/lib/postgresql/data, so a stopped briq keeps its data.

Tips

  • Wait for the healthcheck. wait: true returns only after pg_isready succeeds; without it the first connection may hit a server that is still initialising.
  • Use the outputs, not the internals. DATABASE_URL and the PG* variables are generated per run. The password is a write-only secret and is masked everywhere except in the run output.
  • Seed with a file. briq_files_put a dump to /seed.sql, then briq_exec with psql -U postgres -d app -f /seed.sql.
  • Stop instead of destroy while iterating: storage-only billing, and briq_start brings the data back. Destroy at the end of the session.
  • Reach it from another briq in the same stack at db.<stack>.internal:5432. Postgres is not exposed publicly; briq_expose is for HTTP services.
  • Major versions 15, 16 and 17 are supported. Extensions are limited to pgvector today; ask for more in the cookbook issues.