Skip to content

Releases: coleifer/peewee

4.0.0

20 Feb 16:50

Choose a tag to compare

  • 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

3.19.0

07 Jan 17:27

Choose a tag to compare

  • Move to new build system using pyproject and github actions.
  • No longer build and ship the Sqlite C extensions by default. Users who prefer to use those can install via the sdist pip install peewee --no-binary :all:.

Rationale about the Sqlite C extensions -- I've started shipping pysqlite3 as a
statically-linked, self-contained binary wheel. This means that when using
Peewee with the statically-linked pysqlite3, you can end up in a funny
situation where the peewee Sqlite extensions are linked against the system
libsqlite3, and the pysqlite driver has it's own Sqlite embedded, which does
not work.

If you are using the system/standard-lib sqlite3 module then the extension
works properly, because everything is talking to the same libsqlite3.

Similarly if you built pysqlite3 to link against the system libsqlite3
everything also works correctly, though this is not "wheel-friendly".

So in order to use the C extensions, you can install Peewee from the sdist and
do either of the following:

# Use system sqlite and standard-lib `sqlite3` module.
$ pip install peewee --no-binary :all:

# OR,
# Use pysqlite3 linked against the system sqlite.
$ pip install pysqlite3 peewee --no-binary :all:

I don't believe, besides myself, there were many people using these extensions
so hopefully this change is not disruptive! Please let me hear about it if I'm
mistaken.

Other small changes:

  • When exporting / "freezing" binary data with the playhouse.dataset JSON serializer, encode binary data as base64.

3.18.3

23 Dec 16:22

Choose a tag to compare

  • Fix potential regex DoS vulnerability in FTS5 query validation code (#3005).

View commits

3.18.2

23 Dec 16:22

Choose a tag to compare

Cython 3.1 removes some Python 2 stuff we referenced -- this resolves the
issue. Couple other very minor fixes.

View commits

3.18.1

30 Apr 15:45

Choose a tag to compare

This was just to fix a packaging problem caused by twine.

@pypa is such a bunch of clowns. I swear.

View commits

3.18.0

29 Apr 12:50

Choose a tag to compare

The behavior of postgresql_ext.BinaryJSONField.contains() has changed.
Previously, passing a string to this method would perform a JSON key exists
check (? operator) instead of JSON contains (@> operator). As of 3.18.0,
this special-case has been removed and the contains() method always uses
the JSONB contains operator (@>). For the old behavior of checking
whether a key exists, use the BinaryJSONField.has_key() method. See #2984 for
discussion.

  • Add options to URL-unquote user and password when using the db_url helpers, see #2974 for discussion.
  • Support using postgresql:// URLs when connecting to psycopg3.

View commits

3.17.9

12 Feb 17:04

Choose a tag to compare

  • Fix incorrect handling of fk constraint name in migrator.
  • Fix test-only issue that can occur in Python 3.14a4.

View commits

3.17.8

12 Nov 16:59

Choose a tag to compare

  • Fix regression in behavior of delete_instance() when traversing nullable foreign-keys, #2952. Introduced in 3.17.6. Recommended that you update.
  • Fix bug where joins not cloned when going from join-less -> joined query, refs #2941.

3.17.7

15 Oct 12:42

Choose a tag to compare

  • Add db_url support for psycopg3 via psycopg3://.
  • Ensure double-quotes are escaped properly when introspecting constraints.
  • A few documentation-related fixes.

View commits

3.17.6

06 Jul 17:14

Choose a tag to compare

  • Fix bug in recursive model.delete_instance() when a table contains foreign-keys at multiple depths of the graph, #2893.
  • Fix regression in pool behavior on systems where time.time() returns identical values for two connections. This adds a no-op comparable sentinel to the heap to prevent any recurrence of this problem, #2901.
  • Ensure that subqueries inside CASE statements generate correct SQL.
  • Fix regression that broke server-side cursors with Postgres (introduced in 3.16.0).
  • Fix to ensure compatibility with psycopg3 - the libpq TransactionStatus constants are no longer available on the Connection instance.
  • Fix quoting issue in pwiz that could generate invalid python code for double-quoted string literals used as column defaults.

View commits