PostgreSQL
A PostgreSQL database with a persistent volume. Optional pgvector.
- database
- sql
Guides: Give Claude Code a database, Run tests against real services, Connect to a database from outside
Run it
briq_run({
recipe: "postgres",
params: {
"version": "16",
"extensions": [],
"size": "small",
"diskGb": 2
},
wait: true
})curl -X POST https://api.briq.cloud/v1/briqs \
-H "Authorization: Bearer $BRIQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"recipe": "postgres",
"params": {
"version": "16",
"extensions": [],
"size": "small",
"diskGb": 2
},
"wait": true
}'
# → { "briqs": [{ "id": "bq_…", … }], "outputs": { "DATABASE_URL": "…" }, … }
# ... when done, for each briq id
curl -X DELETE https://api.briq.cloud/v1/briqs/<id> \
-H "Authorization: Bearer $BRIQ_API_KEY"Parameters
| Name | Type | Options | Default |
|---|---|---|---|
| version | enum | 15, 16, 17 | "16" |
| extensions | enum[] | pgvector | [] |
| size | enum | nano, small, medium, large | "small" |
| diskGb | number | — | 2 |
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
| Briq | Image | Ports | Size | Volume |
|---|---|---|---|---|
| db | postgres:16 | 5432 | small | 2 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_URLand you want neither mocks nor Docker. - Vector search:
extensions: ["pgvector"]switches to thepgvector/pgvectorimage.
Tips
- Run SQL inside the briq.
DATABASE_URLis private:briq_files_puta file, thenbriq_execwithpsql -U postgres -d app -v ON_ERROR_STOP=1 -f /file.sql. nanois 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_URLas is. - Connect from outside:
briq_exposeport 5432 withprotocol: "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 asssl_require=Truein Django) refuses to connect: turn that requirement off in the app's settings. - Need a bigger database? The volume starts small: pass
diskGb, e.g.params: { diskGb: 20 }. Set it when the briq is created, and it counts toward your plan's disk.