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.
Create a read-only credential
Section titled “Create a read-only credential”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.
Settings
Section titled “Settings”| Setting | Notes | |
|---|---|---|
| Project ID | Required | For example my-gcp-project. |
| Service account key (JSON) | Required | Grant it BigQuery Data Viewer and BigQuery Job User. Stored encrypted and never shown again. |
| Location | Optional | For example US. |
| Max bytes billed per query | Optional | A query that would scan more fails instead of costing money (default 1 GB). Default 1000000000. |
Tables
Section titled “Tables”| Table | Filters | Returns |
|---|---|---|
datasets | page_token | Datasets in the project. |
tables | datasetId (required), page_token | Tables in one dataset. |
sql | query (required) | Run one read-only GoogleSQL query (capped by max bytes billed). Needs the developer role. |
Query from the API
Section titled “Query from the API”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.
How it stays read-only
Section titled “How it stays read-only”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.