Releases: coleifer/peewee
4.0.0
- Adds preliminary support for
asynciovia a new playhouse extension. See the documentation for details. PostgresqlDatabasecan usepsycopg(psycopg3) if it is installed. If both psycopg2 and psycopg3 are installed, Peewee will prefer psycopg2, but this can be controlled by specifyingprefer_psycopg3=Truein the constructor. Same applies toPostgresqlExtDatabase.Psycopg3Databaseclass has been moved toplayhouse.postgres_extand is now just a thin wrapper aroundPostgresqlExtDatabase.- Postgres JSON operations no longer dump and try to do minimal casts, instead relying on the driver-provided
Json()wrapper(s). - Adds new
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. - Remove
playhouse.sqlite_ext.ClosureTableimplementation. - Add a
Model.dirty_field_namesattribute that is safe for membership testing, since testingx in dirty_fieldsreturns True if one or more field exists due to operator overloads returning a truthy Expression object. Refs #3028. - Removal of Cython
_sqlite_extextension. The C implementations of the FTS rank functions are moved tosqlite_udf. Most of the remaining functionality is moved toplayhouse.cysqlite_extwhich 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.
3.19.0
- 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.datasetJSON serializer, encode binary data as base64.
3.18.3
3.18.2
Cython 3.1 removes some Python 2 stuff we referenced -- this resolves the
issue. Couple other very minor fixes.
3.18.1
3.18.0
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_urlhelpers, see #2974 for discussion. - Support using
postgresql://URLs when connecting to psycopg3.
3.17.9
- Fix incorrect handling of fk constraint name in migrator.
- Fix test-only issue that can occur in Python 3.14a4.
3.17.8
3.17.7
- Add db_url support for psycopg3 via
psycopg3://. - Ensure double-quotes are escaped properly when introspecting constraints.
- A few documentation-related fixes.
3.17.6
- 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
CASEstatements 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
Connectioninstance. - Fix quoting issue in pwiz that could generate invalid python code for double-quoted string literals used as column defaults.
