Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Unintended behavior
View staffing
Description
Version used: 1.1.0-beta3
Devices/Android versions reproduced on: n/a
If you have a @Dao method like this:
@RawQuery
abstract DataSource.Factory<Integer, BookSearchResult> _search(SupportSQLiteQuery query);
...you get the following compile-time error:
error: Observable query return type (LiveData, Flowable, DataSource, DataSourceFactory etc) can only be used with SELECT queries that directly or indirectly (via @Relation, for example) access at least one table. For @RawQuery, you should specify the list of tables to be observed via the observedEntities field.
However, @RawQuery is not necessarily tied to entities. For example, using @RawQuery is the recommended workaround for FTS support (see
It is unclear why paging requires an observable entity type. I can see where paging might take advantage of an observable entity type, but that should be optional. In the absence of such an observable entity, it is the developer's job to know when past paging results might be stale, requiring a fresh DataSource.Factory.
(BTW, that error message has a typo -- it is DataSource.Factory, not DataSourceFactory, at least in the public API)