Database wrapper classes for SQLAlchemy.
Project description
bh_database
Database wrapper classes for SQLAlchemy.
Pip installation
pip install bh-database
Overview
Database wrapper classes for SQLAlchemy.
These classes currently support only two database types: MySQL and PostgreSQL. Drivers required, respectively:
These classes provide the following functionalities:
-
Database connection management.
-
A custom SQLAlchemy query class which implements paginating.
-
A generic base model (table), which should be the indirect base model for applications' models. This class encapsulates:
-
SQLAlchemy scoped session, thereby providing methods to implement transaction atomicity.
-
A custom base query with paginating ability mentioned above.
-
Fully implemented dunder methods str() and repr().
-
-
A generic SQLAlchemy declarative base class which should include all required metaclasses.
-
Some generic methods which run full text SQL statements.
-
A generic method to run stored procedures which return data.
-
A generic method which takes a list of records to be inserted, and records to be updated, and writes them to the target database table in a single call.
-
Transaction atomicity. Multiple database operations involving several different tables can be wrapped under a single transaction, so that all can be committed or rolled back as appropriate.
Please see Full documentation for more detail.
Documentation
License
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
Hashes for bh_database-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 698500910893dc7aacfaafa6ec4a250fd2a40dd409922054d7de85354641d0be |
|
MD5 | 303e797db30c691a3dbaef7a2d2c1f16 |
|
BLAKE2b-256 | 2d4b8d1b62241877230f8f0d7b9a3460ea3dc19a581d4c15170bcf619b60adb8 |