Configure Visual Studio Code to query Google BigQuery directly from the editor.
Run, debug, and share queries without leaving your IDE.Gain IntelliSense, version control, and Galaxy-style collaboration in one place.
Install gcloud
, authenticate with gcloud auth login
, enable the BigQuery API, and install the VS Code Google Cloud BigQuery extension.
Open the Command Palette → BigQuery: Create Connection
→ choose OAuth or Service Account → enter projectId
, optional dataset
, and credentials file path if required.
{
"projectId": "acme-store",
"defaultDataset": "ecommerce",
"location": "US"
}
Create order_analysis.sql
, write your SQL, press F1 → BigQuery: Run Query
or use the inline ▶ button.
SELECT c.name, SUM(oi.quantity * p.price) AS customer_ltv
FROM `acme-store.Orders` o
JOIN `acme-store.Customers` c ON o.customer_id = c.id
JOIN `acme-store.OrderItems` oi ON oi.order_id = o.id
JOIN `acme-store.Products` p ON p.id = oi.product_id
GROUP BY c.name
ORDER BY customer_ltv DESC;
The extension opens a Results panel with sortable grids.Click the Export icon to save CSV/JSON or copy rows to clipboard.
Store .sql
files in Git, commit, and push.Galaxy Collections or VS Code Workspaces keep shared queries organized.
Use @param
placeholders in SQL and provide values in the Parameters side panel — similar to Galaxy’s parameterization UX.
Reference service-account JSON via environment variables; avoid committing keys.
Add #standardSQL
at the top or set workspace setting bigquery.project.defaultDialect
to standard
.
Create workspace settings for default dataset to avoid fully-qualified table names.
Mismatch between dataset location (e.g., EU) and job location (US).Fix by specifying location
in connection JSON.
Service account lacks bigquery.dataViewer
or bigquery.jobUser
. Grant roles in Google Cloud Console.
Galaxy’s AI copilot autocompletes, optimizes, and documents BigQuery SQL right inside VS Code.
.
Yes. Add multiple objects in bigquery.connections
array, each with its own projectId
.
Yes. Use @param
syntax, then supply values in the Parameters panel before execution.
Commit .sql
files to Git or use Galaxy Collections to endorse and reuse trusted queries.