Skip to main content

SQLAlchemy dialect for Kubling

Project description

Kubling SQLAlchemy Dialect

Kubling license PyPI Contributions Welcome

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:

  1. Main Pipeline:

    • Responsible for building the Kubling SQLAlchemy dialect.
    • Pushes the library to PyPI for distribution.
  2. 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.

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

  1. Add the dialect library to your Superset installation:

    pip install kubling-sqlalchemy
    
  2. Restart Superset to apply the changes:

    superset run -p 8088
    
  3. 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:

  1. Pull the Docker image:

    docker pull kubling/kubling-superset:latest
    
  2. 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.
  3. Access Superset:

  4. Add a new database connection in Superset:

    • Use the same connection string format as described above:
      kubling://<username>:<password>@<host>:<port>/<vdb_name>
      

📝 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kubling_sqlalchemy-25.1.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kubling_sqlalchemy-25.1-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

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

Hashes for kubling_sqlalchemy-25.1.tar.gz
Algorithm Hash digest
SHA256 b2de66b2059fbe42562514c1756ffb27555754f10bd6684db6588802f1665688
MD5 d75f83c88429f96851ea8fec7d1b53ca
BLAKE2b-256 cc87464aa68d2c5c606e12f2ee5d54c7bc61b78f63c9dd185c9e6b144a442be9

See more details on using hashes here.

File details

Details for the file kubling_sqlalchemy-25.1-py3-none-any.whl.

File metadata

File hashes

Hashes for kubling_sqlalchemy-25.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d88a078d2238499d8100d6d563577d91c8d7d407fce11ead5f28a10f879adba0
MD5 71c7aa98b28505cde958d1374b53589f
BLAKE2b-256 c62a42fe95d5d32a4c34f894a184aa3a188a64edba2b3766ba1cf0358b0798a8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page