Skip to content

Commit

Permalink
GSvarServer: output cache queries
Browse files Browse the repository at this point in the history
  • Loading branch information
ubuntolog committed Dec 17, 2024
1 parent 8fdaabc commit 7c8b300
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/cppREST/ServerDB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -461,8 +461,10 @@ bool ServerDB::addFileLocation(const QString filename_with_path, const QString t
QString json_string = json_content.replace("'", "''");
// json_string = json_string.replace("\\", "\\\\");
json_string = json_string.replace("\"", "\\\"");
QSqlQuery query = db_->exec("INSERT INTO file_locations (filename_with_path, type, locus, multiple_files, return_if_missing, json_content, requested)"
" VALUES (\"" + filename_with_path + "\", \"" + type + "\", \"" + locus + "\", " + QString::number(static_cast<int>(multiple_files)) + ", " + QString::number(static_cast<int>(return_if_missing)) + ", \"" + json_string + "\", " + QString::number(requested_as_num) + ")");
QString query_text = "INSERT INTO file_locations (filename_with_path, type, locus, multiple_files, return_if_missing, json_content, requested)"
" VALUES (\"" + filename_with_path + "\", \"" + type + "\", \"" + locus + "\", " + QString::number(static_cast<int>(multiple_files)) + ", " + QString::number(static_cast<int>(return_if_missing)) + ", \"" + json_string + "\", " + QString::number(requested_as_num) + ")";
Log::error(query_text);
QSqlQuery query = db_->exec(query_text);
bool success = query.lastError().text().trimmed().isEmpty();
if(!success)
{
Expand Down

0 comments on commit 7c8b300

Please sign in to comment.