Skip to content

Releases: tortoise/tortoise-orm

v0.15.1

25 Nov 10:11
Compare
Choose a tag to compare
  • Handle OR'ing a blank Q() correctly (#240)

v0.15.0

23 Nov 22:09
Compare
Choose a tag to compare

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.

v0.14.2

11 Nov 15:33
Compare
Choose a tag to compare
  • A Field name of alias is now no longer reserved.
  • Restored support for inheriting from Abstract classes. Order is now also deterministic,
    with the inherited classes' fields being placed before the current.

v0.14.1

07 Nov 06:25
Compare
Choose a tag to compare
  • ManyToManyField is now a function that has the type of the relation for autocomplete,
    this allows for better type hinting at less effort.
  • Added section on adding better autocomplete for relations in editors.

v0.14.0

27 Oct 06:54
Compare
Choose a tag to compare

Caution:

This release drops support of Python 3.5:
Tortoise ORM now requires a minimum of CPython 3.6 or PyPy3.6-7.1

Enhancements:

  • Models, Fields & QuerySets have significant type annotation improvements,
    leading to better IDE integration and more comprehensive static analysis.
  • Fetching records from the DB is now up to 25% faster.
  • Database functions Trim(), Length(), Coalesce(), Lower(), Upper() added to tortoise.functions module.
  • Annotations can be selected inside Queryset.values() and Queryset.values_list() expressions.
  • Added support for Python 3.8
  • The Foreign Key property is now await-able as long as one didn't populate it via .prefetch_related()
  • One can now specify compound indexes in the Meta: class using indexes. It works just like unique_toghether.

Bugfixes:

  • The generated index name now has significantly lower chance of collision.
  • The compiled SQL query contains HAVING and GROUP BY only for aggregation functions.
  • Fields for FK relations are quoted properly.
  • Fields are quoted properly in UNIQUE statements.
  • Fields are quoted properly in KEY statements.
  • Comment Fields are quoted properly in PostgreSQL dialect.
  • unique_together and indexes will correctly map the foreign key if referenced by name.

Deprecations:

  • import from tortoise.aggregation is deprecated, please do import from tortoise.functions instead.

Breaking Changes:

  • The hash used to make generated indexes unique has changed.
    The old algorithm had a very high chance of collisions,
    the new hash algorithm is much better in this regard.
  • Dropped support for Python 3.5

v0.13.12

10 Oct 19:12
Compare
Choose a tag to compare
  • Reverted "The Field class now calls super().__init__, so mixins are properly initialised." as it was causing issues on Python 3.6.

v0.13.11

10 Oct 10:52
Compare
Choose a tag to compare
  • Fixed the _FieldMeta class not to checking if the 1st base class was Field, so would break with mixins.
  • The Field class now calls super().__init__, so mixins are properly initialised.

v0.13.10

01 Oct 18:55
c87bbc2
Compare
Choose a tag to compare
  • Names ForeignKey constraints in a consistent way

v0.13.9

01 Oct 07:34
e0fea4f
Compare
Choose a tag to compare
  • Fields can have 2nd base class which makes IDEs know python type (str, int, datetime...) of the field.
  • The type parameter of Field.__init__ is removed, instead we use the 2nd base class
  • Foreign keys and indexes are now defined correctly in MySQL so that they take effect as expected
  • MySQL now doesn't warn of unsafe index creation anymore
  • Support alternate MySQL DB engines, such as MyISAM

v0.13.8

25 Sep 06:01
Compare
Choose a tag to compare
  • Fixed bug in schema creation for MySQL where non-integer Primary-Keys did not get declared properly (#195)