Context managers for secure and atomic database connectivity
Project description
Conntext
========
Context managers for secure and atomic database connectivity
Goals
-----
* Each context being a single atomic process ("either all occur, or nothing occurs")
* No manual ``commit`` (success), ``rollback`` (fail) or ``close`` (either)
* No ORM
Usage
-----
```python
from conntext.conntext import conn, cursor
import sqlite3 as sqlite
with conn(sqlite.connect(":memory:", factory=sqlite.Row)) as conn_:
with cursor(conn_.cursor()) as cursor_:
cursor_.execute("CREATE TABLE person (name)")
```
License
-------
All the code is licensed under the GNU Lesser General Public License (v3+).
========
Context managers for secure and atomic database connectivity
Goals
-----
* Each context being a single atomic process ("either all occur, or nothing occurs")
* No manual ``commit`` (success), ``rollback`` (fail) or ``close`` (either)
* No ORM
Usage
-----
```python
from conntext.conntext import conn, cursor
import sqlite3 as sqlite
with conn(sqlite.connect(":memory:", factory=sqlite.Row)) as conn_:
with cursor(conn_.cursor()) as cursor_:
cursor_.execute("CREATE TABLE person (name)")
```
License
-------
All the code is licensed under the GNU Lesser General Public License (v3+).
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
Conntext-0.1.1.tar.gz
(4.7 kB
view hashes)