github coleifer/peewee 4.0.0

6 hours ago
  • Adds preliminary support for asyncio via a new playhouse extension. See the documentation for details.
  • PostgresqlDatabase can use psycopg (psycopg3) if it is installed. If both psycopg2 and psycopg3 are installed, Peewee will prefer psycopg2, but this can be controlled by specifying prefer_psycopg3=True in the constructor. Same applies to PostgresqlExtDatabase.
  • Psycopg3Database class has been moved to playhouse.postgres_ext and is now just a thin wrapper around PostgresqlExtDatabase.
  • Postgres JSON operations no longer dump and try to do minimal casts, instead relying on the driver-provided Json() wrapper(s).
  • Adds new ISODateTimeField for Sqlite that encodes datetimes in ISO format (more friendly when db is shared with other tools), and also properly reads back UTC offset info.
  • Remove playhouse.sqlite_ext.ClosureTable implementation.
  • Add a Model.dirty_field_names attribute that is safe for membership testing, since testing x in dirty_fields returns True if one or more field exists due to operator overloads returning a truthy Expression object. Refs #3028.
  • Removal of Cython _sqlite_ext extension. The C implementations of the FTS rank functions are moved to sqlite_udf. Most of the remaining functionality is moved to playhouse.cysqlite_ext which supports it natively.

Migrating CSqliteExtDatabase usage:

You can either use sqlite_ext.SqliteExtDatabase or try the new
cysqlite_ext.CySqliteDatabase if you want all the old functionality and are
willing to try a new driver.

View commits

Don't miss a new peewee release

NewReleases is sending notifications on new releases.