v1.4.0 • Enterprise Forensic Automation & Multi-Table ORM

Enterprise Forensic Automation
& Type-Safe PostgreSQL ORM

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!

Everything You Need

Enterprise-grade forensic automation and modern ORM features.

👻

Ghost Audit Trail (_forensic_audit_log)

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.

🗂️

Multi-Table Management

Register multiple models in one instance. Access tables intuitively with db[User], db.product, or auto-routed db.insert().

🔗

Pydantic Integration

Define your database schema using Pydantic models. Full type validation and serialization.

⚡

Auto Table Creation

Tables are created and synchronized automatically. Add columns to your model and they're added to the database.

🚀

Async/Await Support

Full async support for all database operations. Non-blocking I/O for high-performance applications.

🔄

Connection Pooling

Built-in connection pooling automatically. Reuses connections for ~5x performance improvement.

🛡️

Type Safety

Full type hints and Pydantic validation. Catch errors at development time, not runtime.

🕵️

Forensic Audit & Soft Delete

Optional ForensicModel for automatic soft delete (status=99) and user audit tracking (create/update/delete timestamps & user IDs).

📊

CRUD Operations

Simple insert, get, update, delete methods. Plus pagination, bulk operations, and transactions.

Stress Test Results

Validated under high-load conditions. 300,000 operations with 100% success rate. Async is 150x faster than Sync in production scenarios.

Async Mode (1,000 Users × 100 Blocks)
30,000ops/sec
Throughput
~5ms
Avg Latency
~10ms
P99
Sync Mode (Same Workload)
200ops/sec
Throughput
~15ms
Avg Latency
~30ms
P99

✓ 300,000 Operations Completed • 100% Success Rate • Async 150x Faster • View Full Report

Quick Start

Three ways to use wpostgresql - choose what fits your needs.

1

Basic CRUD

from wpostgresql import WPostgreSQL
db = WPostgreSQL(Model, config)
db.insert(record)
users = db.get_all()
2

Async Operations

await db.insert_async(rec)
users = await db.get_all_async()
3

Multi-Table

db = WPostgreSQL([User, Product], config)
db[User].insert(user)
products = db.product.get_all()

Install in Seconds

PyPI (Recommended)

pip install wpostgresql

From Source

# Clone and install
git clone https://github.com/wisrovi/wpostgresql
pip install -e .

Dev Dependencies

pip install -e ".[dev]"

Example Projects

Ready-to-use examples for every feature.

228
Tests Passing
95%
Code Coverage
14
Examples
300K+
Stress Ops
1.0.0
LTS Version
3.9+
Python
MIT
License

Author

WS

William Steve Rodriguez Villamizar

AI Leader & Solutions Architect

Building tools that make developers more productive. Creator of multiple open-source Python libraries for data processing and database operations.

Ready to Get Started?

Install wpostgresql and start building type-safe PostgreSQL applications in minutes.