Skip to content

BigQuery

List BigQuery datasets and tables, and run read-only GoogleSQL queries.

Connect it in the console under Integrations > Connectors. See Connectors for how connectors work and who can use them.

In the Google Cloud console, create a service account and give it BigQuery Data Viewer and BigQuery Job User on the project. Create a JSON key for it (Keys > Add key > JSON) and paste the whole file into VAIF Studio.

SettingNotes
Project IDRequiredFor example my-gcp-project.
Service account key (JSON)RequiredGrant it BigQuery Data Viewer and BigQuery Job User. Stored encrypted and never shown again.
LocationOptionalFor example US.
Max bytes billed per queryOptionalA query that would scan more fails instead of costing money (default 1 GB). Default 1000000000.
TableFiltersReturns
datasetspage_tokenDatasets in the project.
tablesdatasetId (required), page_tokenTables in one dataset.
sqlquery (required)Run one read-only GoogleSQL query (capped by max bytes billed). Needs the developer role.
Terminal window
curl -s -X POST "https://api.vaif.studio/database/connector/$VAIF_PROJECT_ID/query" \
-H "Authorization: Bearer $VAIF_TOKEN" -H "Content-Type: application/json" \
-d '{"wrapperId":"bigquery_fdw","table":"sql","filters":{"query":"SELECT country, COUNT(*) AS users FROM `my-project.app.users` GROUP BY country"},"limit":50}'

$VAIF_TOKEN is a console access token. See Connectors for the routes.

VAIF Studio signs in with the bigquery.readonly scope, so BigQuery itself refuses writes, and it refuses statements that write before sending them. Queries are billed to your Google Cloud project; the bytes-billed cap limits each one.