Skip to content

v4.5.0

Choose a tag to compare

@nhumrich nhumrich released this 21 Oct 23:05
· 41 commits to main since this release

New Features

  • Row class: New dict subclass with attribute access support
    • Access values with dot notation: row.name or dict syntax: row['name']
    • Fully compatible with dict operations (keys, values, items, etc.)
    • Nice repr for debugging

Breaking Changes

  • map_results() return type: Now returns List[Row] instead of mutating in place
    • Before: query.map_results(rows) mutated rows in place
    • After: results = query.map_results(rows) returns new Row objects
    • Migration: Update code to use the return value instead of relying on mutation

Bug Fixes

  • asyncpg Record support: Fixed issue where immutable asyncpg Records would crash map_results
    • Now converts all input types (dict, Record, etc.) to Row objects
    • Consistent API regardless of database driver

Why This Change

asyncpg Record objects are immutable C extensions that cannot be modified in place. The new Row class provides a consistent, mutable return type with a nicer API (attribute access) while maintaining full dict compatibility.