Metadata-Version: 2.1
Name: simplepg
Version: 0.1.5
Summary: Simple PostgreSQL connections
License: Apache-2.0
Author: Mysterious Ben
Author-email: datascience@tuta.io
Requires-Python: >=3.8.1,<4.0
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: loguru (>=0.5.0,<0.6.0)
Requires-Dist: psycopg2 (>=2.9.5,<3.0.0)
Description-Content-Type: text/markdown

# SimplePG

Simple PostgreSQL connections: a wrapper around psycopg2.

Features:
- Thread-safe connection pooling
- Auto-reconnect on connection loss
- Unified interface for execute, executemany, and execute_values

## Installation

```bash
pip install simplepg
```

## Example

```python
from simplepg import DbConnection

db = DbConnection(
    user="postgres",
    password="postgres",
    host="localhost",
    port=5432,
    database="postgres",
    connect_kwargs={},
    pool_min_connections=1,
    pool_max_connections=1,
)

db.execute("CREATE TABLE test_table (id SERIAL PRIMARY KEY, name VARCHAR)")
db.execute_values("INSERT INTO test_table (name) VALUES %s", [("test1",), ("test2",)])
records, columns = db.execute("SELECT * FROM test_table")
db.execute("DROP TABLE test_table")
```

