dbsql-command-line
A minimal CLI tool for running SQL queries on Databricks.
Installation
pip install dbsql-command-line
Setup
Create a .env file in your working directory with the following variables:
DATABRICKS_TOKEN=your_databricks_access_token
DATABRICKS_SERVER_HOSTNAME=your_databricks_server_hostname
DATABRICKS_HTTP_PATH=your_databricks_http_path
DATABRICKS_CATALOG=your_databricks_catalog
DATABRICKS_SCHEMA=your_databricks_schema
Usage
Run SQL queries directly from the command line:
dbsql "SHOW TABLES;"
dbsql "DESCRIBE TABLE <table_name>;"
dbsql "SELECT * FROM <table_name> LIMIT 3;"
The results are returned in JSON format.
Examples
Show all tables in the current catalog/schema:
dbsql "SHOW TABLES;"
Describe the structure of a specific table:
dbsql "DESCRIBE TABLE my_table;"
Query data from a table:
dbsql "SELECT * FROM my_table LIMIT 3;"
Requirements
- Python 3.8 or higher
- Access to a Databricks workspace with appropriate credentials
License
MIT
Metadata
Release files for dbsql-command-line 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| dbsql_command_line-0.1.0.tar.gz | 3.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dbsql_command_line-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.4 kB
Release files / dbsql_command_line-0.1.0.tar.gz
| Download URL | dbsql_command_line-0.1.0.tar.gz |
|---|---|
| Size | 3.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cdeebc5d1bbdc90c5eecb59b067056caa914b84b14484a261df98ddf51dba59c
|
|
BLAKE2b-256 checksum How to use checksums |
6dc79f0993d38ace2e944541ef81d656c895d7d435d16640723e8c0073e40da5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.8
|
Release files / dbsql_command_line-0.1.0-py3-none-any.whl
| Download URL | dbsql_command_line-0.1.0-py3-none-any.whl |
|---|---|
| Size | 4.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bc55b3269347dc3bf1d9a012e43ede964241a4bbd738e587f3bfc7d310053e99
|
|
BLAKE2b-256 checksum How to use checksums |
242e22f44f88dd33d69cfaa7eb9782fa87f68f75effae20724f8eef14ce855ee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.8
|