> ## 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.walkDatabaseData()

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

## `api.walkDatabaseData()`

Processes a large database, view, or materialized-view result in sequential,
awaited batches without collecting
all rows in the isolate. Specify query.take or options.fullScan:true.
Every non-final batch has exactly batchSize rows when available (default 10,000).
The callback may await writes; do not accumulate batches in an array.

### Signature

```ts theme={null}
static walkDatabaseData<T = any>(
      name: string,
      query: Omit<SelectInput, 'debug'>,
      callback: (batch: T[], context: { batch: number; processed: number }) => void | Promise<void>,
      options?: DatabaseWalkOptions,
    ): Promise<DatabaseWalkResult>;
```

### Example

```ts theme={null}
await api.walkDatabaseData('customers', { take: 100000, sort: ['customerId'] },
  async (batch) => {
    await api.upsertDatabaseData('customer_export', batch, { return: false });
  }, { batchSize: 10000 });
```

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.