Skip to content

Releases: tortoise/tortoise-orm

v0.13.2

01 Sep 06:24
Compare
Choose a tag to compare
  • 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

26 Aug 18:27
Compare
Choose a tag to compare
  • Model schema now has a discovery API:

    One can call Tortoise.describe_models() or Tortoise.describe_model(<Model>) to get
    a full description of the model(s).

    Please see tortoise.Tortoise.describe_model and tortoise.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 in credentials 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

15 Aug 07:20
cb2b044
Compare
Choose a tag to compare

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 and ManyToManyField
  • 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

25 Jul 06:24
Compare
Choose a tag to compare

Re-release of v0.12.6 due to a regression in v0.12.7

v0.12.7 (Known broken, please don't use)

23 Jul 07:30
Compare
Choose a tag to compare
  • Support connecting to PostgreSQL via Unix domain socket (simple case).
  • Self-referential Foreign and Many-to-Many keys are now allowed

v0.12.6

21 Jul 10:10
5f6bd8c
Compare
Choose a tag to compare
  • Handle a __models__ variable within modules to override the model discovery mechanism:
    If you define the __models__ variable in yourapp.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.

v0.12.5

10 Jul 14:18
Compare
Choose a tag to compare
  • Using non registered models or wrong references causes an ConfigurationError with a helpful message.
  • make check returns better error message on black errors.

v0.12.4

07 Jul 18:50
Compare
Choose a tag to compare
  • Inherit fields from Mixins, together with abstract model classes. (#147)

v0.12.3

05 Jul 12:49
Compare
Choose a tag to compare
  • Added description attribute to Field class. (#124)
  • Added the ability to leverage field description to generate table column comments and ability to add table level comments (#148 #149)

v0.12.2

18 Jun 12:52
Compare
Choose a tag to compare
  • Fix accidental double order-by for based queries. (#143)