| 25 | } |
| 26 | |
| 27 | QSqlQuery comicsSearchQuery(QSqlDatabase &db, const QString &filter) |
| 28 | { |
| 29 | QueryParser parser; |
| 30 | auto result = parser.parse(filter.toStdString()); |
| 31 | |
| 32 | std::string queryString(SEARCH_COMICS_QUERY); |
| 33 | result.buildSqlString(queryString); |
| 34 | queryString += " LIMIT :limit"; |
| 35 | |
| 36 | QSqlQuery selectQuery(db); |
| 37 | selectQuery.prepare(queryString.c_str()); |
| 38 | selectQuery.bindValue(":limit", 500); // TODO, load this value from settings |
| 39 | result.bindValues(selectQuery); |
| 40 | |
| 41 | selectQuery.exec(); |
| 42 | |
| 43 | return selectQuery; |
| 44 | } |
no test coverage detected