core (memory/sqlite): added before_uid filter to retrieve history before a message UID

This commit is contained in:
Goffi 2019-12-05 22:58:06 +01:00
commit 3ccd27de87

View file

@ -625,6 +625,9 @@ class SqliteStorage(object):
if 'timestamp_start' in filters:
query_parts.append("AND timestamp>= ?")
values.append(float(filters['timestamp_start']))
if 'before_uid' in filters:
query_parts.append("AND history.rowid<(select rowid from history where uid=?)")
values.append(filters['before_uid'])
if 'body' in filters:
# TODO: use REGEXP (function to be defined) instead of GLOB: https://www.sqlite.org/lang_expr.html
query_parts.append("AND message LIKE ?")