Releases: tortoise/tortoise-orm
Releases · tortoise/tortoise-orm
0.21.3
0.21.2
0.21.1
0.21.0
Added
- Enhancement for FastAPI lifespan support (#1371)
- Add
__eq__
method toQ
to more easily test dynamically-built queries (#1506) - Added PlainToTsQuery function for postgres (#1347)
- Allow field's default keyword to be async function (#1498)
- Add support for queryset slicing. (#1341)
Fixed
- Fix
DatetimeField
use '__year' report'int' object has no attribute 'utcoffset'
. (#1575) - Fix
bulk_update
when using custom fields. (#1564) - Fix
optional
parameter inpydantic_model_creator
does not work for pydantic v2. (#1551) - Fix
get_annotations
now evaluates annotations in the default scope instead of the app namespace. (#1552) - Fix
get_or_create
method. (#1404) - Use
index_name
instead ofBaseSchemaGenerator._generate_index_name
to generate index name. - Use subquery for count() and exists() in
QuerySet
to match count result toQuerySet
result. (#1607)
Changed
- Change
utils.chunk
from function to return iterables lazily. - Removed lower bound of id keys in generated pydantic models. (#1602)
- Rename Field initial arguments
pk
/index
toprimary_key
/db_index
. (#1621) - Renamed
Model.check
method toModel._check
to avoid naming collision issues (#1559) (#1550)
Breaking Changes
bulk_create
now does not return anything. (#1614)
0.20.1
Added
- Add binary compression support for
UUIDField
inMySQL
. (#1458) - Only
Model
,Tortoise
,BaseDBAsyncClient
,__version__
, andconnections
are now exported fromtortoise
- Add parameter
validators
topydantic_model_creator
. (#1471)
Fixed
- Fix order of fields in
ValuesListQuery
when it has more than 10 fields. (#1492) - Fix pydantic v2 pydantic_model_creator nullable field not optional. (#1454)
- Fix pydantic v2.5 unittest error. (#1535)
- Fix pydantic_model_creator
exclude_readonly
parameter not working. - Fix annotation propagation for non-filter queries. (#1590)
0.20.0
Added
Fixed
- Fix foreign key constraint not generated on MSSQL Server. (#1400)
- Fix testcase error with python3.11 (#1308)
Breaking Changes
- Drop support for
pydantic
1.x. - Drop support for
python
3.7. - Param
config_class
ofpydantic_model_creator
is renamed tomodel_config
. - Attr
config_class
ofPydanticMeta
is renamed tomodel_config
.
0.19.3
Added
- Added config_class option to pydantic model genator that allows the developer to customize the generated pydantic model's
Config
class. (#1048)
Fixed
- Fastapi example test not working. (#1029)
- Fix create index sql error. (#1202)
- Fix dependencies resolve error. (#1246)
- Fix ignoring zero value of limit. (#1270)
- Fix ForeignKeyField is none when fk is integer 0. (#1274)
- Fix limit ignore zero. (#1270)
- Fix min/max value validators for decimal fields. (#1291)
0.19.2
Added
- Added
schema
attribute to Model's Meta to specify exact schema to use with the model.
Fixed
- Mixin does not work. (#1133)
using_db
wrong position in model shortcut methods. (#1150)- Fixed connection to
Oracle
database by adding database info to DBQ in connection string. - Fixed ORA-01435 error while using
Oracle
database (#1155) - Fixed processing of
ssl
option in MySQL connection string. - Fixed type hinting for
QuerySetSingle
.
0.19.1
0.19.0
Added
- Added psycopg backend support.
- Added a new unified and robust connection management interface to access DB connections which includes support for lazy connection creation and much more. For more details, check out this PR.
- Added
TimeField
. (#1054). - Added
ArrayField
forpostgres
.
Fixed
- Fix
bulk_create
doesn't work correctly with more than 1 update_fields. (#1046) - Fix
bulk_update
errors when setting null for a smallint column on postgres. (#1086)
Deprecated
- Existing connection management interface and related public APIs which are deprecated:
Tortoise.get_connection
Tortoise.close_connections
Changed
- Refactored
tortoise.transactions.get_connection
method totortoise.transactions._get_connection
.
Note that this method has now been marked private to this module and is not part of the public API