Skip to content

kungfuai/sql-chemistry

Repository files navigation

MIT License LinkedIn


Logo

KUNGFU.AI SQL Chemistry

Simplified Database Management on top of SQL Alchemy

Table of Contents

Built With

Getting Started

This repo aims to simplify the usage of Session, and connection management against Cloud Database Resources.

Dependencies

Python 3.8

Installation

pip install kungfuai-sql-chemistry

Database Registration

Simply create a database dictionary, and call the register_database entrypoint.

def db_init():
  database_map = {
      "main": AwsDbConfig().detect_db_config("main")
  }
  register_databases(database_map)

Engine access

  • Use this import to access all engines
from kfai_sql_chemistry.db.main import engines
  • Use AppSession().get_bind() to access the connectable directly (likely an engine)

Configuration Identification

AwsDbConfig searches by the following convention

  1. Search for {prefix}_DB_SECRET_ID
  2. Search for {prefix}_DB_HOST / PORT / NAME / etc...

where prefix is a name like "MAIN".

Check the examples in the repo for more information.

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Endurance Idehen - endurance.idehen@kungfu.ai Krishi Sharma - krishi.sharma@kungfu.ai