# π pgmonkey 2.0.0 - Release Notes - pgmonkey just grew up.
π pgmonkey 2.0.0 - Release Notes
π The Big One. pgmonkey just grew up.
This is a ground-up rethink of how pgmonkey handles PostgreSQL connections. One config file. Four connection modes. Zero confusion.
π₯ Unified Configuration (The Headline Feature)
Gone are the days of juggling separate config files for sync, async, pool, and async pool connections. One YAML file now drives everything.
connection_type: normal # Just flip this: normal | pool | async | async_pool
connection_settings:
host: localhost
port: '5432'
dbname: mydb
# ... all your connection params, once
pool_settings:
min_size: 2
max_size: 10
async_settings:
statement_timeout: '30000'
async_pool_settings:
min_size: 5
max_size: 20One file. Change one string. Get a completely different connection type. Every parameter name matches psycopg/libpq exactly - if you know psycopg, you already know pgmonkey. π§
π§ͺ Comprehensive Test Suite - 113 Unit Tests, No Database Required
We went from "trust me, it works" to 113 unit tests with full mock coverage:
- Connection manager routing (sync vs async path selection)
- Connection factory instantiation for all 4 types
- Individual connection classes (normal, pool, async, async_pool)
- Config loading, filtering, and validation
- Server config generation
- Code generation templates
- Path utilities
All tests run with pytest out of the box - no PostgreSQL instance needed. Async tests gracefully skip when pytest-asyncio isn't installed. Integration tests are portable via environment variables. πͺ
π Python 3.10 - 3.13 Support
Full compatibility across four Python versions. We tracked down and fixed the Path context manager change in Python 3.13 so pgmonkey runs cleanly on the latest runtime. No deprecation warnings, no workarounds.
π Brand New Documentation Site
A completely redesigned docs site with:
- Modern landing page with clear feature overview
- Full API reference
- CLI command guide for
pgconfig,pgserverconfig,pgimport,pgexport - Connection examples for every mode
β‘ CSV Import/Export - Still Fast, Now Smarter
The bulk data tools keep using PostgreSQL's native COPY protocol for maximum throughput, and now benefit from:
- Intelligent encoding auto-detection (BOM + chardet)
- Automatic delimiter sniffing
- Auto-generated sidecar YAML configs for full control over delimiter, quotechar, and encoding
- Blank line handling fixes
- Single-column record import fix
- Blank column detection fix
ποΈ Architecture Improvements
- Clean package layout: CLI and tests moved under the
pgmonkeypackage proper - Manager/Factory/Transport split:
PGConnectionManager->PostgresConnectionFactory-> per-type connection classes - Server config generation: Auto-suggest
pg_hba.confandpostgresql.confentries from your client config - Code generation: Scaffold working connection examples for any mode
π οΈ Bug Fixes & Housekeeping
- Fixed data exporter to respect requested delimiter
- Fixed CSV detection for edge-case file formats
- Pinned PyYAML to resolve dependency build breakage
- Standardised CLI argument style across
pgimportandpgexport - Removed vestigial settings CLI option
- Standardised connection calling in the factory
π¦ Install It
pip install pgmonkey==2.0.0π Try It
pgmonkey pgconfig # Generate a connection config
pgmonkey pgserverconfig # Get server config suggestions
pgmonkey pgimport # Bulk import CSV data
pgmonkey pgexport # Bulk export table to CSVpgmonkey 2.0.0 - one config to rule them all. πβ¨