Releases: tortoise/tortoise-orm
Releases · tortoise/tortoise-orm
v0.16.11
- fix:
sqlite://:memory:
in Windows thrownOSError: [WinError 123]
- Support
bulk_create()
insertion of records with overridden primary key when the primary key is DB-generated - Add
queryset.exists()
andModel.exists()
. - Add model subscription lookup,
Model[<pkval>]
that will return the object or raiseKeyError
v0.16.10
v0.16.9
- Support
F
expression in.save()
now IntEnumField
accept valid int value andCharEnumField
accept valid str value- Pydantic models get created with globally unique identifier
- Leaf-detection to minimize duplicate Pydantic model creation
- Pydantic models with a Primary Key that is also a raw field of a relation is now not hidden when
exclude_raw_fields=True
as it is a critically important field - Raise an informative error when a field is set as nullable and primary key at the same time
- Foreign key id's are now described to have the positive-integer range of the field it is related to
- Fixed prefetching over OneToOne relations
- Fixed
__contains
for non-text fields (e.g.JSONB
)
v0.16.8
v0.15.24
v0.16.7
v0.16.6
This is a security fix release. We strongly recommend people upgrade.
Security fixes:
- Fixed SQL injection issue in MySQL
- Fixed SQL injection issues in MySQL when using
contains
,starts_with
orends_with
filters (and their case-insensitive counterparts) - Fixed malformed SQL for PostgreSQL and SQLite when using
contains
,starts_with
orends_with
filters (and their case-insensitive counterparts)
Other changes:
-
Added support for partial models:
To create a partial model, one can do a
.only(<fieldnames-as-strings>)
as part of the QuerySet.
This will create model instances that only have those values fetched.Persisting changes on the model is allowed only when:
- All the fields you want to update is specified in
<model>.save(update_fields=[...])
- You included the Model primary key in the `.only(...)``
To protect against common mistakes we ensure that errors get raised:
- If you access a field that is not specified, you will get an
AttributeError
. - If you do a
<model>.save()
aIncompleteInstanceError
will be raised as the model is, as requested, incomplete. - If you do a
<model>.save(update_fields=[...])
and you didn't include the primary key in the.only(...)
,
thenIncompleteInstanceError
will be raised indicating that updates can't be done without the primary key being known. - If you do a
<model>.save(update_fields=[...])
and one of the fields inupdate_fields
was not in the.only(...)
,
thenIncompleteInstanceError
as that field is not available to be updated.
- All the fields you want to update is specified in
- Fixed bad SQL generation when doing a
.values()
query over a Foreign Key - Added
<model>.update_from_dict({...})
that will mass update values safely from a dictionary - Fixed processing URL encoded password in connection string
v0.15.23
This is a security fix release. We strongly recommend everyone upgrade.
- Fixed SQL injection issue in MySQL
- Fixed SQL injection issues in MySQL when using
contains
,starts_with
orends_with
filters (and their case-insensitive counterparts) - Fixed malformed SQL for PostgreSQL and SQLite when using
contains
,starts_with
orends_with
filters (and their case-insensitive counterparts)