gpt4 book ai didi

android - 在 Room 中调用自定义 SQLite 函数

转载 作者:太空狗 更新时间:2023-10-29 13:44:54 25 4
gpt4 key购买 nike

我在我的应用程序中包含一个自定义构建的 sqlite。我在该库中有几个自定义函数,我想在我的 Room DAO 中从 @Query 调用它们。但是我收到一个错误,指出 Room 找不到这些功能。有没有办法在不使用 @RawQuery 的情况下告诉 Room 它们存在?

最佳答案

来自谷歌:

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.

关于android - 在 Room 中调用自定义 SQLite 函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56043431/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com