> ## Documentation Index
> Fetch the complete documentation index at: https://rexrex.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Database

> Inspect local Reth MDBX tables, schema compatibility, and static-file storage without writing data.

The database commands inspect a chain-specific Reth data directory directly. They do not use JSON-RPC.

Reth stores data across two storage areas:

* `db/`: the MDBX database, including state, history indexes, stage checkpoints, and metadata tables
* `static_files/`: append-only historical segments such as headers, transactions, and receipts

Rex reports these areas separately so an empty or small MDBX history table is not mistaken for missing history that Reth has moved into static files.

<CardGroup cols={3}>
  <Card title="Info" icon="info" href="/docs/db/info">
    Summarize the MDBX file, tables, freelist, and static-file store.
  </Card>

  <Card title="Tables" icon="table-properties" href="/docs/db/tables">
    Show entry and page statistics for every registered Reth table.
  </Card>

  <Card title="Version" icon="badge-check" href="/docs/db/version">
    Compare the database schema with the schema supported by Rex.
  </Card>
</CardGroup>

## Prerequisites

Pass the chain-specific data directory that contains `db/`:

```sh theme={null}
rex db --datadir ./alice info
```

When Reth was started with `--datadir ./alice`, use `./alice` here—not `./alice/db`. The `--datadir` option must appear between `db` and the final command.

No HTTP namespace is required, and the global `--rpc` option is not used by database commands.

## Safety Boundary

`db info` and `db tables` use the database API from Reth v1.9.3, pinned to its exact source revision. They verify the on-disk schema version before opening MDBX and then use `open_db_read_only`. The commands never create tables, migrate schemas, delete data, or start a write transaction.

`db version` only reads `db/database.version`; it does not open MDBX.

You can inspect a running node. MDBX table statistics come from one read transaction. For a fully stable comparison that also includes filesystem metadata from `static_files/`, pause database activity while taking the measurement.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.