在 Room 中调用自定义 SQLite 函数
Calling custom SQLite functions in Room
我在我的应用程序中包含一个自定义构建的 sqlite。我在该库中有几个自定义函数,我想在我的 Room DAO 中从 @Query 调用它们。但是我收到一个错误,指出 Room 找不到这些功能。有没有办法在不使用 @RawQuery 的情况下告诉 Room 它们存在?
来自Google:
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.
我在我的应用程序中包含一个自定义构建的 sqlite。我在该库中有几个自定义函数,我想在我的 Room DAO 中从 @Query 调用它们。但是我收到一个错误,指出 Room 找不到这些功能。有没有办法在不使用 @RawQuery 的情况下告诉 Room 它们存在?
来自Google:
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.