Review

Review, approve, and reject session changes.

View diff

View all staged changes grouped by table.

terminal
GET /sessions/sess_abc123/diff

# Response
{
  "session_id": "sess_abc123",
  "tables": {
    "users": {
      "inserts": 0,
      "updates": 1,
      "deletes": 0,
      "changes": [
        {
          "type": "UPDATE",
          "before": {"id": 5, "role": "user"},
          "after": {"id": 5, "role": "admin"}
        }
      ]
    }
  }
}

Mutation log

Chronological list of all mutations in the session.

terminal
GET /sessions/sess_abc123/mutations

# Response
{
  "session_id": "sess_abc123",
  "mutations": [
    {
      "id": "mut_001",
      "type": "UPDATE",
      "table": "users",
      "query": "UPDATE users SET role = $1 WHERE id = $2",
      "params": ["admin", 5],
      "affected_rows": 1,
      "executed_at": "2024-01-15T10:31:00Z"
    },
    {
      "id": "mut_002",
      "type": "DELETE",
      "table": "sessions",
      "query": "DELETE FROM sessions WHERE user_id = $1",
      "params": [5],
      "affected_rows": 3,
      "executed_at": "2024-01-15T10:31:05Z"
    }
  ]
}

Propose for review

Submit a session for review. The session becomes read-only.

terminal
POST /sessions/sess_abc123/propose

# Response
{
  "id": "sess_abc123",
  "status": "proposed",
  "mutation_count": 2
}

Approve session

terminal
POST /sessions/sess_abc123/approve

# Response
{
  "id": "sess_abc123",
  "status": "approved",
  "applied_at": "2024-01-15T10:35:00Z"
}

On success, all staged mutations are applied to production.

Reject session

terminal
POST /sessions/sess_abc123/reject

# Response
{
  "id": "sess_abc123",
  "status": "rejected"
}

All staged changes are discarded. No changes are made to production.