igorbenav / fastcrud

FastCRUD is a Python package for FastAPI, offering robust async CRUD operations and flexible endpoint creation utilities.
MIT License
530 stars 32 forks source link

Option to Skip db.commit() During Write Operations #61

Closed FCMHUB closed 1 month ago

FCMHUB commented 2 months ago

Is your feature request related to a problem? Please describe. When writing multiple records, if some fail, there is no option to roll back the changes.

Describe the solution you'd like It should be possible to omit db.commit() within write methods, allowing users to call session commit or rollback externally. This would enable multiple records to be written within the same transaction.

created_record = await crud_xyz.create(db=db, object=record, skip_commit=True)
igorbenav commented 2 months ago

This can be done, I'll add it for the next version. Thanks for the issue!