dbq

command module
v0.4.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 30, 2026 License: MIT Imports: 1 Imported by: 0

README

dbq

A CLI for executing serverless SQL queries on Databricks.

dbq sql "
  SELECT stuff FROM the.lakehouse WHERE patience = 0
"

Features

  • Quick.
  • Simple.
  • JSON, CSV, or Parquet output.
  • Preserves type information; no "everything is a string" nonsense.

Installing it

On Mac, with brew:

brew install mdub/brews/dbq 

Elsewhere, with go install:

go install github.com/mdub/dbq@latest

Using it

Select a workspace:

export DBQ_WORKSPACE=my-workspace

Run a query:

dbq sql "SELECT current_timestamp(), current_user()"

View a cheatsheet:

dbq cheatsheet

How it works

dbq uses the Databricks SDK for Go:

  • Configuration: No files required - just command-line flags and a couple of environment variables.
  • Authentication: OAuth U2M (user-to-machine) flow. Tokens are cached and automatically refreshed.
  • Results: fetched in Arrow format, minimizing serialization overhead and preserving type fidelity.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package cmd implements the dbq CLI commands.
Package cmd implements the dbq CLI commands.
Package metrics provides query execution metrics from the Databricks Query History API.
Package metrics provides query execution metrics from the Databricks Query History API.
Package output formats query results as JSONL, CSV, etc.
Package output formats query results as JSONL, CSV, etc.
Package result defines the QueryResult interface and its Databricks Arrow implementation.
Package result defines the QueryResult interface and its Databricks Arrow implementation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL