> ## Documentation Index
> Fetch the complete documentation index at: https://major-5cc5eebc-docs-bot-mr2qm9w6-typctx.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# BigQuery

> Run SQL queries against Google BigQuery datasets.

The `BigQueryResourceClient` allows you to execute SQL queries against Google BigQuery datasets, explore schemas, and retrieve table metadata.

## Usage

```typescript theme={null}
import { myBigQueryClient } from "./clients";

const result = await myBigQueryClient.invoke(
  "SELECT * FROM `my_dataset.users` WHERE active = true LIMIT 100",
  [],
  "fetch-active-users"
);

if (result.ok) {
  console.log(result.result.rows);
}
```

## Inputs

The `invoke` method accepts the following arguments:

<ParamField path="sql" type="string" required>
  The SQL query string to execute.
</ParamField>

<ParamField path="params" type="(string | number | boolean | null)[]">
  An array of values for parameterized queries.
</ParamField>

<ParamField path="invocationKey" type="string" required>
  A unique identifier for this operation, used for tracing and logging.
</ParamField>

<ParamField path="timeoutMs" type="number">
  Optional timeout in milliseconds for the query execution.
</ParamField>

## Outputs

On success (`ok: true`), the `result` object contains:

<ResponseField name="kind" type="&#x22;database&#x22;">
  Discriminator for the response type.
</ResponseField>

<ResponseField name="rows" type="Record<string, unknown>[]">
  An array of objects representing the rows returned by the query.
</ResponseField>

<ResponseField name="rowsAffected" type="number">
  The number of rows affected by the query.
</ResponseField>
