Skip to content

Releases: tortoise/tortoise-orm

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)

v0.12.1

15 Jun 07:07
c984426
Compare
Choose a tag to compare

Bulk insert operation

The bulk insert operation will do the minimum to ensure that the object created in the DB has all the defaults and generated fields set, but may be incomplete reference in Python.

e.g. IntField primary keys will not be poplulated.

This is recommend only for throw away inserts where you want to ensure optimal insert performance.

User.bulk_create([
    User(name="...", email="..."),
    User(name="...", email="...")
])

Also: Notable efficiency improvement for regular inserts

v0.12.0

11 Jun 10:59
Compare
Choose a tag to compare

Tortoise ORM now supports non-autonumber primary keys.

This is a big feature change. It should not break any existing implementations.

We currently support single (non-composite) primary keys of any indexable field type, but only these field types are recommended:

  • IntField
  • BigIntField
  • CharField
  • UUIDField

The primary key will be accessible through a reserved field pk which will be an alias of whichever field has been nominated as a primary key.
The alias field can be used as a field name when doing filtering e.g. .filter(pk=...) etc...

One must define a primary key by setting a pk parameter to True.
If you don't define a primary key, we will create a primary key of type IntField with name of id for you.

v0.11.13

05 Jun 15:39
af5a6c3
Compare
Choose a tag to compare
  • Fixed connection retry to work with transactions
  • Added broader PostgreSQL connection failure detection

v0.11.12

05 Jun 15:39
Compare
Choose a tag to compare
  • Added automatic PostgreSQL connection retry

v0.11.11

15 May 21:22
a5cdb78
Compare
Choose a tag to compare
  • Extra parameters now get passed through to the MySQL & PostgreSQL drivers