# dap listdb

With the `dap listdb` command you can get an overview of the current state of table replication in the local database. It lists the status of all tables in the namespace including meta information and the record count. Tables are grouped by replication status and the appropriate command to use is shown: either `initdb` or `syncdb`.

{% hint style="warning" %}
The timestamp stored in the table metadata is displayed as column `Data as of` to indicate that this is neither the last replication time nor the last database record update time. This is sent by the DAP data warehouse when an `initdb` or `syncdb` is performed and is the timestamp at which the last changes were added to the warehouse for that table and its value depends on the latency in the DAP data pipeline. Total latency is displayed in column `Staleness`, its the combination of the latency of the backend data pipeline and the delay of the client querying the backend.
{% endhint %}

### Usage

```
dap [arguments] listdb [flags]
```

### Options

**`--namespace <string>`**\
Specifies the data source (namespace). Available options: {canvas, canvas\_logs, catalog, new\_quizzes}.

**`--omit-not-replicated`**\
Omit tables that have not been replicated locally.

**`--omit-record-count`**\
Skip querying record counts for each local table.

### Global options

**`--client-id <string>`**\
Client ID obtained from the Identity Service. Skip, if `DAP_CLIENT_ID` environment variable is set.

**`--client-secret <string>`**\
Client Secret obtained from the Identity Service. Skip, if `DAP_CLIENT_SECRET` environment variable is set.

**`--connection-string <string>`**\
The connection string used to connect to the target database. It must follow RFC 3986 format:\
`dialect://username:password@host:port/database`. Skip, if `DAP_CONNECTION_STRING` environment variable is set.

**`-h, --help`**\
Displays help information for the command.

### Examples

List table info of all tables in namespace `canvas`:\
`$ dap listdb --namespace canvas`

Omit not replicated tables from the output:\
`$ dap listdb --namespace canvas --omit-not-replicated`

Skip querying of table sizes if count(\*) performance is bad:\
`$ dap listdb --namespace canvas --omit-record-count`

Output data in JSON format to use in scripts:\
`$ dap --non-interactive listdb --namespace canvas`

### Related Resources

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Key Concepts</strong></td><td>Get familiar with the key concepts in DAP.</td><td><a href="../../key-concepts">key-concepts</a></td></tr><tr><td><strong>Rate Limits &#x26; Policies</strong></td><td>Learn more about the limits and our policies in DAP.</td><td><a href="../../limits-policies">limits-policies</a></td></tr><tr><td><strong>Datasets</strong></td><td>Discover the available namespaces and tables.</td><td><a href="../../dataset">dataset</a></td></tr></tbody></table>
