Skip to content

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

Description

@abdnh

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:

// NOTE: when adding any new nodes in the future, make sure that they are either
// a single search term, or they wrap multiple terms in parentheses, as can
// be seen in the sql() unit test at the bottom of the file.

It's easy to miss that though and introduce bugs as happened recently (#5500) and in the past when the API was introduced (#1754 (comment)) so it's worth looking into improving this.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions