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

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

## `api.updateDatabase()`

Outside an explicit caller transaction, waits for a durable schema operation and verified DDL commit.
Explicit caller transactions retain synchronous DDL within their configured transaction budget.
The old definition/version remains authoritative until commit.
Updates selected logical-database fields by name. The public contract requires the current
version for optimistic locking; send only the fields that should change. Do not
copy server-owned databaseId, timestamps, or size into this payload.
options.indexes replaces the complete managed index set; unchanged named indexes
retain their physical index and metadata version. Omit options to preserve it.
definition replaces the complete column set: preserve databaseDefinitionId for
existing columns and omit definition for an index-only update.

Notes:

* Unavailable with `readOnly: true` (throws an error).

### Signature

```ts theme={null}
static updateDatabase(name: string, data: DatabaseUpdateInput): Promise<Database>;
```

### Example

```ts theme={null}
await api.updateDatabase('orders', {
  version: current.version,
  audit: true,
});
```

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.