Skip to content

Commit

Permalink
refactor(archive): sqlite query optimization. replace or-ed equal con…
Browse files Browse the repository at this point in the history
…ditions list with in-list
  • Loading branch information
Lorenzo Delgado authored Jan 25, 2023
1 parent b84c54b commit 8c7a931
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,10 @@ proc whereClause(cursor: Option[DbCursor],
let contentTopicClause = if contentTopic.len <= 0:
none(string)
else:
var where = "("
where &= "contentTopic = (?)"
for _ in contentTopic[1..^1]:
where &= " OR contentTopic = (?)"
var where = "contentTopic IN ("
where &= "?"
for _ in 1..<contentTopic.len:
where &= ", ?"
where &= ")"
some(where)

Expand Down

0 comments on commit 8c7a931

Please sign in to comment.