---
raw: true
search:
  tags:
    - Database
    - GET
seo:
  description: >-
    Returns the declared tables and pending migration plan of the live
    version's… Reference for the GET /v1/spaces/{spaceId}/db endpoint in the
    Spacefast API.
sidebar:
  label: Inspect a space's database
  badge: GET
title: Inspect a space's database
type: openapi-operation
---
Returns the declared tables and pending migration plan of the live version's database. This route is Zero-kind only because workers do not declare a table set. Use `db console` to read a worker's database directly. Returns `db_not_available` when the live version has no database. Returns `runtime_kind_mismatch` when the live version is a worker.

`GET /v1/spaces/{spaceId}/db`

**Responses**

- `200` — Response for status 200
- `default` — Problem details (RFC 9457). Any 4xx/5xx response is one \`application/problem+json\` document.

Response example, 200:

```json
{
  "$schema": "http://example.com",
  "data": {
    "versionId": "string",
    "artifactId": "string",
    "backend": "mysql",
    "migrationMode": "safe",
    "schemaHash": "string",
    "tables": [],
    "migrations": [],
    "plan": {
      "applied": true,
      "appliedSchemaHash": "string",
      "pendingOperationCount": 0
    }
  }
}
```
