Releases: tortoise/tortoise-orm
Releases · tortoise/tortoise-orm
v0.15.10
v0.15.9
v0.15.8
TextFieldnow recommends usage ofCharFieldif wanting unique indexing instead of just saying "indexing not supported".count()now honours offset and limit (#167)- Testing un-awaited
ForeignKeyFieldas a boolean expression will automatically resolve asFalseif it is None (#274) - Awaiting a nullable
ForeignKeyFieldwon'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
BinaryFieldfor storing binary objects (bytes). - Changed
TextFieldto useLONGTEXTfor MySQL to allow for larger than 64KB of text. - De-duplicate index if specified on both
index=trueand as part ofindexes - Primary Keyed
TextFieldis 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.
JSONFieldwill now automatically usepython-rapidjsonas an accelerator if it is available.DecimalFieldand 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
OneToOneFieldimplementation:OneToOneFielddescribes 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_addargument ofDatetimeFieldis handled correctly in the SQLite backend. (#248) unique_togethernow creates named constrains, to prevent the DB from auto-assigning a potentially non-unique constraint name. (#237)- Filtering by an
auto_nowfield doesn't replace the filter value withnow()anymore. (#249)