-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feature] Dao independent transactions #340
Comments
What would you think of something similar to the following? We could add a member function on database.runInTransaction(() {
// DAO invocations
}); |
@vitusortner |
Usually, yes. I don't know why that shouldn't be the case. |
I want to add, though, that if we want to add support for database.runInTransaction((transactionDB) async {
// DAO invocations
transactionDB.someDao.findEntriesInTable("value");
}); or this (just using a function reference instead of a closure): database.runInTransaction(withTransaction);
Future<void> withTransaction(MyDB transactionDB) async{
// DAO invocations
transactionDB.someDao.findEntriesInTable("value");
} This would fit nicely into #360, too. |
Are there any updates on that? :) |
Unluckily not. In case you're interested, feel free to open a PR that implements the desired functionality. |
Sometimes you need to make a transaction that will work with several DAO or will have a lot of logic. I would like to have separate methods for starting and ending a transaction. Now, having only an annotation, this is not possible
Thank you!
The text was updated successfully, but these errors were encountered: