looqs/shared/sqlitesearch.h

25 rader
617 B
C
Permalänk Normal vy Historik

#ifndef SQLITESEARCH_H
#define SQLITESEARCH_H
#include <QSqlDatabase>
#include <QPair>
#include "searchresult.h"
#include "token.h"
2021-06-12 14:59:58 +02:00
#include "../shared/looqsquery.h"
class SqliteSearch
{
public:
SqliteSearch(QSqlDatabase &db);
2021-06-12 14:59:58 +02:00
QVector<SearchResult> search(const LooqsQuery &query);
private:
QSqlDatabase *db;
2021-06-12 14:59:58 +02:00
QSqlQuery makeSqlQuery(const LooqsQuery &query);
QString fieldToColumn(QueryField field);
QPair<QString, QVector<QString>> createSql(const Token &token);
QString createSortSql(const QVector<SortCondition> sortConditions);
QString escapeFtsArgument(QString ftsArg);
};
#endif // SQLITESEARCH_H