- Go to the page of this extension in Visual Studio Marketplace
- Click the
Install
button - This will open the VS Code page for this extension, and click the
Install
button
This extension requires authentication to the Google Cloud API. You can start using it in the following two steps.
- Create a service account and its key
- Give the service account the role of
roles/bigquery.user
- Give the service account the role of
- Tell the key path to this extension in one of the following two ways:
- Set the path to the key
bigqueryRunner.keyFilename
in settings.json - Set the path to environment variable
GOOGLE_APPLICATION_CREDENTIALS
- Set the path to the key
- Open a query file with
.bqsql
extension - Open the command palette
- Run
BigQuery Runner: Run
ID |
---|
bigqueryRunner.run |
Run a query in BigQuery and display the results. If text is selected, it will run the selected text as a query. If no text is selected, the entire file will be executed as a query.
ID |
---|
bigqueryRunner.prevPage |
Fetch and display the results of the previous page.
ID |
---|
bigqueryRunner.nextPage |
Fetch and display the results of the next page.
ID |
---|
bigqueryRunner.dryRun |
Dry-run a query in BigQuery and display the result. If there is an error in the query, the wrong token of the query will be marked.
The extension can be customized by modifying your settings.json
file. The available configuration options, and their defaults, are below.
Type | Default |
---|---|
string | null | null |
The path to the JSON file for the service account. If a relative path is specified, it is taken as a path relative to the root folder opened in VS Code. If not specified, the path specified by GOOGLE_APPLICATION_CREDENTIALS
will be used.
Type | Default |
---|---|
string | null | null |
Project ID for Google Cloud Platform. If not specified, the value of project_id
in the JSON file of the service account will be used.
Type | Default |
---|---|
string | null | null |
The geographic location of all datasets and jobs referenced and created through this extension. See details at https://cloud.google.com/bigquery/docs/locations#specifying_your_location.
Type | Default |
---|---|
boolean | false |
Flag whether to use legacy SQL. If false
, use standard SQL.
Type | Default |
---|---|
string | null | null |
Limits the bytes billed for this query. Queries with bytes billed above this limit will fail (without incurring a charge). If unspecified, the project default is used.
Type | Default |
---|---|
boolean | true |
Validate the query whenever the file set in languageIds
or extensions
is modified.
Type | Default |
---|---|
number | 600 |
Debounce interval in milliseconds to validate the query when the file is modified.
Type | Default |
---|---|
array | ["bigquery","sql-bigquery"] |
List of language identifiers of the files whose queries are to be validated when the files are modified.
Type | Default |
---|---|
array | [".bqsql",".bqddl",".bqdml"] |
List of file extensions for which the query is to be validated when the file is modified.
Type | Default |
---|---|
number | null | 100 |
The number of rows per page. If a number is specified, only that number of rows will be fetched and displayed as a result. If null is specified, all results will be fetched and displayed. Paging by command bigqueryRunner.prevPage
or bigqueryRunner.nextPage
.
Type | Default |
---|---|
boolean | false |
The flag whether to add column names to CSV.
Type | Default |
---|---|
string | "," |
The delimiter for CSV. For example, if set to , the output will be formatted as TSV.
Type | Default |
---|---|
string | number | "+1" |
A string such as '+N', '-N' can be set to specify a position relative to the column where the query file is opened. Then, if you set a number greater than 1, the viewer will appear in the specified number of columns from the left. A number of -1 means the viewer will appear in the same column as the query file, and a number of -2 means the viewer will appear in the column farthest to the right.
Type | Default |
---|---|
boolean | true |
Display GUI button to run on the editor title menu bar.
Type | Default | Enum |
---|---|---|
string | null | null | "left" | "right" | null |
The alignment of the status bar item.
Type | Default |
---|---|
number | null | null |
The priority of status bar item. Higher value means the item should be shown more to the left.
- Write SQL in VS Code and query BigQuery datasets directly
- Query from selected text
- Marking errors in a query
- Fast rendering of huge results
- Pagination
- Format in a variety of formats
- HTML
<table>
- Text neatly formatted into a table
- JSON
- JSON Lines
- CSV
- HTML
- Output to various destinations
- Viewer that is highly compatible with the themes and fonts set in your VS Code
- Log window, the UI of VS Code
- File
keybindings.json
:
{
{
"key": "cmd+enter",
"command": "bigqueryRunner.run",
"when": "resourceExtname == '.bqsql'"
},
{
"key": "space h",
"command": "bigqueryRunner.prevPage",
"when": "!terminalFocus && resourceExtname == '.bqsql' && vim.mode == 'Normal' || vim.mode == 'Visual' || vim.mode == 'VisualBlock' || vim.mode == 'VisualLine'"
},
{
"key": "space l",
"command": "bigqueryRunner.nextPage",
"when": "!terminalFocus && resourceExtname == '.bqsql' && vim.mode == 'Normal' || vim.mode == 'Visual' || vim.mode == 'VisualBlock' || vim.mode == 'VisualLine'"
}
}
settings.json
:
{
"files.associations": {
"*.bqsql": "sql"
}
}
settings.json
:
{
"[Log]": {
"editor.wordWrap": "off"
}
}
Apache 2.0 licensed. See the LICENSE file for details.