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

# api.getDatabaseData()

> Public low-code contract, signatures and examples for api.getDatabaseData.

## `api.getDatabaseData()`

Reads rows from a database, view, or materialized view using the structured query shape.

Notes:

* This is the canonical read API.
* debug:true previews the complete estimated read/count plans without fetching records.
  The result contains only debug.explain and optional debug.countExplain.
  Unsupported data sources and writable caller transactions reject diagnostics.
* Pass take: null for a bounded 2,000-row page without a warning.
* Omitting take also uses 2,000 rows and logs one warning per execution.

### Overloads

```ts theme={null}
static getDatabaseData<T = any>(
      name: string,
      request: DatabaseBoundedReadQuery & { debug: true },
    ): Promise<DatabaseExplainResult>;

static getDatabaseData<T = any>(
      name: string,
      request?: DatabaseBoundedReadQuery & { debug?: false },
    ): Promise<GetDatabaseDataResponse<T>>;

static getDatabaseData<T = any>(
      name: string,
      request: DatabaseBoundedReadQuery,
    ): Promise<GetDatabaseDataResponse<T> | DatabaseExplainResult>;
```

### Example

```ts theme={null}
const rows = await api.getDatabaseData('customers', {
  fields: ['customerId', 'name'],
  filter: { field: 'status', op: 'eq', value: 'ACTIVE' },
  sort: { name: 'ASC' },
  take: 100,
});
```

See [all api methods](https://docs.revoengine.com/low-code/reference/api.md) or [runtime basics](https://docs.revoengine.com/low-code/overview.md).


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