Git Product home page Git Product logo

vscode-bigquery's Introduction

vscode-bigquery

BigQuery icon

A Visual Studio Code ("VS Code") extension that can query Google Cloud Platform's BigQuery analytics database from, and return results to, your editor. This extension allows you to:

  • Write SQL in VS Code and query BigQuery datasets directly
  • Create queries from selected text
  • Capture results into VS Code window to manipulate them further

This extension is great if you're exploring BigQuery and prefer VS Code's editing environment, or for cases where you're writing documentation (hint: use "Run selected text as query") and want to double check that the query is valid.

Installing

The package will be available on the VS Code Marketplace shortly, but in the meantime, you can install it manually:

  1. Download the latest pre-built release here: vscode-bigquery-0.0.1.vsix
  2. Open the Command Palette in VS Code (Ctrl/Cmd+Shift+P), and type "ext install" -> select "Extension: Install From VSIX..."
  3. Navigate to the folder where you saved the .vsix file, and select it.
  4. Reload VS Code when prompted.

Usage

The BigQuery extension adds a number of commands to the command palette (Cmd/Ctrl+Shift+P).

By default, it will look for your GOOGLE_APPLICATION_CREDENTIALS environmental variable (if set) and use the service account described in that JSON file. You can also explicitly set bigquery.keyFilename to the path of your Service Account key file. Unless necessary, it's recommended that you scope this key to the roles.bigquery.user role, which is sufficient for querying and most related tasks.

Optional Configuration

The extension can be customized by modifying your settings.json file. The available configuration options, and their defaults, are below.

"bigquery.keyFilename" = "" // the fully-qualified path to the service account file you downloaded - e.g. '/home/you/mykeyfile-1313ef.json'
"bigquery.projectId" = "" // only needed if your key file is not in JSON format - e.g. 'funny-horse-1234'
"bigquery.email" = "" // only needed if your key file is not in JSON format - e.g. '[email protected]'
"bigquery.useLegacySql" = false // use the legacy SQL language when making queries.
"bigquery.maximumBytesBilled" = null // Unlimited
"bigquery.location" = "US" // Defaults to "US"
"bigquery.outputFormat" = "json" // "json", "csv"

The majority of these settings are inherited from ClientConfig in the underlying BigQuery client library.

Contributing

Feature requests are accepted, but please raise an issue describing your feature before sending a PR. This extension focuses on querying BigQuery, rather than dataset- and/or table- level functionality.

This is not an officially supported Google product.

License

Apache 2.0 licensed. See the LICENSE file for details.

vscode-bigquery's People

Contributors

dan-nom avatar dependabot[bot] avatar elithrar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

vscode-bigquery's Issues

TypeError showing after execution of query

Running valid query to create a table and getting the following error:

Failed to get results: TypeError: Cannot convert undefined or null to object

I check the console though and the DDL I executed is there in the dataset.

Roadmap/Prioritization

Hey Matt, it would be great to understand more of your vision for what could be in and out of scope for this extension in the future. I have a pretty long wishlist for my ideal VSCode/BigQuery workflow, but to pick out a few things that would be cool:

  • More rendering options for query results (any of: markdown tables, opening a result set in the web ui, a table webview)
  • Saving results to CSV or JSON files locally
  • Source code snippets
  • A sidebar views of datasets, tables and fields
  • A language server:
    • Query validation and annotation of errors in line (either through the API, or using a node SQL 2011 validator)
    • Autocompletion of table names
    • Autocompletion of field names

I'm super excited about the possibilities here: BigQuery + VSCode + Git could be really powerful!

Dry run/query validation

Thanks for kicking off this project, been looking for something like this for a while and excited where this could go.

My feature request is to make queries executable in dryRun mode.

Output could be a formatted representation of status.errors[].

I've not had much experience of TypeScript, or written a VSCode extension before, but happy to put together a pull request if you'd consider it.

Problem to run

Hello Matt,

I installed the vscode-bigquery plugin (my VSCode version 1.33.0) but I can't get it started. I have to create a file.sql or how can I do? thank you so much.

Results window - Not showing

I have configured everything and if I select Bigquery: Run as Query it retunes the below infobox.
image

But later I couldn't get any result set for this. To be clear, I don't know where to get the Result window.

Next Release with Dry Run?

Hi,

I am wondering if you might release a newer version of the compiled package? The .vsix in the README does not appear to contain newer commits, especially including commit 91105dd with the dryRun command.

I am going to try and fork this repo and compile a .vsix with the most recent version of master, to distribute to developers in my organization. But I would rather just direct people to download the provided .vsix directly.

Thank you for the great extension!

Teghan

What is the version of VS Code supported?

Hey, I really like this extension and would love to know what is the version supported for VS code.
I am using version 1.65+ but when I try to install the plugin from marketplace, It gives me error stating that "this version is not supported"

Release to VS Code Marketplace?

Hi,

As the title suggests, are there any plans to put this extention in the VS Code Marketplace? Its visibility will benefit greatly from that, as the currently available extensions don't overlap in functionality and reliability.

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.