---
id: w1/m17/t004
title: Dashboard — Recovery tab + lifecycle actions + access-control on the database detail
worker: worker1
status: done
estimate: 45m
depends_on: [w1/m17/t001, w1/m17/t002, w1/m17/t003]
---

## Objective

Surface the new managed-Postgres capabilities on the database detail page: a **Recovery** section (PITR restore-to-new + backup list, from t001), **lifecycle** action buttons (suspend / resume / restart, from t002), and an **access-control** panel (IP allowlist edit, pooler connection strings, Postgres users, from t003). Wire each to the GraphQL surface those tasks added.

## Context

- Dashboard databases feature: `dashboard/src/features/databases`; it's an Apollo client of bex-api's GraphQL (`dashboard/CLAUDE.md`). The database detail page + connection-info panel already exist (from the base `postgres` feature).
- GraphQL queries/mutations backing this come from t001 (recovery-info/recover/exports), t002 (suspend/resume/restart), t003 (ipAllowList, pooler strings in connection-info, users CRUD).
- Follow the existing service/app detail-page patterns (lifecycle buttons, tabbed sections) for consistency with the compute UI.

## Steps

1. Add a Recovery section: show earliest/latest recoverable time + backups, and a "Restore to new instance" action (point-in-time picker) that calls the `recover` mutation; list exports.
2. Add lifecycle action buttons (suspend / resume / restart) reflecting the DB's suspended/lifecycle status, calling the t002 mutations with optimistic UI + refetch.
3. Add an access-control panel: editable IP allowlist, the pooler connection strings alongside the existing internal/external strings, and a Postgres users list with create/delete.
4. Run the dashboard tests / typecheck; keep the design consistent with the compute service detail page.

## Files

- `dashboard/src/features/databases/` (detail page + new Recovery / lifecycle / access-control components)
- dashboard GraphQL operations/fragments for the databases feature

## Acceptance criteria

- [ ] The database detail page shows a Recovery section with backups + a working restore-to-new-instance flow.
- [ ] Suspend / resume / restart buttons drive the DB lifecycle and reflect its state.
- [ ] The access-control panel edits the IP allowlist, shows pooler connection strings, and manages Postgres users.
- [ ] Dashboard tests / typecheck green.

## Out of scope

- New GraphQL verbs (those ship in t001–t003; this task only consumes them).
- HA / replica UI (deferred to `w1/013`).
