comparison sat/memory/sqlite.py @ 3079:f8cc88c773c8

core (memory/sqlite): added `before_uid` filter to retrieve history before a message UID
author Goffi <goffi@goffi.org>
date Thu, 05 Dec 2019 22:58:06 +0100
parents ab2696e34d29
children 0c29155ac68b
comparison
equal deleted inserted replaced
3078:95c94d94872d 3079:f8cc88c773c8
623 623
624 if filters: 624 if filters:
625 if 'timestamp_start' in filters: 625 if 'timestamp_start' in filters:
626 query_parts.append("AND timestamp>= ?") 626 query_parts.append("AND timestamp>= ?")
627 values.append(float(filters['timestamp_start'])) 627 values.append(float(filters['timestamp_start']))
628 if 'before_uid' in filters:
629 query_parts.append("AND history.rowid<(select rowid from history where uid=?)")
630 values.append(filters['before_uid'])
628 if 'body' in filters: 631 if 'body' in filters:
629 # TODO: use REGEXP (function to be defined) instead of GLOB: https://www.sqlite.org/lang_expr.html 632 # TODO: use REGEXP (function to be defined) instead of GLOB: https://www.sqlite.org/lang_expr.html
630 query_parts.append("AND message LIKE ?") 633 query_parts.append("AND message LIKE ?")
631 values.append("%{}%".format(filters['body'])) 634 values.append("%{}%".format(filters['body']))
632 if 'search' in filters: 635 if 'search' in filters: