ankitects / ankitects/anki

Improve the SqlWriter API to make node grouping less error-prone

未关闭
#5,506 0 条评论 0 个 reaction 已指派 1 人 已被 @iamllama 认领 在 GitHub 查看
主要语言
Rust
星标
30.5k
派生
3.2k
平均合并
2 天 8 小时
30 天内合并 PR
60

描述

write_search_node_to_sql() has a comment about wrapping the SQLite for every multi-term search node in parentheses to generate the correct conditions:
https://github.com/ankitects/anki/blob/d80273ea71d4e9a3cab91b5a2e5906366809e3ea/rslib/src/search/sqlwriter.rs#L127-L129

It's easy to miss that though and introduce bugs as happened recently (#5500) and in the past when the API was introduced (https://github.com/ankitects/anki/pull/1754#issuecomment-1081282942) so it's worth looking into improving this.

贡献指南

打开贡献指南

调研方向

Start in rslib/src/search/sqlwriter.rs at write_search_node_to_sql() and read the comment around lines 127-129. Review the grouping problem described in #5500 and the prior API discussion in pull request #1754. Done means the SqlWriter API makes it difficult to omit the parentheses needed for multi-term search nodes and avoids the reported class of SQL-condition bugs.

由索引模型根据 Issue 内容生成。

评估

技术栈
rust, sqlite
领域
databases
Issue 类型
重构
难度
5/5
预计耗时
一周以上
活跃度
活跃
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。