Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/getyourguide/dbq
Run Databricks queries from your terminal or editor
https://github.com/getyourguide/dbq
cli databricks repl sql team-ps
Last synced: 2 months ago
JSON representation
Run Databricks queries from your terminal or editor
- Host: GitHub
- URL: https://github.com/getyourguide/dbq
- Owner: getyourguide
- License: apache-2.0
- Created: 2020-01-06T09:12:08.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-09-13T08:05:42.000Z (4 months ago)
- Last Synced: 2024-09-13T21:16:34.111Z (4 months ago)
- Topics: cli, databricks, repl, sql, team-ps
- Language: Python
- Homepage:
- Size: 257 KB
- Stars: 7
- Watchers: 58
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# dbq
Run Databricks queries from your terminal or editor.
![Basic demo](assets/basic-demo.svg)
## Installation and configuration
```
pip3 install dbq
```Note: libsasl2 is required on your system. On Ubuntu, get it through `sudo apt-get install libsasl2-dev`.
Configuration instructions will be displayed when you run `dbq`.
## Usage
```
dbq [QUERY]
```## Interactive session
Run `dbq` (without `QUERY`) to start an interactive REPL. Readline is supported, a history file is kept in `~/.dbq_history`.
## Read query from stdin
Specify `-` for `QUERY`. Useful for editor integrations; see next section.
### Integrating with vim
This example binds `ctrl+s` to running the selected text as a query (visual mode) or the subquery that is under the cursor (normal mode).
```
nnoremap vi(:w !dbq -
vnoremap :w !dbq -
```![Vim demo](assets/vim-demo.svg)
## Development and contributing
For development [pipenv](https://pipenv.kennethreitz.org/en/latest/) is required on your system. Set up the development environment with `make develop`, run with `pipenv run dbq ...` as needed. When submitting pull requests, ensure that `make lint` comes back clean; you can auto format the code with `make format`.
We welcome pull requests; if you are planning to perform bigger changes then it makes sense to file an issue first.
## Security
For sensitive security matters please contact [[email protected]](mailto:[email protected]).
## Legal
Copyright 2019 GetYourGuide GmbH.
dbq is licensed under the Apache License, Version 2.0. See [LICENSE](LICENSE) for the full text.