Minimal psycopg2 wrapper for easier interfacing with databases
Project description
Installation
Run pip install psycopg2-contextmanager
Usage
from psycopg2_contextmanager import database_connection with database_connection(<database_connection_string>) as cursor: cursor.execute(<query>)
Commits are handled automatically. If the query fails, the package will log the exception along with the line Unable to run query and re-raise it.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for psycopg2-contextmanager-1.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5061cf2488ab7b2c6676ed37cf630e2749fd1e03bf76c072bc7d3e8eaa4c2f47 |
|
MD5 | 3637baccb430fa5be8cab90e5951266e |
|
BLAKE2b-256 | df1da667a8ef8769aa0c86c6187164afab16c2570c897234832120fe5a5689c9 |