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

> ## Agent Instructions
> Choose User guide for browser tasks, Developers for CLI, SDK and external agents, and Administration for organization management.
> Confirm identity and organization/project context before operations. Documentation access does not grant ThinkPlatform permissions.
> Review side effects, verify changes with a read, and do not blindly retry an operation with an uncertain outcome.
> Use documented UI steps for the web app and documented public CLI or SDK interfaces for automation. Follow each page’s prerequisites and authentication requirements.

# Inspect a shared database table

> Discover a table, inspect its schema, and retrieve a small sample of rows.

Complete [installation](https://docs.thinkplatform.ai/cli/get-started/installation.md) and [authentication](https://docs.thinkplatform.ai/cli/get-started/authentication.md), then select your [organization and project](https://docs.thinkplatform.ai/cli/guides/context.md). This task reads an existing shared database table; it does not create one.

## Discover the table and schema

```bash theme={"system"}
tp db tables list
tp db tables list --name Inventory
tp db tables get --table-id table-example
```

Replace `table-example` with an ID from the list. The list command returns an array; `--name` filters names by a case-insensitive substring. For a compact view, add `--fields id,name,schema_version`. For a large list, `--limit` and `--offset` shape the fetched records locally.

`tables get` is the CLI's table description and schema inspection command. Its object includes `id`, `name`, `schema_version`, `columns`, and access metadata. Inspect `columns` before building queries. There are no separate `db tables describe`, `schema`, or `preview` commands.

## Preview a bounded row sample

```bash theme={"system"}
tp db rows query --table-id table-example --body '{"filters":[],"sort":[],"page":1,"page_size":5}'
```

The JSON body is the backend query, so this asks the server for a small sample. A query result has an `items` array and a `meta` object. Each row has an `id` and user column values under `data`, alongside row metadata. This abbreviated example shows how row values are nested:

```json theme={"system"}
{"items":[{"id":"row-example","data":{"sku":"SAMPLE-001"}}],"meta":{}}
```

After confirming that your table actually has a `sku` column, project it or export a bounded sample:

```bash theme={"system"}
tp db rows query --table-id table-example --body '{"filters":[],"sort":[],"page":1,"page_size":5}' --fields id,data.sku
tp db rows query --table-id table-example --body '{"filters":[],"sort":[],"page":1,"page_size":5}' --fields id,data.sku --format jsonl > sample.jsonl
tp db rows get --table-id table-example --row-id row-example
```

Replace `row-example` with an ID from the query. Compare its `data` with the sample to verify you selected the correct table and row. `--fields` can use dotted paths; projection changes the displayed shape. Optional command-local `--limit` and `--offset` slice the received rows, whereas `page` and `page_size` inside `--body` are sent to the server. Local slicing does not fetch another server page. Inspect returned `meta` and the deployed query contract before implementing pagination.

If you get an empty sample, check context, table access, and the table ID before changing the query. A missing projected column may indicate a schema mismatch. Use [API discovery](https://docs.thinkplatform.ai/cli/guides/api-requests.md) to inspect deployed request requirements rather than guessing filters. For reusable code, see the [SDK database workflow](https://docs.thinkplatform.ai/python-sdk/database.md) and [error handling](https://docs.thinkplatform.ai/python-sdk/errors.md). All CLI options are in the [command reference](https://docs.thinkplatform.ai/cli/reference/commands.md).


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