Releases: tortoise/tortoise-orm
Releases · tortoise/tortoise-orm
v0.13.6
v0.13.5
v0.13.4
v0.13.3
- Fixed installing Tortoise-ORM in non-unicode systems. (#180)
«queryset».update(…)now correctly uses the DB-specificto_db_value()fetch_related(…)now correctly encodes non-integer keys.ForeignKeyfields of typeUUIDFieldare now escaped consistently.- Pre-generated ForeignKey fields (e.g.
UUIDField) is now checked for persistence correctly. - Duplicate M2M
.add(…)now checks using consistent field encoding. source_fieldFields are now handled correctly for ordering.source_fieldFields are now handled correctly for updating.
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
BigIntFieldfor MySQL and PostgreSQL. - Added support for using a
SmallIntFieldas 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_modelandtortoise.Tortoise.describe_modelsfor more info.
- Fix in generating comments for Foreign Keys in
MySQL - Added schema support for PostgreSQL. Either set
"schema": "custom"var incredentialsor 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
TruncationTestCasetesting 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
ForeignKeyFieldandManyToManyField - 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_fieldvalues defined - Fixed working with Models that have fields with custom
source_fieldvalues 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.pyexample - A new
relations_recirsive.pyexample (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.