def count(self, string): w = search.build_where(string) c = self.db.execute("SELECT COUNT(*) " "FROM messages, messages_fts " "WHERE messages.rowid = messages_fts.rowid AND " "(%s)" % w.sql, w.args) return c.fetchone()[0]
def count(self, string): w = search.build_where(string) c = self.db.execute( "SELECT COUNT(*) " "FROM messages, messages_fts " "WHERE messages.rowid = messages_fts.rowid AND " "(%s)" % w.sql, w.args) return c.fetchone()[0]
def search(self, string, offset=0, limit=1000): w = search.build_where(string) w.args.extend([offset, limit]) return self.db.execute( "SELECT subject, messages_fts.'from' AS 'from', " "date, path, offset, length " "FROM messages, messages_fts " "WHERE messages.rowid = messages_fts.rowid AND " "(%s) ORDER BY date DESC LIMIT ?, ?" % w.sql, w.args)
def search(self, string, offset = 0, limit = 1000): w = search.build_where(string) w.args.extend([offset, limit]) return self.db.execute("SELECT subject, messages_fts.'from' AS 'from', " "date, path, offset, length " "FROM messages, messages_fts " "WHERE messages.rowid = messages_fts.rowid AND " "(%s) ORDER BY date DESC LIMIT ?, ?" % w.sql, w.args)