mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-01-07 16:33:08 +00:00
refactor(archive): sqlite query optimization. replace or-ed equal conditions list with in-list
This commit is contained in:
parent
9949996ed7
commit
61e68da89e
@ -255,10 +255,10 @@ proc whereClause(cursor: Option[DbCursor],
|
|||||||
let contentTopicClause = if contentTopic.len <= 0:
|
let contentTopicClause = if contentTopic.len <= 0:
|
||||||
none(string)
|
none(string)
|
||||||
else:
|
else:
|
||||||
var where = "("
|
var where = "contentTopic IN ("
|
||||||
where &= "contentTopic = (?)"
|
where &= "?"
|
||||||
for _ in contentTopic[1..^1]:
|
for _ in 1..<contentTopic.len:
|
||||||
where &= " OR contentTopic = (?)"
|
where &= ", ?"
|
||||||
where &= ")"
|
where &= ")"
|
||||||
some(where)
|
some(where)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user