Skip to content

# πŸ’ pgmonkey 2.0.0 - Release Notes - pgmonkey just grew up.

Choose a tag to compare

@RexBytes RexBytes released this 13 Feb 16:55
· 68 commits to main since this release
4986ee2

πŸ’ 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: 20

One 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 pgmonkey package proper
  • Manager/Factory/Transport split: PGConnectionManager -> PostgresConnectionFactory -> per-type connection classes
  • Server config generation: Auto-suggest pg_hba.conf and postgresql.conf entries 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 pgimport and pgexport
  • 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 CSV

pgmonkey 2.0.0 - one config to rule them all. πŸ’βœ¨