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.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff1156885ffaf2417b11e9d7c9598d58e3d29e81f24d70a9918e8cefc5ebf904 |
|
MD5 | b6f62396cdfde3008186953300b7c66e |
|
BLAKE2b-256 | 29cdcdda8b5d43a280096455059d9eaa151ddc2e9fc42f7c22e92ec8ff3c4674 |