Matter persistance library.
Project description
matter-persistence
Table of Contents
Installation
pip install matter-persistence
Usage
CacheManager and DatabaseManager are the two central objects in matter_persistence.
CacheManager encapsulates a connection pool to Redis, and exposes methods to save, retrieve, and delete values from Redis.
Check usage example for redis CacheManager in examples/redis.
DatabaseManager encapsulates a Sqlalchemy connection pool to a relational database (e.g. Postgresql), and exposes methods to obtain a Connection or a Session.
Furthermore, there is a CustomBase in matter_persistence/sql/base.py, which is a convenient Base class for Sqlalchemy ORM classes. It has an "id" primary key field, which is of type UUID, a "created", "updated" field that is inherited from sqlalchemy_utils' Timestamp, and a "deleted" field, which is of type nullable timezone aware DateTime.
The get and find functions in matter_persistence/sql/utils.py assume a deleted field!
Check usage example for DatabaseManager and some of the utility functions in examples/sql.
Contributing
for contributions, check the CONTRIBUTING.md file
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 Distributions
Built Distribution
Hashes for matter_persistence-1.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1cd3b0d7352155ca450b13cfd07acb047764fe95823672964e3f00089999b9f3 |
|
MD5 | 475535245af3a0e88206ab20bc2d0017 |
|
BLAKE2b-256 | 04d0ddb8a26b9cb343491c8b689357c0d68ac514bfc99adafe720bf6e950c420 |