Created
June 24, 2022 21:29
-
-
Save Velrok/d2848d988247beb9d0b90ec1e64a901a to your computer and use it in GitHub Desktop.
NeoVim BigQuery integration. Sends current file content as query to BQ and opens result in terminal split with VisiData.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
query_file="$1" | |
# use json instead of csv, because I had an error where BQ complained it could not render a field as csv table | |
bq query --format json --headless -sync -quiet < "$query_file" 2>/dev/null \ | |
| vd --filetype json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
command! RunAsBigQuery :split term://bq-vd % |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment