Metadata-Version: 2.4
Name: dbsql-command-line
Version: 0.1.0
Summary: A minimal CLI tool for running SQL queries on Databricks
Author: Vijay Balasubramaniam
License-Expression: MIT
Project-URL: Homepage, https://github.com/vbalasu/dbsql-cli
Project-URL: Repository, https://github.com/vbalasu/dbsql-cli
Project-URL: Issues, https://github.com/vbalasu/dbsql-cli/issues
Keywords: databricks,sql,cli,database
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: python-dotenv
Requires-Dist: pandas
Requires-Dist: sqlalchemy
Requires-Dist: databricks-sqlalchemy
Requires-Dist: twine>=6.1.0
Dynamic: license-file

# 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
