Skip to content

Commit

Permalink
updated query log for prepared statement.
Browse files Browse the repository at this point in the history
  • Loading branch information
treefrogframework committed Aug 31, 2024
1 parent e46f44a commit 23df506
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/tsqlquery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,18 @@ bool TSqlQuery::exec()
}
} else {
ret = QSqlQuery::exec();
Tf::writeQueryLog(executedQuery(), ret, lastError(), time.elapsed());
QString msg = executedQuery();
QVariantList values = boundValues();
if (!values.isEmpty()) {
msg += QLatin1String(" -- ");
for (auto &val : values) {
msg += QChar('`');
msg += val.toString();
msg += QLatin1String("`, ");
}
msg.chop(2);
}
Tf::writeQueryLog(msg, ret, lastError(), time.elapsed());
}

return ret;
Expand Down

0 comments on commit 23df506

Please sign in to comment.