Releases: coleifer/peewee
3.14.8
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.
3.14.7
3.14.6
Fix pesky bug in new last_insert_id()
on the SqliteExtDatabase
.
3.14.5
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
whenlazy_load
is enabled on ForeignKeyField, fixes issue #2377. - Add missing convenience method
ModelSelect.get_or_none()
- Allow
ForeignKeyField
to specify a customBackrefAccessorClass
, 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 DataSetfreeze()
andthaw()
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()
andsnippet()
helpers to SqliteSearchField
, 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 inplayhouse.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.
3.14.4
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.
3.14.3
3.14.2
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.
3.14.1
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.
3.14.0
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()
andclear()
method to the bitfield flag descriptor, refs #2257. - Add support for
range
types withIN
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()
andonly=
, refs #2269. - Fix regression in
filter()
where using both*args
and**kwargs
caused the expressions passed asargs
to be discarded. See #2293.
3.13.3
- 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.