Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>BigQuery Data View v2New to Visual Studio Code? Get it now.
BigQuery Data View v2

BigQuery Data View v2

sseveur

|
2 installs
| (1) | Free
Google BigQuery extension for Visual Studio Code. List datasets and tables, view table contents, run queries, format SQL, view query history, see cost estimates, table schema hover, and visualize data lineage with CTE support. Fork of bstruct/vscode-bigquery.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

BigQuery Data View v2 for Visual Studio Code

Version 1.0.0 VS Code Marketplace Installs

A powerful Visual Studio Code extension for Google BigQuery. Browse datasets and tables, run queries with real-time validation, view results, format SQL, track query history, estimate costs, and visualize data lineage.

Features

  • Authentication - User login, GDrive access, and service account support via gcloud CLI
  • Project Explorer - Browse projects, datasets, tables, views, functions, and ML models
  • Query Execution - Run queries with Ctrl+Enter, real-time error highlighting, and byte estimation
  • SQL Intellisense - Autocomplete for SQL keywords and BigQuery functions
  • Syntax Highlighting - Full support for .bqsql files with grammar injection for .sql files
  • SQL Formatting - Format queries with configurable style options
  • Query History - Track all executed queries with re-run and copy capabilities
  • Cost Estimation - Real-time cost estimates based on bytes processed
  • Table Schema Hover - Hover over table names to see schema details
  • Data Lineage - Visualize data flow with CTE support
  • Export Options - Download results as CSV or JSONL, copy to clipboard
  • Pub/Sub Integration - Publish query results directly to Google Cloud Pub/Sub

Installation

  1. Open VS Code
  2. Go to Extensions (Ctrl+Shift+X)
  3. Search for "BigQuery Data View v2"
  4. Click Install

Or install from the VS Code Marketplace.

Requirements

  • Google Cloud SDK (gcloud CLI) must be installed
  • Valid Google Cloud authentication with BigQuery permissions

Quick Start

  1. Install the gcloud CLI and authenticate: gcloud auth login
  2. Open the BigQuery panel from the Activity Bar
  3. Create a new .bqsql file and write your query
  4. Press Ctrl+Enter to run

Keyboard Shortcuts

Shortcut Icon Command Description
Ctrl+Enter run Run Query Execute the entire query in the editor
Ctrl+E run selected Run Selected Query Execute only the selected text
Shift+Alt+F Format SQL Format the current SQL document

Authentication

The extension uses the gcloud CLI for authentication. Three authentication methods are supported:

authentication panel
  • User login - Opens browser for Google Cloud authentication
  • User login + GDrive - Same as above, with Google Drive access for Drive-based tables
  • Service account - Select a service account key file (JSON format)

When there's a valid account active with BigQuery permissions, the extension is ready to use.

Additional functionality:

  • Activate/switch between multiple accounts
  • Revoke authentication

Refresh the authentication screen with the command BigQuery: Authentication refresh.

Projects, Datasets, and Tables Explorer

The BigQuery side panel displays a tree of projects, datasets, tables, views, functions, and ML models.

explorer tree

Refresh the explorer with the command BigQuery: Explorer refresh.

You can set a default project that queries will run against by right-clicking on a project.

Context Menu Actions

Right-click on tables and views to access:

explorer tree menu
  • Create query - Opens a new editor with a basic SELECT * FROM statement
  • Open DDL - Opens the DDL (Data Definition Language) statement for the object
  • Preview - Opens a preview of the table data (runs SELECT * for views and external tables)
  • Preview schema - Opens the table/view schema information

Table Preview

table preview

Schema View

schema view

Run Queries

The extension activates for .bqsql files. Run queries using:

  • Keyboard: Ctrl+Enter (run all) or Ctrl+E (run selected)
  • Command Palette: BigQuery: Run Query or BigQuery: Run Selected Query
  • Editor Toolbar: Click the run buttons
query results

Query results appear in the bottom panel under Bigquery: Query results. You can open results in a separate tab for side-by-side comparisons.

Syntax Highlighting & Intellisense

The extension provides:

  • Syntax highlighting for SQL keywords (SELECT, FROM, WHERE, JOIN, CASE, WHEN, etc.)
  • Intellisense/autocomplete for SQL keywords and BigQuery functions
  • Grammar injection for .sql files (syntax highlighting works automatically)

Real-time Query Validation

Queries are validated as you type. Errors are underlined in the editor:

query error

Valid queries show the estimated bytes in the status bar:

query size evaluation

Query History

All executed queries are saved to the History panel in the BigQuery sidebar.

Each history entry shows:

  • Query preview text
  • Execution timestamp
  • Bytes processed and duration
  • Success/error status

Right-click actions:

  • Re-run - Execute the query again
  • Copy - Copy query text to clipboard
  • Delete - Remove from history

Use the clear button to remove all history entries.

query_history

Cost Estimator

The status bar shows real-time cost estimates based on BigQuery's dry-run feature:

  • Estimated bytes to be processed
  • Estimated cost in USD (configurable, default $6.25/TB)

Configure the cost per TB in settings via vscode-bigquery.costPerTB. Set to 0 to hide cost estimates:

cost_estimator

Table Schema Hover

Hover over any table name in your SQL query to see schema information:

  • Column names and data types
  • Column descriptions (if available)
  • Partitioning and clustering information
table_hover_schema

The schema is cached after first fetch for faster subsequent lookups.

Supported Locations

Schema hover works for tables in:

  • FROM clauses - FROM project.dataset.table
  • JOIN clauses - JOIN project.dataset.table, LEFT JOIN, RIGHT JOIN, INNER JOIN, CROSS JOIN, FULL JOIN
  • CTE references - When you reference a CTE name (e.g., FROM my_cte), the hover shows the columns defined in that CTE's SELECT clause

Data Lineage

Visualize data flow in your queries. Click the lineage button lineage in the editor title bar or run BigQuery: Show Data Lineage.

data lineage

The lineage graph shows:

  • Source tables (blue) - Tables your query reads from
  • CTEs (purple) - Common Table Expressions as intermediate nodes
  • Target tables (green) - Tables your query writes to (INSERT, CREATE, MERGE, etc.)

Features:

  • CTE Support - CTEs are shown as intermediate nodes between sources and targets
  • Layered DAG Layout - Nodes are arranged left-to-right based on data flow
  • Curved Connections - Bezier curves show relationships between nodes
  • Statement Type Badges - Target nodes show the operation type

Format SQL

Format your BigQuery SQL queries with Shift+Alt+F or by running BigQuery: Format SQL.

Configuration options:

  • Keyword Case (vscode-bigquery.formatKeywordCase): upper, lower, or preserve
  • Indent Style (vscode-bigquery.formatIndentStyle): standard, tabularLeft, or tabularRight
  • Leading Commas (vscode-bigquery.formatLeadingCommas): Enable/disable leading comma style

Export Options

Download CSV

After running a query, download results as CSV from the result grid toolbar.

download csv
  • Supports multiline content
  • No row limit (be mindful of large result sets)
  • Does not support nested complex objects

Copy to Clipboard

Copy results in CSV format with a configurable size limit (default 1MB). Configure via vscode-bigquery.clipboardSizeLimitKb.

Download JSONL

Download results in JSONL format from the result grid toolbar.

download jsonl

Send to Pub/Sub

Publish query results to Google Cloud Pub/Sub (one message per row).

Requirements:

  • A column named data of type STRING or JSON
  • Optional: A column named attributes of type RECORD

Example query:

SELECT
    (
    SELECT AS STRUCT
        "my test test" AS test,
        "amazing data type" AS data_type
    ) AS attributes,

    TO_JSON(t) AS data

FROM `dataset.table` t
send to Pub/Sub

Enter the topic name in the format: projects/<project_id>/topics/<topic_name>

Pub/Sub topic name

Settings

Pin a Project

Pin projects to keep them at the top of the explorer tree.

set default project pin/unpin project

Pinned projects are stored in settings:

settings file

Add GCP Projects

For cases where you only have read permissions at the dataset level (not project level), force a project to be listed:

Setting: vscode-bigquery.projects

Add BigQuery Tables

When permission is granted only at the table level:

Setting: vscode-bigquery.tables

add table

Associate .sql Files

Enable BigQuery features for all .sql files:

Setting: vscode-bigquery.associateSqlFiles

Configuration Reference

Setting Type Default Description
vscode-bigquery.pinned-projects array [] Pinned GCP project IDs
vscode-bigquery.projects array [] Additional GCP project IDs to list
vscode-bigquery.tables array [] Table IDs to list directly
vscode-bigquery.associateSqlFiles boolean false Treat .sql files as BigQuery SQL
vscode-bigquery.clipboardSizeLimitKb number 1024 Clipboard copy size limit (KB)
vscode-bigquery.costPerTB number 6.25 Cost per TB for estimates ($)
vscode-bigquery.formatKeywordCase string upper Keyword case: upper, lower, preserve
vscode-bigquery.formatIndentStyle string standard Indent style: standard, tabularLeft, tabularRight
vscode-bigquery.formatLeadingCommas boolean true Use leading comma style

Access settings via:

settings menu

Troubleshooting

Query results panel not opening

Sometimes after installation, the BigQuery: Run query command doesn't open the results panel. Restart VS Code to resolve this.

Authentication issues

Ensure the gcloud CLI is properly installed and you've run gcloud auth login successfully.

Missing projects or datasets

If you have limited permissions, add projects or tables manually via settings.

Report a Bug

Please file an issue with as much detail as possible at GitHub Issues.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is a fork of bstruct/vscode-bigquery.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft