No project description provided
Project description
Functions
A PostgresSQL DAO library with SOLID principles.
Make anything data control with this library, like a create with batch, create only one and more.
GenericDAOImp signature
def find_by_id(self, id: str | int): pass
def find_by_cond(self, cond: str): pass
def find_by_data(self, data: dict): pass
def create(self, data: dict) -> str: pass
def create_with_batch(self, lst_data: list[dict]) -> str: pass
def update(self, primary_key_value, data: dict, primary_key_name='id'): pass
def delete(self, id: str): pass
Initialize
from db_dao.conn import Psycopg2Connection
from db_dao.DAO import GenericDAOImp
conn = Psycopg2Connection({
'host': 'your-host',
'database': 'your-db',
'user': 'your-user',
'password': 'your-password',
'port': 'your-port',
'options': 'your-options',
})
any_dao_imp = GenericDAOImp('table_name', conn)
Dependencies
pip install psycopg2-binary
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
db_dao-1.3.0.tar.gz
(3.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file db_dao-1.3.0.tar.gz.
File metadata
- Download URL: db_dao-1.3.0.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dcf6d0a3cd42e25e2e8cc74ed89383d67b28cecd586c207ba4dcf91c86b66d38
|
|
| MD5 |
280b5ab3852a0138dbf3335e9e37950b
|
|
| BLAKE2b-256 |
275e7043e6a3e529eddd708ac772cc193ec1b4caa6260cc1ecf644336c764a46
|
File details
Details for the file db_dao-1.3.0-py3-none-any.whl.
File metadata
- Download URL: db_dao-1.3.0-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e1838d4c5a9704bbc2e108b0404eca5d783380a05e492bfb35477c037de31d9e
|
|
| MD5 |
7274a49cc0d76c3f88b772a2f573a372
|
|
| BLAKE2b-256 |
d68fc3e94150e3c13154701abef78aae4d47336f64146a2ad62c2bde4dfa0808
|