SQLAlchemy dialect for Kubling
Project description
Kubling SQLAlchemy Dialect
A custom SQLAlchemy dialect for integrating Kubling with Apache Superset. This dialect enables seamless querying and visualization of Kubling data within Superset by leveraging its PostgreSQL-compatible protocol.
🚀 Features
- PostgreSQL-Compatible: Connects to Kubling using its PostgreSQL protocol.
- Data Type Mapping: Automatically maps Kubling data types to SQLAlchemy types.
- Seamless Integration: Fully supports Superset for visualizations and dashboards.
- Open Source: Contributions and feedback are welcome to improve this dialect!
🛠️ Installation
Prerequisites
- Python 3.7+
- Apache Superset
- Access to a Kubling instance
Install the Dialect
You can install the dialect using pip:
pip install kubling-sqlalchemy
Build
The build process for this project is divided into two pipelines:
-
Main Pipeline:
- Responsible for building the Kubling SQLAlchemy dialect.
- Pushes the library to PyPI for distribution.
-
Superset Pipeline:
- Located in the
superset/directory. - Builds an OCI-compliant image based on the official Apache Superset image.
- Installs the Kubling dialect into the Superset container, enabling seamless Kubling integration.
- Located in the
CI/CD and Docker Context
- This project still utilizes Jenkins for continuous integration and delivery, including both pipelines.
- Dockerized Build Process:
- All build and packaging tasks occur within a Docker context.
- This design ensures ease of forking and customization, allowing you to adapt the pipelines to your specific needs with minimal effort.
Configure Apache Superset
Using the Kubling Dialect
-
Add the dialect library to your Superset installation:
pip install kubling-sqlalchemy
-
Restart Superset to apply the changes:
superset run -p 8088
-
Add a new database connection in Superset using the following connection string format:
kubling://<username>:<password>@<host>:<port>/<vdb_name>
Using the Dockerized Version
Alternatively, you can use the pre-built Docker image that includes the Kubling dialect:
-
Pull the Docker image:
docker pull kubling/kubling-superset:latest
-
Run the container:
docker run -d --name kubling-superset \ -p 8088:8088 \ -e SUPERSET_SECRET_KEY=$(openssl rand -base64 42) \ kubling/kubling-superset:latest
- Replace
$(openssl rand -base64 42)with a strong secret key or leave it as-is for dynamic generation.
- Replace
-
Access Superset:
- Open your browser and go to http://localhost:8088.
- Login using
adminas the username and password.
-
Add a new database connection in Superset:
- Use the same connection string format as described above:
kubling://<username>:<password>@<host>:<port>/<vdb_name>
- Use the same connection string format as described above:
📝 Example
Here’s an example of how to use the dialect programmatically with SQLAlchemy:
from sqlalchemy import create_engine
# Replace with your Kubling connection details
engine = create_engine("kubling://username:password@localhost:35432/vdb_name")
# Test a query
with engine.connect() as connection:
result = connection.execute("SELECT * FROM SYS.SCHEMAS")
for row in result:
print(row)
🤝 Contributing
We welcome contributions to make this project better!
For major changes, please open an issue first to discuss what you would like to change.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kubling_sqlalchemy-25.1.tar.gz.
File metadata
- Download URL: kubling_sqlalchemy-25.1.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b2de66b2059fbe42562514c1756ffb27555754f10bd6684db6588802f1665688
|
|
| MD5 |
d75f83c88429f96851ea8fec7d1b53ca
|
|
| BLAKE2b-256 |
cc87464aa68d2c5c606e12f2ee5d54c7bc61b78f63c9dd185c9e6b144a442be9
|
File details
Details for the file kubling_sqlalchemy-25.1-py3-none-any.whl.
File metadata
- Download URL: kubling_sqlalchemy-25.1-py3-none-any.whl
- Upload date:
- Size: 10.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d88a078d2238499d8100d6d563577d91c8d7d407fce11ead5f28a10f879adba0
|
|
| MD5 |
71c7aa98b28505cde958d1374b53589f
|
|
| BLAKE2b-256 |
c62a42fe95d5d32a4c34f894a184aa3a188a64edba2b3766ba1cf0358b0798a8
|