fnc12 / sqlite_orm

❤️ SQLite ORM light header only library for modern C++
GNU Affero General Public License v3.0
2.19k stars 305 forks source link

transaction_guard: Ability to specify transaction type #1305

Closed trevornagy closed 2 weeks ago

trevornagy commented 3 weeks ago

By default the transaction_guard API calls: begin_transaction.

Would it be possible to add to the transaction_guard API a way to specify the type of transaction? For example, what if I want to use transaction_guard + begin_immediate_transaction / transaction_guard + begin_exclusive_transaction?

Is this possible?

Thanks!

fnc12 commented 3 weeks ago

It is not possible but we can think about it. Either to add more functions like immediate_transaction_guard or adding enum argument to transaction_guard

fnc12 commented 2 weeks ago

PR is here https://github.com/fnc12/sqlite_orm/pull/1308

fnc12 commented 2 weeks ago

@trevornagy please check dev branch for new API deferred_transaction_guard, immediate_transaction_guard and exclusive_transaction_guard