SQLite:选择更新等待 10 兼容性

发布于 2024-09-24 19:18:42 字数 217 浏览 0 评论 0原文

SQLite 不支持也不接受这样的查询:

select * from mytable where col = 'val' for update wait 10;

你知道是否有一种方法可以让 SQLite 默默地跳过“for update wait 10”部分,从而避免任何解析错误。我的观点是让 Oracle SQL 命令几乎无法在 SQLite 上运行,而无需手动编辑 SQL 语句。

SQLite doesn't support nor accept such a query:

select * from mytable where col = 'val' for update wait 10;

Do you know if there is a way to make SQLite silently skipping the part "for update wait 10" and thus avoid any parsing error. My point is to get Oracle SQL commands barely working against SQLite without having to manually edit the SQL statements.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

居里长安 2024-10-01 19:18:42

我想你可能需要编辑 SQLite 源代码,柠檬解析器。

没有这样的内置东西。您可以使用锁定数据库,

BEGIN [IMMEDIATE|EXCLUSIVE|DEFERRED] TRANSACTION

请参阅此页面了解详细信息

I think you may have to edit SQLite source code, lemon parser.

There is no such builtin thing. You can though lock databases using

BEGIN [IMMEDIATE|EXCLUSIVE|DEFERRED] TRANSACTION

See this page for details

假扮的天使 2024-10-01 19:18:42

当另一个线程或进程正在读取时,您无法更新 sqlite 数据库,并且当另一个线程或进程正在写入时,您无法读取,因此与 Oracle 提供的锁定行为截然不同。

Sqlite 锁定整个数据库,而不仅仅是一条记录或一组记录。我认为您需要检查很多查询。

You can't update the sqlite db when another thread or process is reading and you can't read while another thread or process is writing, so very different locking behavior than Oracle provides.

Sqlite locks the whole database, not just a record or a selection of records. I think you need to check a lot of queries.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文