예제 #1
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]
예제 #2
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]
예제 #3
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)
예제 #4
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)