Simplified Database Management on top of SQL Alchemy
This repo aims to simplify the usage of Session, and connection management against Cloud Database Resources.
Python 3.8
pip install kungfuai-sql-chemistry
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)
- 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)
AwsDbConfig searches by the following convention
- Search for {prefix}_DB_SECRET_ID
- Search for {prefix}_DB_HOST / PORT / NAME / etc...
where prefix
is a name like "MAIN".
Check the examples in the repo for more information.
See the open issues for a list of proposed features (and known issues).
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.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
Endurance Idehen - endurance.idehen@kungfu.ai Krishi Sharma - krishi.sharma@kungfu.ai