kitta65 / bq-extension-vscode

Visual Studio Code extension for GoogleSQL
MIT License
19 stars 2 forks source link
bigquery visual-studio-code vscode

BigQuery Extension for VSCode

This is a Visual Studio Code extension for standardSQL, which is a SQL dialect supported by BigQuery. The language server itself is also available by other editors.

Features

Quick Start

[!NOTE] If your OS is Windows, it is recommended to develop in WSL (read the document).

  1. Install Google Cloud SDK
  2. Run gcloud auth login gcloud auth application-default login
  3. Install sqlite3
  4. Install this extension from VSCode
  5. Open a file (xxx.bq or xxx.bigquery)
  6. Update cache (see the usage section)

Usage

Update Cache

The first thing you should do after installation is to update cache. Run BQExtensionVSCode: Update Cache from command palette and the information about datasets and tables will be stored in local directory (~/.bq_extension_vscode/). In this process, this extension runs several queries against INFROMATIN_SCHEMA. Note that datasets which does not appear in your query will be ignored to reduce cost.

Advanced Settings

file extensions

This extension assumes that the file name is xxx.bq or xxx.bigquery. If you are editting a file named xxx.sql, you have to map *.sql to bigquery this way.

// settings.json
{
  "files.associations": {
    "*.sql": "bigquery"
  }
}

Feedback

I'm not ready to accept pull requests, but your feedback is always welcome. If you find any bugs, please feel free to create an issue.