Skip to content

Releases: coleifer/peewee

3.14.8

28 Oct 14:29
Compare
Choose a tag to compare

Back-out all changes to automatically use RETURNING for SqliteExtDatabase, CSqliteExtDatabase and APSWDatabase. The issue I found is that when a RETURNING cursor is not fully-consumed, any parent SAVEPOINT (and possibly transaction) would not be able to be released. Since this is a backwards-incompatible change, I am going to back it out for now.

Returning clause can still be specified for Sqlite, however it just needs to be done so manually rather than having it applied automatically.

View commits

3.14.7

27 Oct 12:59
Compare
Choose a tag to compare

Fix bug in APSW extension with Sqlite 3.35 and newer, due to handling of last insert rowid with RETURNING. Refs #2479.

View commits

3.14.6

27 Oct 03:06
Compare
Choose a tag to compare

Fix pesky bug in new last_insert_id() on the SqliteExtDatabase.

View commits

3.14.5

27 Oct 03:01
Compare
Choose a tag to compare

Note: this release contained a bug and has been removed from PyPI. Use 3.14.6 or newer.

This release contains a number of bug-fixes and small improvements.

  • Only raise DoesNotExist when lazy_load is enabled on ForeignKeyField, fixes issue #2377.
  • Add missing convenience method ModelSelect.get_or_none()
  • Allow ForeignKeyField to specify a custom BackrefAccessorClass, references issue #2391.
  • Ensure foreign-key-specific conversions are applied on INSERT and UPDATE, fixes #2408.
  • Add handling of MySQL error 4031 (inactivity timeout) to the ReconnectMixin helper class. Fixes #2419.
  • Support specification of conflict target for ON CONFLICT/DO NOTHING.
  • Add encoding parameter to the DataSet freeze() and thaw() methods, fixes #2425.
  • Fix bug which prevented DeferredForeignKey from being used as a model's primary key, fixes #2427.
  • Ensure foreign key's related object cache is cleared when the foreign-key is set to None. Fixes #2428.
  • Allow specification of (schema, table) to be used with CREATE TABLE AS..., fixes #2423.
  • Allow reusing open connections with DataSet, refs #2441.
  • Add highlight() and snippet() helpers to Sqlite SearchField, for use with full-text search extension.
  • Preserve user-provided aliases in column names. Fixes #2453.
  • Add support for Sqlite 3.37 strict tables.
  • Ensure database is inherited when using ThreadSafeDatabaseMetadata, and also adds an implementation in playhouse.shortcuts along with basic unit tests.
  • Better handling of Model's dirty fields when saving, fixes #2466.
  • Add basic support for MariaDB connector driver in playhouse.mysql_ext, refs issue #2471.
  • Begin a basic implementation for a psycopg3-compatible pg database, refs issue #2473.
  • Add provisional support for RETURNING when using the appropriate versions of Sqlite or MariaDB.

View commits

3.14.4

19 Mar 15:54
Compare
Choose a tag to compare

This release contains an important fix for a regression introduced by commit ebe3ad5, which affected the way model instances are converted to parameters for use in expressions within a query. The bug could manifest when code uses model instances as parameters in expressions against fields that are not foreign-keys.

The issue is described in #2376.

View commits

3.14.3

11 Mar 15:06
Compare
Choose a tag to compare

This release contains a single fix for ensuring NULL values are inserted when issuing a bulk-insert of heterogeneous dictionaries which may be missing explicit NULL values. Fixes issue #2638.

View commits

3.14.2

04 Mar 15:06
Compare
Choose a tag to compare

This is a small release mainly to get some fixes out.

  • Support for named Check and foreign-key constraints.
  • Better foreign-key introspection for CockroachDB (and Postgres).
  • Register UUID adapter for Postgres.
  • Add fn.array_agg() to blacklist for automatic value coercion.

View commits

3.14.1

07 Feb 22:52
Compare
Choose a tag to compare

This release contains primarily bugfixes.

  • Properly delegate to a foreign-key field's db_value() function when converting model instances. #2304.
  • Strip quote marks and parentheses from column names returned by sqlite cursor when a function-call is projected without an alias. #2305.
  • Fix DataSet.create_index() method, #2319.
  • Fix column-to-model mapping in model-select from subquery with joins, #2320.
  • Improvements to foreign-key lazy-loading thanks @conqp, #2328.
  • Preserve and handle CHECK() constraints in Sqlite migrator, #2343.
  • Add stddev aggregate function to collection of sqlite user-defined funcs.

View commits

3.14.0

07 Nov 18:48
Compare
Choose a tag to compare

This release has been a bit overdue and there are numerous small improvements
and bug-fixes. The bugfix that prompted this release is #2293, which is a
regression in the Django-inspired .filter() APIs that could cause some
filter expressions to be discarded from the generated SQL. Many thanks for the
excellent bug report, Jakub.

  • Add an experimental helper, shortcuts.resolve_multimodel_query(), for resolving multiple models used in a compound select query.
  • Add a lateral() method to select query for use with lateral joins, refs issue #2205.
  • Added support for nested transactions (savepoints) in cockroach-db (requires 20.1 or newer).
  • Automatically escape wildcards passed to string-matching methods, refs #2224.
  • Allow index-type to be specified on MySQL, refs #2242.
  • Added a new API, converter() to be used for specifying a function to use to convert a row-value pulled off the cursor, refs #2248.
  • Add set() and clear() method to the bitfield flag descriptor, refs #2257.
  • Add support for range types with IN and other expressions.
  • Support CTEs bound to compound select queries, refs #2289.

Bug-fixes

  • Fix to return related object id when accessing via the object-id descriptor, when the related object is not populated, refs #2162.
  • Fix to ensure we do not insert a NULL value for a primary key.
  • Fix to conditionally set the field/column on an added column in a migration, refs #2171.
  • Apply field conversion logic to model-class values. Relocates the logic from issue #2131 and fixes #2185.
  • Clone node before modifying it to be flat in an enclosed nodelist expr, fixes issue #2200.
  • Fix an invalid item assignment in nodelist, refs #2220.
  • Fix an incorrect truthiness check used with save() and only=, refs #2269.
  • Fix regression in filter() where using both *args and **kwargs caused the expressions passed as args to be discarded. See #2293.

View commits

3.13.3

24 Apr 00:36
Compare
Choose a tag to compare
  • Allow arbitrary keyword arguments to be passed to DataSet constructor, which are then passed to the instrospector.
  • Allow scalar subqueries to be compared using numeric operands.
  • Fix bulk_create() when model being inserted uses FK identifiers.
  • Fix bulk_update() so that PK values are properly coerced to the right data-type (e.g. UUIDs to strings for Sqlite).
  • Allow array indices to be used as dict keys, e.g. for the purposes of updating a single array index value.

View commits