Peewee v2.5.0 Release Notes

  • ๐Ÿ‘€ There are a couple new features so I thought I'd bump to 2.5.x. One change Postgres users may be happy to see is the use of INSERT ... RETURNING to perform inserts. This should definitely speed up inserts for Postgres, since an extra query is no longer needed to get the new auto-generated primary key.

    โœ… I also added a new context manager/decorator that allows you to use a different database for the duration of the wrapped block.

    ๐Ÿ› Bugs fixed

    • #534, CSV utils was erroneously stripping the primary key from CSV data.
    • #537, fix upserts when using insert_many.
    • โช #541, respect autorollback with PostgresqlExtDatabase. Thanks @davidmcclure.
    • #551, fix for QueryResultWrapper's implementation of the iterator protocol.
    • #554, allow SQLite journal_mode to be set at run-time.
    • ๐Ÿ›  Fixed case-sensitivity issue with DataSet.

    ๐Ÿ†• New features

    • โž• Added support for CAST expressions.
    • โž• Added a hook for extending Node with custom methods.
    • JOIN_<type> became JOIN.<type>, e.g. .join(JOIN.LEFT_OUTER).
    • OP_<code> became OP.<code>.
    • ๐Ÿ›  #556, allowed using + and - prefixes to indicate ascending/descending ordering.
    • โœ… #550, added Database.initialize_connection() hook.
    • #549, bind selected columns to a particular model. Thanks @jhorman, nice PR!
    • โœ… #531, support for swapping databases at run-time via Using.
    • ๐Ÿ‘ #530, support for SQLCipher and Python3.
    • ๐Ÿ†• New RowIDField for sqlite_ext playhouse module. This field can be used to interact with SQLite rowid fields.
    • โž• Added LateralJoin helper to the postgres_ext playhouse module.
    • ๐Ÿ†• New example blog app.

    View commits