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: Nexus 9, etc.
The @RawQuery documentation states: "RawQuery methods can only be used for read queries. For write queries, use RoomDatabase.getOpenHelper().getWritableDatabase(). ".
Except... writes work. I used this for FTS, for example:
@RawQuery
protected abstract long insert(SupportSQLiteQuery queryish);
void insert(ParagraphEntity entity) {
insert(new SimpleSQLiteQuery("INSERT INTO booksearch (sequence, prose) VALUES (?, ?)",
new Object[] {entity.sequence, entity.prose}));
}
It is fairly important that writes work, if we want @Transaction support, as a DAO has no access to the SupportSQLiteDatabase (except via ugly hacks). For example, in many FTS scenarios, we will need to manipulate real tables and FTS virtual tables in the same transaction, to keep data and that data's full-text index synchronized.
If the documentation for @RawQuery is correct as written, then please document the proper means to mix DAO and non-DAO operations in the same transaction. If, OTOH, the @RawQuery documentation is out of date or paints a simplified picture, and some write operations are supported, please update the documentation to provide more clarity.
Thanks for considering this!