github tortoise/tortoise-orm 0.15.0
v0.15.0

latest releases: 0.20.0, 0.19.3, 0.19.2...
4 years ago

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 and maxsize 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 to Q() 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() or async 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.

Don't miss a new tortoise-orm release

NewReleases is sending notifications on new releases.