Releases: tortoise/tortoise-orm
Releases · tortoise/tortoise-orm
v0.15.1
v0.15.0
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.
v0.14.2
v0.14.1
v0.14.0
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()
andQueryset.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 usingindexes
. It works just likeunique_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
andindexes
will correctly map the foreign key if referenced by name.
Deprecations:
import from tortoise.aggregation
is deprecated, please doimport 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
v0.13.11
v0.13.10
v0.13.9
- Fields can have 2nd base class which makes IDEs know python type (str, int, datetime...) of the field.
- The
type
parameter ofField.__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