Peewee

Latest version: v3.17.1

Safety actively analyzes 613482 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 23

3.17.1

* Add bitwise and other helper methods to `BigBitField`, 2802.
* Add `add_column_default` and `drop_column_default` migrator methods for specifying a server-side default value, 2803.
* The new `star` attribute was causing issues for users who had a field named star on their models. This attribute is now renamed to `__star__`. 2796.
* Fix compatibility issues with 3.12 related to utcnow() deprecation.
* Add stricter locking on connection pool to prevent race conditions.
* Add adapters and converters to Sqlite to replace ones deprecated in 3.12.
* Fix bug in `model_to_dict()` when only aliases are present.
* Fix version check for Sqlite native drop column support.
* Do not specify a `reconnect=` argument to `ping()` if using MySQL 8.x.

[View commits](https://github.com/coleifer/peewee/compare/3.17.0...3.17.1)

3.17.0

Not secure
* Only roll-back in the outermost `db.transaction` decorator/ctx manager if an unhandled exception occurs. Previously, an unhandled exception that occurred in a nested `transaction` context would trigger a rollback. The use of nested `transaction` has long been discouraged in the documentation: the recommendation is to always use `db.atomic`, which will use savepoints to properly handle nested blocks. However, the new behavior should make it easier to reason about transaction boundaries - see 2767 for discussion.
* Cover transaction `BEGIN` in the reconnect-mixin. Given that no transaction has been started, reconnecting when beginning a new transaction ensures that a reconnect will occur if it is safe to do so.
* Add support for setting `isolation_level` in `db.atomic()` and `db.transaction()` when using Postgres and MySQL/MariaDB, which will apply to the wrapped transaction. Note: Sqlite has supported a similar `lock_type` parameter for some time.
* Add support for the Sqlite `SQLITE_DETERMINISTIC` function flag. This allows user-defined Sqlite functions to be used in indexes and may be used by the query planner.
* Fix unreported bug in dataset import when inferred field name differs from column name.

[View commits](https://github.com/coleifer/peewee/compare/3.16.3...3.17.0)

3.16.3

Not secure
* Support for Cython 3.0.
* Add flag to `ManyToManyField` to prevent setting/getting values on unsaved instances. This is worthwhile, since reading or writing a many-to-many has no meaning when the instance is unsaved.
* Adds a `star()` helper to `Source` base-class for selecting all columns.
* Fix missing `binary` types for mysql-connector and mariadb-connector.
* Add `extract()` method to MySQL `JSONField` for extracting a jsonpath.

[View commits](https://github.com/coleifer/peewee/compare/3.16.2...3.16.3)

3.16.2

Not secure
Fixes a longstanding issue with thread-safety of various decorators, including `atomic()`, `transaction()`, `savepoint()`. The context-managers are unaffected. See 2709 for details.

[View commits](https://github.com/coleifer/peewee/compare/3.16.1...3.16.2)

3.16.1

Not secure
* Add changes required for building against Cython 3.0 and set Cython language-level to 3.
* Ensure indexes aren't added to unindexed fields during introspection, 2691.
* Ensure we don't redundantly select same PK in prefetch when using PREFETCH_TYPE.JOIN.
* In Sqlite migrator, use Sqlite's builtin DROP and RENAME column facilities when possible. This can be overridden by passing `legacy=True` flag.

[View commits](https://github.com/coleifer/peewee/compare/3.16.0...3.16.1)

3.16.0

Not secure
This release contains backwards-incompatible changes in the way Peewee
initializes connections to the underlying database driver. Previously, peewee
implemented autocommit semantics *on-top* of the existing DB-API transactional
workflow. Going forward, Peewee instead places the DB-API driver into
autocommit mode directly.

Why this change?

Previously, Peewee emulated autocommit behavior for top-level queries issued
outside of a transaction. This necessitated a number of checks which had to be
performed each time a query was executed, so as to ensure that we didn't end up
with uncommitted writes or, conversely, idle read transactions. By running the
underlying driver in autocommit mode, we can eliminate all these checks, since
we are already managing transactions ourselves.

Behaviorally, there should be no change -- Peewee will still treat top-level
queries outside of transactions as being autocommitted, while queries inside of
`atomic()` / `with db:` blocks are implicitly committed at the end of the
block, or rolled-back if an exception occurs.

**How might this affect me?**

* If you are using the underlying database connection or cursors, e.g. via `Database.connection()` or `Database.cursor()`, your queries will now be executed in autocommit mode.
* The `commit=` argument is deprecated for the `cursor()`, `execute()` and `execute_sql()` methods.
* If you have a custom `Database` implementation (whether for a database that is not officially supported, or for the purpose of overriding default behaviors), you will want to ensure that your connections are opened in autocommit mode.

Other changes:

* Some fixes to help with packaging in Python 3.11.
* MySQL `get_columns()` implementation now returns columns in their declared order.

[View commits](https://github.com/coleifer/peewee/compare/3.15.4...3.16.0)

Page 1 of 23

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.