SQLAlchemy Dialect for Databricks
Project description
sqlalchemy-databricks
A SQLAlchemy Dialect for Databricks workspace and sql analytics clusters using the officially supported databricks-sql-connector dbapi.
Installation
Install using pip.
pip install sqlalchemy-databricks
Usage
Installing registers the databricks+connector
dialect/driver with SQLAlchemy. Fill in the required information when passing the engine URL. The http path can be for either a workspace or sql analytics cluster.
from sqlalchemy import *
from sqlalchemy.engine import create_engine
engine = create_engine(
"databricks+connector://token:<databricks_token>@<databricks_host>:443/<database_or_schema_name>",
connect_args={
"http_path": "<cluster_http_path>",
},
)
logs = Table("my_table", MetaData(bind=engine), autoload=True)
print(select([func.count("*")], from_obj=logs).scalar())
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file sqlalchemy-databricks-0.2.0.tar.gz
.
File metadata
- Download URL: sqlalchemy-databricks-0.2.0.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.11 CPython/3.8.2 Darwin/20.1.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6efc02643962a1841eeb9139b942efc0246440c9cef3e7f7ebb3ea8d38eb5c0 |
|
MD5 | 90787037dc068e5d01f139fa6dff175e |
|
BLAKE2b-256 | 354de83a8fb0203b2e8747b247b3e839cfe591caf3855c038009065bbe755b29 |
File details
Details for the file sqlalchemy_databricks-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: sqlalchemy_databricks-0.2.0-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.11 CPython/3.8.2 Darwin/20.1.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0c34e85727c289f742c258ce236fe7c95bcc4bcc3a2872b724cc2da20f4db8c |
|
MD5 | 6b5e49ecada3f5a4fa4ce33ead03faa2 |
|
BLAKE2b-256 | 2849bdfb7e9d2a6de4b9fd20a90442a00c9bf4109bbb09e9a5a68c86e98babb0 |