Releases: tortoise/tortoise-orm
Releases · tortoise/tortoise-orm
0.15.11
v0.15.10
v0.15.9
v0.15.8
TextField
now recommends usage ofCharField
if wanting unique indexing instead of just saying "indexing not supported".count()
now honours offset and limit (#167)- Testing un-awaited
ForeignKeyField
as a boolean expression will automatically resolve asFalse
if it is None (#274) - Awaiting a nullable
ForeignKeyField
won't touch the DB if it isNone
(#274)
v0.15.7
QuerySet.Update()
now returns the count of the no of rows affected. Note, thatQuerySet.Delete()
now returns the count of the no of rows deleted.- Note that internal API of
db_connection.execute_query()
now returnsrows_affected, results
. (This is informational only) - Added
get_or_none(...)
as syntactic sugar forfilter(...).first()
v0.15.6
- Added
BinaryField
for storing binary objects (bytes
). - Changed
TextField
to useLONGTEXT
for MySQL to allow for larger than 64KB of text. - De-duplicate index if specified on both
index=true
and as part ofindexes
- Primary Keyed
TextField
is marked as deprecated.
We can't guarnatee that it will be properly indexed or unique in all cases. - One can now disable the backwards relation for FK/O2O relations by passing
related_name=False
- One can now pass a PK value to a generated field, and Tortoise ORM will use that as the PK as expected.
This allows one to have a model that has a autonumber PK, but setting it explicitly if required.
v0.15.5
-
Refactored Fields:
Fields have been refactored, for better maintenance. There should be no change for most users.
- More accurate auto-completion.
- Fields now contain their own SQL schema by dialect, which significantly simplifies adding field types.
describe_model()
now returns the DB type, and dialect overrides.
JSONField
will now automatically usepython-rapidjson
as an accelerator if it is available.DecimalField
and aggregations on it, now behaves much more like expected on SQLite (#256)- Check whether charset name is valid for the MySQL connection (#261)
- Default DB driver parameters are now applied consistently, if you use the URI schema or manual.
v0.15.4
0.15.3
-
Added
OneToOneField
implementation:OneToOneField
describes a one to one relation between two models.
It can be set from the primary side only, but resolved from both sides in the same way.describe_model(...)
now also reports OneToOne relations in both directions.Usage example:
event: fields.OneToOneRelation[Event] = fields.OneToOneField( "models.Event", on_delete=fields.CASCADE, related_name="address" )
- Prefetching is done concurrently now, sending all prefetch requests at the same time instead of in sequence.
- Enabe foreign key enforcement on SQLite for builds where it was optional.
v0.15.2
- The
auto_now_add
argument ofDatetimeField
is handled correctly in the SQLite backend. (#248) unique_together
now creates named constrains, to prevent the DB from auto-assigning a potentially non-unique constraint name. (#237)- Filtering by an
auto_now
field doesn't replace the filter value withnow()
anymore. (#249)