More than a simple ORM. wpostgresql delivers automated forensic audit trails (_forensic_audit_log), Change Data Capture (CDC), multi-table routing, and Pydantic v2 schema synchronization with zero boilerplate.
# Define Forensic Model - Ghost Audit Table _forensic_audit_log is auto-managed! from wpostgresql import WPostgreSQL, ForensicModel class User(ForensicModel): id: int name: str db = WPostgreSQL([User], db_config) db.insert(User(id=1, name="William"), user_id=42) # Auto-tracks before/after JSON in _forensic_audit_log!
Enterprise-grade forensic automation and modern ORM features.
Automatic creation and tracking of global _forensic_audit_log storing before/after JSON snapshots and user audit metadata on every INSERT, UPDATE, SOFT_DELETE, and HARD_DELETE.
Register multiple models in one instance. Access tables intuitively with db[User], db.product, or auto-routed db.insert().
Define your database schema using Pydantic models. Full type validation and serialization.
Tables are created and synchronized automatically. Add columns to your model and they're added to the database.
Full async support for all database operations. Non-blocking I/O for high-performance applications.
Built-in connection pooling automatically. Reuses connections for ~5x performance improvement.
Full type hints and Pydantic validation. Catch errors at development time, not runtime.
Optional ForensicModel for automatic soft delete (status=99) and user audit tracking (create/update/delete timestamps & user IDs).
Simple insert, get, update, delete methods. Plus pagination, bulk operations, and transactions.
Validated under high-load conditions. 300,000 operations with 100% success rate. Async is 150x faster than Sync in production scenarios.
✓ 300,000 Operations Completed • 100% Success Rate • Async 150x Faster • View Full Report
Three ways to use wpostgresql - choose what fits your needs.
from wpostgresql import WPostgreSQL db = WPostgreSQL(Model, config) db.insert(record) users = db.get_all()
await db.insert_async(rec) users = await db.get_all_async()
db = WPostgreSQL([User, Product], config) db[User].insert(user) products = db.product.get_all()
pip install wpostgresql
# Clone and install
git clone https://github.com/wisrovi/wpostgresql
pip install -e .
pip install -e ".[dev]"
Ready-to-use examples for every feature.
Install wpostgresql and start building type-safe PostgreSQL applications in minutes.