New features:
- Pooling has been implemented, allowing for multiple concurrent databases and all the benefits that comes with it.
- Enabled by default for databases that support it (mysql and postgres) with a minimum pool size of 1, and a maximum of 5
- Not supported by sqlite
- Can be changed by passing the
minsize
andmaxsize
connection parameters
- Many small performance tweaks:
- Overhead of query generation has been reduced by about 6%
- Bulk inserts are ensured to be wrapped in a transaction for >50% speedup
- PostgreSQL prepared queries now use a LRU cache for significant >2x speedup on inserts/updates/deletes
DateField
&DatetimeField
deserializes faster on PostgreSQL & MySQL.- Optimized
.values()
to do less copying, resulting in a slight speedup. - One can now pass kwargs and
Q()
objects as parameters toQ()
objects simultaneously.
Bugfixes:
indexes
will correctly map the foreign key if referenced by name.- Setting DB generated PK in constructor/create generates exception instead of silently being ignored.
Deprecations:
-
start_transaction
is deprecated, please use@atomic()
orasync with in_transaction():
instead. -
This release brings with it, deprecation of Python 3.6 / PyPy-3.6:
This is due to small differences with how the backported
aiocontextvars
behaves
in comparison to the built-in in Python 3.7+.There is a known context confusion, specifically regarding nested transactions.