Integrations / Google BigQuery
Google BigQuery
Run SQL on Google BigQuery and browse datasets and tables. Queries use standard SQL and can change data if the SQL does.
5 actions
OAuth 2
4 read1 write
Calls bigquery.googleapis.com
Connect
const conn = await setu.connections.initiate({ userId: "user_1", toolkit: "bigquery" });
console.log(conn.connectUrl); // show this to your user
await conn.waitUntilActive();Permissions requested
| Scope | Why it is requested |
|---|---|
https://www.googleapis.com/auth/userinfo.email | See which Google account you connected |
https://www.googleapis.com/auth/bigquery | View and manage your data in Google BigQuery and run queries |
Actions
Get query resultsreadbigquery.get_query_resultsFetch the results of a BigQuery query job by job ID, one page at a time. Use after run_query returns an unfinished job or a page token.
Needs scope: https://www.googleapis.com/auth/bigquery
| Input | Type | Description | |
|---|---|---|---|
project_id | string | Required | Project ID of the query job |
job_id | string | Required | Job ID from run_query |
location | string | Optional | Job location, e.g. US |
max_results | integer | Optional | Rows per page |
page_token | string | Optional | Token from a previous page |
timeout_ms | integer | Optional | How long to wait for the job to finish |
await setu.execute({
userId: "user_1",
action: "bigquery.get_query_results",
input: {
"project_id": "<project_id>",
"job_id": "<job_id>"
},
});Get tablereadbigquery.get_tableGet a table's schema (column names and types), row count and size.
Needs scope: https://www.googleapis.com/auth/bigquery
| Input | Type | Description | |
|---|---|---|---|
project_id | string | Required | Google Cloud project ID |
dataset_id | string | Required | Dataset ID |
table_id | string | Required | Table ID |
await setu.execute({
userId: "user_1",
action: "bigquery.get_table",
input: {
"project_id": "<project_id>",
"dataset_id": "<dataset_id>",
"table_id": "<table_id>"
},
});List datasetsreadbigquery.list_datasetsList the datasets in a Google Cloud project.
Needs scope: https://www.googleapis.com/auth/bigquery
| Input | Type | Description | |
|---|---|---|---|
project_id | string | Required | Google Cloud project ID |
max_results | integer | Optional | Maximum datasets to return |
page_token | string | Optional | Token from a previous page |
await setu.execute({
userId: "user_1",
action: "bigquery.list_datasets",
input: {
"project_id": "<project_id>"
},
});List tablesreadbigquery.list_tablesList the tables and views in a BigQuery dataset.
Needs scope: https://www.googleapis.com/auth/bigquery
| Input | Type | Description | |
|---|---|---|---|
project_id | string | Required | Google Cloud project ID |
dataset_id | string | Required | Dataset ID |
max_results | integer | Optional | Maximum tables to return |
page_token | string | Optional | Token from a previous page |
await setu.execute({
userId: "user_1",
action: "bigquery.list_tables",
input: {
"project_id": "<project_id>",
"dataset_id": "<dataset_id>"
},
});Run querywritebigquery.run_queryRun a standard SQL query in BigQuery (jobs.query) and return the first page of rows, or a job ID to poll with get_query_results if it is not finished. SQL can modify data and incurs query cost.
Needs scope: https://www.googleapis.com/auth/bigquery
| Input | Type | Description | |
|---|---|---|---|
project_id | string | Required | Google Cloud project ID that runs and is billed for the query |
query | string | Required | Standard SQL to run |
max_results | integer | Optional | Rows per page |
timeout_ms | integer | Optional | How long to wait for completion before returning a job reference |
location | string | Optional | Job location, e.g. US or EU |
dry_run | boolean | Optional | Only validate the query and estimate bytes processed |
await setu.execute({
userId: "user_1",
action: "bigquery.run_query",
input: {
"project_id": "<project_id>",
"query": "<query>"
},
});