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

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

## `api.queryDatabase()`

Executes raw SELECT/WITH SQL when the structured helpers are not enough.
Do not use this for writes; use insert/upsert/update/delete helpers or
transactionDatabase for write flows.
Requires current INSTANCE\_ADMIN membership on the effective execution account.
Saved endpoint/Job policies select that account; direct Sandbox/MCP execution
uses the authenticated caller. api.currentUser() follows the configured identity mode
and does not grant execution permissions.
Always runs exactly one SELECT/WITH
in a READ ONLY database transaction. Mutating CTEs and multiple statements are rejected.
Use parameters for values. Typed data and ORM helpers retain their own resource permissions.

### Signature

```ts theme={null}
static queryDatabase(query: string, params?: any[]): Promise<any>;
```

### Example

```ts theme={null}
const rows = await api.queryDatabase('SELECT NOW() AS now');
```

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.