Releases: tortoise/tortoise-orm
Releases · tortoise/tortoise-orm
v0.13.2
-
Security fixes for
«model».save()
&«model».dete()
:
This is now fully parametrized, and these operations are no longer susceptible to escaping issues. -
Performance improvements:
- Simple update is now ~3-6× faster
- Partial update is now ~3× faster
- Delete is now ~2.7x faster
- Fix generated Schema Primary Key for
BigIntField
for MySQL and PostgreSQL. - Added support for using a
SmallIntField
as a auto-gen Primary Key. - Ensure that default PK is added to the top of the attrs.
v0.13.1
-
Model schema now has a discovery API:
One can call
Tortoise.describe_models()
orTortoise.describe_model(<Model>)
to get
a full description of the model(s).Please see
tortoise.Tortoise.describe_model
andtortoise.Tortoise.describe_models
for more info.
- Fix in generating comments for Foreign Keys in
MySQL
- Added schema support for PostgreSQL. Either set
"schema": "custom"
var incredentials
or as a query parameter?schema=custom
- Default MySQL charset to
utf8mb4
. If a charset is provided it will also force the TABLE charset to the same.
v0.13.0
Warning:
This release brings with it, deprecation of Python 3.5
We will increase the minimum supported version of Python to 3.6, as 3.5 is reaching end-of-life,
and is missing many useful features for async applications.
We will discontinue Python 3.5 support on the next major release (Likely 0.14.0)
New Features:
- Example Sanic integration along with register_tortoise hook in contrib (#163)
.values()
and.values_list()
now default to all fields if none are specified.generate_schema()
now generates well-formatted DDL SQL statements.- Added
TruncationTestCase
testing class that truncates tables to allow faster testing of transactions. - Partial saves are now supported (#157):
obj.save(update_fields=['model','field','names'])
Bugfixes:
- Fixed state leak between database drivers which could cause incorrect DDL generation.
- Fixed missing table/column comment generation for
ForeignKeyField
andManyToManyField
- Fixed comment generation to escape properly for SQLite
- Fixed comment generation for PostgreSQL to not duplicate comments
- Fixed generation of schema for fields that defined custom
source_field
values defined - Fixed working with Models that have fields with custom
source_field
values defined - Fixed safe creation of M2M tables for MySQL dialect (#168)
Docs/examples:
- Examples have been reworked:
- Simplified init of many examples
- Re-did
generate_schema.py
example - A new
relations_recirsive.py
example (turned into test case)
- Lots of small documentation cleanups
v0.12.8
v0.12.7 (Known broken, please don't use)
- Support connecting to PostgreSQL via Unix domain socket (simple case).
- Self-referential Foreign and Many-to-Many keys are now allowed
v0.12.6
- Handle a
__models__
variable within modules to override the model discovery mechanism:
If you define the__models__
variable inyourapp.models
(or wherever you specify to load your models from),
generate_schema()
will use that list, rather than automatically finding all models for you. - Split model consructor into from-Python and from-DB paths, leading to 15-25% speedup for large fetch operations.
- More efficient queryset manipulation, 5-30% speedup for small fetches.