semvec/pypi-packages huggingface dataset:
dbsql-command-line 0.1.0
A minimal CLI tool for running SQL queries on Databricks
Requires Python: >=3.8
Keywords: databricks, sql, cli, database

# dbsql-command-line

A minimal CLI tool for running SQL queries on Databricks.

## Installation

```bash
pip install dbsql-command-line
```

## Setup

Create a `.env` file in your working directory with the following variables:

```env
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:

```bash
dbsql "SHOW TABLES;"
```

```bash
dbsql "DESCRIBE TABLE <table_name>;"
```

```bash
dbsql "SELECT * FROM <table_name> LIMIT 3;"
```

The results are returned in JSON format.

## Examples

Show all tables in the current catalog/schema:
```bash
dbsql "SHOW TABLES;"
```

Describe the structure of a specific table:
```bash
dbsql "DESCRIBE TABLE my_table;"
```

Query data from a table:
```bash
dbsql "SELECT * FROM my_table LIMIT 3;"
```

## Requirements

- Python 3.8 or higher
- Access to a Databricks workspace with appropriate credentials

## License

MIT