comparison sat/memory/sqlite.py @ 2843:a425c1ca51d0

core (memory/sqlite): added a "timestamp_start" filter to retrieve history from a specific point in time
author Goffi <goffi@goffi.org>
date Sat, 09 Mar 2019 16:24:15 +0100
parents 298408833ec2
children 28fe69b87ba4
comparison
equal deleted inserted replaced
2842:dbfedde9bc61 2843:a425c1ca51d0
588 588
589 # set to True if "ORDER BY" is already added 589 # set to True if "ORDER BY" is already added
590 order = False 590 order = False
591 591
592 if filters: 592 if filters:
593 if u'timestamp_start' in filters:
594 query_parts.append(u"AND timestamp>= ?")
595 values.append(int(filters[u'timestamp_start']))
593 if u'body' in filters: 596 if u'body' in filters:
594 # TODO: use REGEXP (function to be defined) instead of GLOB: https://www.sqlite.org/lang_expr.html 597 # TODO: use REGEXP (function to be defined) instead of GLOB: https://www.sqlite.org/lang_expr.html
595 query_parts.append(u"AND message LIKE ?") 598 query_parts.append(u"AND message LIKE ?")
596 values.append(u"%{}%".format(filters['body'])) 599 values.append(u"%{}%".format(filters['body']))
597 if u'search' in filters: 600 if u'search' in filters: