Skip to main content

REPL for Big Query

Project description

BQ REPL

REPL for BigQuery

Commands

Commands:
\d, \datasets [PROJECT]               list datasets in current project (or another project)
\p, \projects [PROJECT]               list projects (will switch projects when provided as parameter)
\t, \tables [PROJECT.]DATASET         list tables in a dataset
\c, \columns [PROJECT.]DATASET.TABLE  list columns in a table
\x, \expanded                         toggle expanded view on/off

Options:
\set VARIABLE VALUE                   set option:
Available options:
    - project PROJECT_ID              set current project to PROJECT_ID
    - maxrows 100                     maximum rows displayed (default=100)
    - maxwidth 50                     maxium column width in non-expanded view (default=50)
    - max_expanded_width 100          maximum column width in expanded view (default=100)
    - expanded False                  expanded view (default=False)
    - format_integer ,d               integer display format (default=",d")
    - format_float ,.4f               float display format (default=",.4f")

Command line arguments

$ bqrepl --help
Usage: bqrepl [OPTIONS]

  REPL for BigQuery

Options:
  -c, --credentials-file TEXT  path to credentials .json
  -p, --project TEXT           Use specific project instead of inferring from
                               credentials

  --help                       Show this message and exit.

Installation

$ pip install bqrepl

Dependencies

Python dependencies:

  • google-cloud-bigquery
  • pytz
  • click
  • prompt-toolkit
  • logzero

Tasks

Stuff to implement, in no particular order:

  • Essentials

    • nice looking results
    • query execution
    • toggle numbers formatting on/off
    • string truncation (aka max column width)
    • expanded output
    • switch GCP projects during session
    • nicer looking errors/warnings
    • multiline queries
    • multiline results
    • better authentication
    • persist query history in local database
    • query result pagination or whatever is required to keep # results sane
  • Command line arguments:

    • service-account
    • project
    • execute SQL from command line
  • code completion:

    • BQ-specific SQL syntax
    • projects/datasets/tables/columns available in the query context
    • BQ commands
  • BQ commands

    • list projects
    • list datasets
    • list tables
    • list datasets in a specific project
    • list columns
    • show info about dataset/table/view/model
    • filter list
    • copy tables
    • extract (table to bucket)
    • insert rows to table (from local file)
    • create dataset
    • create table
  • Extras

    • colour-coding nulls
    • colour-coding floats/integers/strings/dates (do I even need this?)
    • recall cached query results instead of running them again
    • view results in a horizontally scrollable table (like pgcli)
    • project/dataset tree
    • use tabs for query results?
    • async queries
    • clear screen
    • integrate ptpython?

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bqrepl-0.1.1.tar.gz (9.7 kB view hashes)

Uploaded Source

Built Distribution

bqrepl-0.1.1-py3-none-any.whl (8.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page