Update dependency peewee to v4#368
Open
renovate[bot] wants to merge 1 commit into
Open
Conversation
f79cc78 to
11f7ea9
Compare
e732937 to
f2b2fb3
Compare
2d42a13 to
909f7b7
Compare
ef0fad9 to
de717f6
Compare
c9ba699 to
bd6f7cb
Compare
ca7a53e to
a774d37
Compare
a774d37 to
43e29c7
Compare
43e29c7 to
a3bd430
Compare
a3bd430 to
110ab9e
Compare
110ab9e to
94c407d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
~3.19.0→~4.0.0Release Notes
coleifer/peewee (peewee)
v4.0.8Compare Source
BaseQuery.aexecute()- an async twin ofexecute()available on allquery types, executing through the query's bound async database:
await User.select().aexecute(),await user.tweets.aexecute(). Returnsexactly what
execute()returns, including result rows for DML withRETURNING. Queries remain non-awaitable; this is an ordinary coroutinemethod and the only async method on queries.
playhouse.pwasynciousing "a"-prefixed coroutinecounterparts of the row-level
Modelmethods (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 newAsyncModel/AsyncModelMixinclasses. Each is a thin delegation through the greenletbridge, so behavior is identical to the synchronous implementation.
Note: the
Modelproperty of async databases now returns a base classthat includes these methods - relevant only if you introspect the base
class of
db.Modelsubclasses.afetch()for explicit, awaitable lazy foreign-key resolution:user = await tweet.afetch(Tweet.user). Already-loaded relations (viajoin or prefetch) return immediately without a query.
db.first(query, n=1)async helper.MissingGreenletBridgeerrors now include a hint describing the asyncAPIs to use.
APIs documented in the docs
are stable. The asyncio stress test now also runs in CI.
View commits
v4.0.7Compare Source
playhouse.pwasyncio: report correct UPDATE / DELETE rowcounts onasyncpg, roll back open transactions when connections are returned to the
pool, raise instead of deadlocking when querying during
iterate(), anddetect the MySQL / MariaDB server version.
playhouse.pwasynciofixes: a seconditerate()on a busyconnection raises instead of deadlocking, asyncpg exceptions are translated
to peewee exception types, registered aggregates / collations / window
functions / extensions and
timeoutare applied to async SQLiteconnections,
:memory:databases use a single connection,atomic()accepts transaction arguments (e.g.
lock_type), postgres connection URLsand
isolation_levelare supported,%%in raw SQL is unescaped, andattempting a query outside the greenlet bridge no longer emits "never
awaited" warnings.
playhouse.pydantic_utils: JSON fields validate asAny(nowincluding 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, andrelationshipskeys are validated.JSONFieldto core that provides basic operationsand 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. Seedocs.
May eventually replace the backend-specific implementations with subclasses
that inherit semantics of this new field.
Note:
playhouse.mysql_ext.JSONFieldis now the core field. The oldjson_dumps/json_loadsarguments are renameddumps/loads, theextract()method is removed (use item-access orpath()), and MySQLtables are now created with
JSONcolumns rather thanTEXT.to @abulgher, #3050.
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.6Compare Source
BinaryJSONField: helpers for in-placemodifications (
set,replace,insert,append,update).BinaryJSONField(path_exists,path_match,path_query,path_query_array,path_query_first).fromisoformatas a first attempt since it's faster and more robust.db.connection_context()can be nested cleanly, #3046.pool.close_allandpool.manual_close, #3047.FixedCharField, #3048.View commits
v4.0.5Compare Source
db_value()may not get called in subclasses of PostgresJSONField / BinaryJSONField, refs #3044.
DB drivers. This simplifies checking driver-specific subclasses of standard
DB-API exceptions.
View commits
v4.0.4Compare Source
ImproperlyConfiguredif pg driver unavailable at modeldefinition-time when field db-hooks are used, rather than
AttributeError.View commits
v4.0.3Compare Source
around and trying to group things more clearly. Also added new tests covering
some gaps.
stuff like
.in(a for a in iterable if cond).FOR UPDATEclauses.paginate()method.wrapper.
graphs after multi-table selects.
View commits
v4.0.2Compare Source
db.iterate(query).DataSet module. Previously binary data was encoded as base64, going forward
hex is the new default. For base64 specify
base64_bytes=True.BinaryJSONField, support atomic removal ofsub-elements, as well as alternate helper for extracting sub-elements and
querying array length.
View commits
v4.0.1Compare Source
gr_contextis set on greenlet ingreenlet_spawnso thatcontextvars will be operable in sync handlers.
SqliteExtDatabase(it basically served no purpose in 4.0). UseSqliteDatabaseinstead.corresponding extension module rather than putting all into
playhouse.pool.dumpsoption for postgres JSON fields.View commits
v4.0.0Compare Source
asynciovia a new playhouse extension. Seethe documentation
for details.
PostgresqlDatabasecan usepsycopg(psycopg3) if it is installed. If bothpsycopg2 and psycopg3 are installed, Peewee will prefer psycopg2, but this
can be controlled by specifying
prefer_psycopg3=Truein the constructor.Same applies to
PostgresqlExtDatabase.Psycopg3Databaseclass has been moved toplayhouse.postgres_extand isnow just a thin wrapper around
PostgresqlExtDatabase.relying on the driver-provided
Json()wrapper(s).ISODateTimeFieldfor Sqlite that encodes datetimes in ISO format(more friendly when db is shared with other tools), and also properly reads
back UTC offset info.
playhouse.sqlite_ext.ClosureTableimplementation.Model.dirty_field_namesattribute that is safe for membershiptesting, since testing
x in dirty_fieldsreturns True if one or more fieldexists due to operator overloads returning a truthy Expression object.
Refs #3028.
_sqlite_extextension. The C implementations of the FTSrank functions are moved to
sqlite_udf. Most of the remaining functionalityis moved to
playhouse.cysqlite_extwhich supports it natively.Migrating
CSqliteExtDatabaseusage:You can either use
sqlite_ext.SqliteExtDatabaseor try the newcysqlite_ext.CySqliteDatabaseif you want all the old functionality and arewilling to try a new driver.
View commits
Configuration
📅 Schedule: (UTC)
🚦 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.
This PR was generated by Mend Renovate. View the repository job log.