1.4.0 • Published 3 years ago

bigquery2jsonfile v1.4.0

Weekly downloads
7
License
ISC
Repository
github
Last release
3 years ago

bigquery2jsonfile

A program that just queries bigquery and output properly typed, no row limit JSON

I write this because the json generated by bq is not properly typed and number of result rows is limited by default

usage

install

$ npm install bigquery2jsonfile

output to stdout

$ npx bigquery2jsonfile \
  --sql ./path/to/query.sql \
  --camelcase \
  --project_id myproj-123456 \
  --scope https://www.googleapis.com/auth/drive.readonly \
  --service_account_credential_file ./path/to/credential.json
  | jq -f /tmp/_.jq | jq -s \
  | tee /tmp/_.json
  | gsutil cp - gs://your-bucket-name/_.json

output to localfile

$ npx bigquery2jsonfile \
  --sql ./path/to/query.sql \
  --output ./path/to/output.json \
  --camelcase \
  --project_id myproj-123456 \
  --scope https://www.googleapis.com/auth/drive.readonly \
  --service_account_credential_file ./path/to/credential.json

output to google cloud storage

$ npx bigquery2jsonfile \
  --sql ./path/to/query.sql \
  --output gs://your-bucket-name/path/to/output.json \
  --project_id myproj-123456 \
  --scope https://www.googleapis.com/auth/drive.readonly \
  --service_account_credential_file ./path/to/credential.json

use service account passed as a --service_account_credential_file option for uploading

1.4.0

3 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.1

5 years ago

1.0.0

5 years ago