diff --git a/waku/v2/protocol/waku_archive/driver/sqlite_driver/queries.nim b/waku/v2/protocol/waku_archive/driver/sqlite_driver/queries.nim index 4b38c2696c..ee915eac51 100644 --- a/waku/v2/protocol/waku_archive/driver/sqlite_driver/queries.nim +++ b/waku/v2/protocol/waku_archive/driver/sqlite_driver/queries.nim @@ -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..