Is there a way to tell Room about custom sqlite functions?

Viewed 394

I've implemented SupportSQLiteOpenHelper.Factory to open a spatialite database (sqlite with spatial functions). However when my queries use spatialite functions such as ST_AREA, Room complains that no such function exists. Is there a way to tell room about these custom functions or configure it to skip function checking?

1 Answers

Room can't verify queries with custom functions, please annotate your method with @SkipQueryVerification.

Room verifies your Dao queries using sqlite-jdbc which uses a vanilla prebuilt SQLite native library which doesn't have your custom functions and thus causes the verifier to fail. However, with the @SkipQueryVerification you can make Room skip verifying that query allowing you to still use Room but losing the ability to verify the query at runtime.

Related