Skip to content

Update dependency peewee to v4#368

Open
renovate[bot] wants to merge 1 commit into
masterfrom
renovate/peewee-4.x
Open

Update dependency peewee to v4#368
renovate[bot] wants to merge 1 commit into
masterfrom
renovate/peewee-4.x

Conversation

@renovate

@renovate renovate Bot commented Feb 20, 2026

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
peewee (changelog) ~3.19.0~4.2.0 age confidence

Release Notes

coleifer/peewee (peewee)

v4.2.1

Compare Source

Can't ship a stub that's not complete. Missed moving server_side_cursor()
helper into the core psycopg helper.

View commits

v4.2.0

Compare Source

  • Add django-style filter lookups: contains, startswith, endswith,
    between, is_null, not_in and iregexp.
  • Fix SQLite index value inlining to apply properly.
  • Fix PostgresqlDatabase(isolation_level=...) having no effect on
    transactions. Previously only atomic(isolation_level=...) worked.
  • Fix Ordering.collate() dropping the nulls= ordering.
  • Fix double-escaping of backticks in MySQL get_indexes().
  • Honor the windows= parameter of the Select constructor.
  • Remove vestigial Python 2 compat (reraise(), __div__, __nonzero__)
    and assorted dead internal code.
  • Remove TimestampField.local_to_utc() and TimestampField.utc_to_local().
  • Select.columns() no longer accepts and ignores keyword arguments.
  • Remove unused Metadata.get_rel_for_model().
  • Fix SelectBase.exists() ignoring its database argument.
  • Fix CursorWrapper indexing: cursor[n] raised IndexError for uncached
    rows and cursor[0] fetched the entire result set.
  • Fix .namedtuples() crashing on selected columns that are not valid
    Python identifiers.
  • Preserve materialized= when compounding CTEs via union()/union_all().
  • Fix ManyToManyField reads when the through-model foreign keys use the
    '!' backref sentinel.
  • Fix connection pooling with the mariadb connector - pooled connections
    were discarded on every checkout.
  • Fix sqliteq stop() to drain the write queue and return True.
  • Fix apsw aggregate registration binding every name to the last-registered
    aggregate class.
  • Fix two NameErrors in cysqlite_ext: blob_open() and progress().
  • Fix pwiz emitting an invalid attr= keyword instead of
    on_delete/on_update for reflected foreign keys.
  • Fix dataset infinite loop on self-referential foreign keys, crash on
    headerless CSV import, thaw() validating against export rather than
    import formats, and the importer mutating live model metadata.
  • Fix model_to_dict to honor only=/exclude= for many-to-many fields,
    fix resolve_multimodel_query on queries with narrowed selections.
  • Fix signals.Model.save(True) reporting created=False when
    force_insert is passed positionally.
  • Fix CompressedField crashing on str values.
  • Fix psycopg3 server-side cursors (missing withhold) and CockroachDB
    run_transaction retry detection under psycopg3.
  • Async queries are now logged to the peewee logger.
  • Remove dead code and unused imports throughout playhouse; remove the
    broken, unused get_current_url/get_next_url helpers from
    flask_utils.
  • Fix delete_instance(recursive=True) failing to cascade to the children
    of a model reachable through both nullable and non-nullable foreign-keys.
  • Fix subqueries losing their parentheses when used as a CASE value inside
    a single-argument function call, e.g. fn.SUM(Case(...)).
  • Fix plain-Table inserts on returning-clause databases binding the
    primary-key name as a parameter and returning None instead of the new id.
  • CompositeKey comparisons raise ValueError when the value's length does
    not match the key, rather than silently matching on a prefix.
  • Async: connection-acquisition errors are translated to peewee exception
    types, matching query execution.
  • Fix FieldAlias.model to reference the model alias rather than the aliased
    model; alias-rooted join queries no longer construct and discard a spurious
    instance of the aliased model for every result row.
  • Fix playhouse.postgres_ext.JSONField creating jsonb columns after the
    core postgres backend began mapping the JSON field-type to JSONB; its DDL
    is json again, and json-vs-jsonb function selection for chained lookups
    now follows the field's declared datatype.
  • Unaliased expressions in join queries now hydrate using the same cleaned
    attribute name as flat queries (e.g. COUNT rather than COUNT(1).
  • Field.__hash__ is keyed on the model's schema and table-name rather than
    its class name, so same-named model classes (factories, separate modules,
    schema-per-tenant layouts) no longer collide in field-keyed registries such
    as backrefs; redefining or re-importing a model in place still replaces
    its entries.
  • Fix UnboundLocalError when joining from a model-less source to a model,
    e.g. join_from(cte, SomeModel, on=...); the joined instance is stored in
    the source's row dict, keyed by the model name.
  • BlobField, CompressedField and the sqlite_udf.gzip() function encode
    str values using utf-8 instead of raw_unicode_escape. Behavior change
    for non-ASCII strings: characters
    above the latin-1 range are no longer mangled into literal escape
    sequences, but blobs written from non-ASCII strings by earlier versions
    will not compare equal to newly-written ones.

View commits

v4.1.2

Compare Source

  • Ensure quotes escaped in SQLite introspection methods, thanks @​greymoth-jp
    for reporting and the initial patch.
  • Allow TimestampField to accept an iso-formatted str.
  • Add key-existence predicates (has_key, has_keys, has_any_keys) to the
    core JSONField on SQLite, implemented with json_type().
  • Add containment predicates (contains, contained_by) to the core
    JSONField on SQLite via a registered _pw_json_contains UDF that emulates
    Postgres' @> semantics (structural, level-aligned). The core JSONField
    now has full predicate parity across SQLite, Postgres, and MySQL/MariaDB.

View commits

v4.1.1

Compare Source

  • New declarative API for pre-fetching related instances (Load()). See
    documentation.
    This replaces prefetch(), is more flexible and also supports options for
    applying a row limit to sub-results, and a strategy that materializes the ID
    list (in addition to SELECT IN and JOIN strategies).
  • Add MySQLJSONField (playhouse.mysql_ext) with contains_any() for the
    JSON_OVERLAPS/"match any" counterpart to contains for JSON arrays.
  • Do not traverse foreign-key fields where lazy_load=False when serializing
    recursively with model_to_dict(), #​3055.
  • Add vendored typeshed stub with improvements.

View commits

v4.1.0

Compare Source

  • Unfortunately, the new JSONField did not play nice w/MySQL when query was
    generated before a conn was opened. We were trying to do some introspection
    on the server version, but I've decided instead to make mariadb= be a
    database param, per @​alisonatwork's suggestion, with the default being
    "MySQL" flavored JSON. Refs #​3053
  • JSONField containment (contains, contained_by) no longer wraps its
    argument in CAST / JSON_COMPACT on MySQL/MariaDB, #​3053.

View commits

v4.0.9

Compare Source

  • Ensure new JSONField can be inherited, #​3052

View commits

v4.0.8

Compare Source

  • Add BaseQuery.aexecute() - an async twin of execute() available on all
    query types, executing through the query's bound async database:
    await User.select().aexecute(), await user.tweets.aexecute(). Returns
    exactly what execute() returns, including result rows for DML with
    RETURNING. Queries remain non-awaitable; this is an ordinary coroutine
    method and the only async method on queries.
  • Add async model methods to playhouse.pwasyncio using "a"-prefixed coroutine
    counterparts of the row-level Model methods (acreate, aget,
    aget_or_none, aget_by_id, aget_or_create, aset_by_id,
    adelete_by_id, abulk_create, abulk_update, asave,
    adelete_instance), available via the new AsyncModel /
    AsyncModelMixin classes. Each is a thin delegation through the greenlet
    bridge, so behavior is identical to the synchronous implementation.
    Note: the Model property of async databases now returns a base class
    that includes these methods - relevant only if you introspect the base
    class of db.Model subclasses.
  • Add afetch() for explicit, awaitable lazy foreign-key resolution:
    user = await tweet.afetch(Tweet.user). Already-loaded relations (via
    join or prefetch) return immediately without a query.
  • Add db.first(query, n=1) async helper.
  • MissingGreenletBridge errors now include a hint describing the async
    APIs to use.
  • The asyncio extension is no longer considered preliminary - the async
    APIs documented in the docs
    are stable. The asyncio stress test now also runs in CI.

View commits

v4.0.7

Compare Source

  • Fixes for playhouse.pwasyncio: report correct UPDATE / DELETE rowcounts on
    asyncpg, roll back open transactions when connections are returned to the
    pool, raise instead of deadlocking when querying during iterate(), and
    detect the MySQL / MariaDB server version.
  • Additional playhouse.pwasyncio fixes: a second iterate() on a busy
    connection raises instead of deadlocking, asyncpg exceptions are translated
    to peewee exception types, registered aggregates / collations / window
    functions / extensions and timeout are applied to async SQLite
    connections, :memory: databases use a single connection, atomic()
    accepts transaction arguments (e.g. lock_type), postgres connection URLs
    and isolation_level are supported, %% in raw SQL is unescaped, and
    attempting a query outside the greenlet bridge no longer emits "never
    awaited" warnings.
  • Fixes for playhouse.pydantic_utils: JSON fields validate as Any (now
    including the sqlite_ext JSONField), foreign keys may be included /
    excluded by field name or column name, server-side defaults like
    SQL('CURRENT_TIMESTAMP') are no longer emitted as schema defaults, and
    relationships keys are validated.
  • Add a new cross-backend JSONField to core that provides basic operations
    and also more consistent behavior when reading data. By default the new core
    JSONField treats extracted values as JSON, which is generally the correct
    thing, but "text-mode" is available as a chained .as_text() method. See
    docs.
    May eventually replace the backend-specific implementations with subclasses
    that inherit semantics of this new field.
    Note: playhouse.mysql_ext.JSONField is now the core field. The old
    json_dumps / json_loads arguments are renamed dumps / loads, the
    extract() method is removed (use item-access or path()), and MySQL
    tables are now created with JSON columns rather than TEXT.
  • Eliminate use of deprecated params when connecting to MySQL databases, thanks
    to @​abulgher, #​3050.
  • Using fromisoformat() ended up causing previously-unconverted strings (Ymd)
    to be converted in some cases, e.g. formatting a datetime as a str (#​3051).
    The change I made to address this is to make explicit casts on function calls
    not attempt any heuristic python-value conversion. This makes it more natural
    to call fn.whatever().cast('text') and you predictably get text out.

View commits

v4.0.6

Compare Source

  • Add new methods to the postgres BinaryJSONField: helpers for in-place
    modifications (set, replace, insert, append, update).
  • Also add json-path helpers to the postgres BinaryJSONField (path_exists,
    path_match, path_query, path_query_array, path_query_first).
  • Quote path elements in SQLite's JSON field.
  • Better and faster parsing of formatted date/times. Use the stdlib
    fromisoformat as a first attempt since it's faster and more robust.
  • Ensure db.connection_context() can be nested cleanly, #​3046.
  • Fix potential deadlock in pool.close_all and pool.manual_close, #​3047.
  • Restore whitespace stripping in FixedCharField, #​3048.

View commits

v4.0.5

Compare Source

  • Fix bug where db_value() may not get called in subclasses of Postgres
    JSONField / BinaryJSONField, refs #​3044.
  • Fix bug where indexes for table may be defined on multiple schema, #​3043.
  • Always fall-through to base exception class if exception is not recognized in
    DB drivers. This simplifies checking driver-specific subclasses of standard
    DB-API exceptions.

View commits

v4.0.4

Compare Source

  • Fix SQL generation for partial indexes with nulls (not) distinct clause.
  • Raise an ImproperlyConfigured if pg driver unavailable at model
    definition-time when field db-hooks are used, rather than AttributeError.

View commits

v4.0.3

Compare Source

  • Refactor test suite - this was a mechanical refactor, just moving things
    around and trying to group things more clearly. Also added new tests covering
    some gaps.
  • Expand multi-value types to include generator expressions, so you can write
    stuff like .in(a for a in iterable if cond).
  • Ensure quotes embedded in entity names are escaped.
  • Improved specification of FOR UPDATE clauses.
  • Fix for negative values in paginate() method.
  • Fix for newer MySQL server versions in feature detection code.
  • More robust handling of unusual aliases / invalid attr names in cursor
    wrapper.
  • Better handling of duplicated column names in cursor wrapper implementations.
  • Improve performance of ModelCursorWrapper when reconstructing model instance
    graphs after multi-table selects.
  • If only psycopg3 is installed, use it by default (#​3036)

View commits

v4.0.2

Compare Source

  • Remove all Python 2.x compatibility code.
  • Add streaming result cursors to pwasyncio module via db.iterate(query).
  • Better serialization and deserialization of datetimes and binary data in the
    DataSet module. Previously binary data was encoded as base64, going forward
    hex is the new default. For base64 specify base64_bytes=True.
  • Improvements to Postgres BinaryJSONField, support atomic removal of
    sub-elements, as well as alternate helper for extracting sub-elements and
    querying array length.
  • Pydantic integration

View commits

v4.0.1

Compare Source

  • Ensure gr_context is set on greenlet in greenlet_spawn so that
    contextvars will be operable in sync handlers.
  • Removed SqliteExtDatabase (it basically served no purpose in 4.0). Use
    SqliteDatabase instead.
  • Moved driver and extension-specific pooled implementations into the
    corresponding extension module rather than putting all into playhouse.pool.
  • Restore custom dumps option for postgres JSON fields.
  • Major docs rewrite / reorganization.

View commits

v4.0.0

Compare Source

  • 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


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate Bot force-pushed the renovate/peewee-4.x branch from f79cc78 to 11f7ea9 Compare March 1, 2026 22:07
@renovate renovate Bot force-pushed the renovate/peewee-4.x branch 3 times, most recently from e732937 to f2b2fb3 Compare March 16, 2026 12:53
@renovate renovate Bot force-pushed the renovate/peewee-4.x branch 2 times, most recently from 2d42a13 to 909f7b7 Compare March 27, 2026 01:03
@renovate renovate Bot force-pushed the renovate/peewee-4.x branch 3 times, most recently from ef0fad9 to de717f6 Compare April 6, 2026 17:55
@renovate renovate Bot force-pushed the renovate/peewee-4.x branch 3 times, most recently from c9ba699 to bd6f7cb Compare April 23, 2026 22:29
@renovate renovate Bot force-pushed the renovate/peewee-4.x branch 2 times, most recently from ca7a53e to a774d37 Compare May 20, 2026 14:37
@renovate renovate Bot force-pushed the renovate/peewee-4.x branch from a774d37 to 43e29c7 Compare May 24, 2026 17:17
@renovate renovate Bot force-pushed the renovate/peewee-4.x branch from 43e29c7 to a3bd430 Compare June 4, 2026 05:07
@renovate renovate Bot force-pushed the renovate/peewee-4.x branch 4 times, most recently from 7bce7a9 to 1d7e6f8 Compare June 16, 2026 19:13
@renovate renovate Bot force-pushed the renovate/peewee-4.x branch 2 times, most recently from ac149f5 to 24214d3 Compare July 4, 2026 13:36
@renovate renovate Bot force-pushed the renovate/peewee-4.x branch 2 times, most recently from 5e3c997 to 7aad88e Compare July 9, 2026 20:13
@renovate renovate Bot force-pushed the renovate/peewee-4.x branch from 7aad88e to 7acf436 Compare July 13, 2026 01:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants