https://github.com/mdub/dbq
a simple Databricks CLI
https://github.com/mdub/dbq
Last synced: about 2 months ago
JSON representation
a simple Databricks CLI
- Host: GitHub
- URL: https://github.com/mdub/dbq
- Owner: mdub
- License: mit
- Created: 2025-12-18T08:50:32.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2026-05-28T03:17:57.000Z (about 2 months ago)
- Last Synced: 2026-05-28T05:10:47.169Z (about 2 months ago)
- Language: Go
- Size: 13.8 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# dbq
A CLI for executing serverless SQL queries on Databricks.
```bash
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:
```bash
export DBQ_WORKSPACE=my-workspace
```
Run a query:
```bash
dbq sql "SELECT current_timestamp(), current_user()"
```
View a [cheatsheet](cmd/cheatsheet.md):
```bash
dbq cheatsheet
```
## How it works
`dbq` uses the [Databricks SDK for Go](https://github.com/databricks/databricks-sdk-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.