agrosner / DBFlow

A blazing fast, powerful, and very simple ORM android database library that writes database code for you.
MIT License
4.87k stars 598 forks source link

how to use ContentUtils.queryList? #1641

Closed SuperDan630 closed 3 years ago

SuperDan630 commented 5 years ago

it need to much param,I need query all data from another app

agrosner commented 3 years ago

ill admit its not the prettiest API or useful in the library.

queryList(contentResolver: ContentResolver, queryUri: Uri,
                                     table: Class<TableClass>,
                                     databaseWrapper: DatabaseWrapper,
                                     whereConditions: OperatorGroup,
                                     orderBy: String, vararg columns: String)

contentResolver comes from your current Context. queryUri is the content provider uri that you pass to query databaseWrapper is the FlowManager.getDatabase or database<AppDatabase>() object whereConditionsis an OperatorGroup which is just combining operators such as Column.eq(value) orderBy is the OrderBy.ASCENDING or descending columns are the projected columns in the query. If empty, its all.