QueryResultCallback with List parameter
DBFlow Version: 3.0.0-beta6 Issue Kind (Feature): Description: Is there an existing way to create an asynchronous query that returns a list?
Existing Code:
SQLite.select()
.from(CustomBaseModel.class)
.where(CustomBaseModel_Table.Id.eq(id))
.async()
.queryResultCallback(new QueryTransaction.QueryResultCallback<InspireColor>() {
@Override
public void onQueryResult(QueryTransaction transaction, @NonNull CursorResult<InspireColor> tResult) {
}
})
.execute();
Proposed Code:
SQLite.select()
.from(CustomBaseModel.class)
.where(CustomBaseModel_Table.Id.eq(id))
.async()
.queryResultCallback(new QueryTransaction.QueryResultCallback<InspireColor>() {
@Override
public void onQueryResult(QueryTransaction transaction, @NonNull List<TResult> results) {
}
})
.execute();
This would help offload the time it takes to process the cursor off the main ui thread and put it in the background.
I see. that makes perfect sense.
Use queryListResult() method which will provide what you're lookin for :)
Awesome. Thanks for the speedy reply and enhancement. Do I need to pull in the source into my project or is there a new beta release (i.e. 3.0.0-beta7)?
Probably will be 3.0.0. For now you'll need to pull in develop to see the
change or pull in latest commit from jitpack.io
On Tue, May 3, 2016 at 3:02 PM, Corey Mann [email protected] wrote:
Awesome. Thanks for the speedy reply and enhancement. Do I need to pull in the source into my project or is there a new beta release (i.e. 3.0.0-beta7)?
— You are receiving this because you modified the open/close state. Reply to this email directly or view it on GitHub https://github.com/Raizlabs/DBFlow/issues/786#issuecomment-216631924
compile
'com.github.Raizlabs.DBFlow:dbflow:develop-3.0.0-beta6-g816c5cd-37'
On Tue, May 3, 2016 at 3:28 PM, Andrew Grosner [email protected] wrote:
Probably will be 3.0.0. For now you'll need to pull in
developto see the change or pull in latest commit from jitpack.ioOn Tue, May 3, 2016 at 3:02 PM, Corey Mann [email protected] wrote:
Awesome. Thanks for the speedy reply and enhancement. Do I need to pull in the source into my project or is there a new beta release (i.e. 3.0.0-beta7)?
— You are receiving this because you modified the open/close state. Reply to this email directly or view it on GitHub https://github.com/Raizlabs/DBFlow/issues/786#issuecomment-216631924
ensure you use same version on all pieces of dbflow