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.
- 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!
- Python 3.7+
- Apache Superset
- Access to a Kubling instance
You can install the dialect using pip
:
pip install kubling-sqlalchemy
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
- 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.
-
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>
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
admin
as 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:
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)
We welcome contributions to make this project better!
For major changes, please open an issue first to discuss what you would like to change.