src/db/databaseconnection.cpp
QSqlQuery DatabaseConnection::executeQuery(QSqlDatabase *db, const QString &stmt,
                                           const std::vector<QVariant> &args) {
  QSqlQuery query(*db);

  if (!query.prepare(stmt)) {
    throw query.lastError();
  }

  for (const auto &arg : args) {
    query.addBindValue(arg);
  }

  if (!query.exec()) {
    throw query.lastError();
  }
  return query;
}
// executeQuery simply attempts to execute the given stmt with the passed args. The statement is
// first prepared, and arg placements can be specified with "?"
//
// Throws: QSqlError when a query error occurs
executeQuery simply attempts to execute the given stmt with the passed args. The statement is
first prepared, and arg placements can be specified with "?"

QSqlError when a query error occurs
executeQuery simply attempts to execute the given stmt with the passed args . The statement is first prepared and arg placements can be specified with " ? " QSqlError when a query error occurs
QSqlQuery DatabaseConnection::executeQuery(QSqlDatabase *db, const QString &stmt,
                                           const std::vector<QVariant> &args) {
  QSqlQuery query(*db);
  if (!query.prepare(stmt)) {
    throw query.lastError();
  }
  for (const auto &arg : args) {
    query.addBindValue(arg);
  }
  if (!query.exec()) {
    throw query.lastError();
  }
  return query;
}
QSqlQuery DatabaseConnection :: executeQuery ( QSqlDatabase * db , const QString & stmt , const std :: vector < QVariant > & args ) { QSqlQuery query ( * db ) ; if ( ! query . prepare ( stmt ) ) { throw query . lastError ( ) ; } for ( const auto & arg : args ) { query . addBindValue ( arg ) ; } if ( ! query . exec ( ) ) { throw query . lastError ( ) ; } return query ; }
executeQuery simply attempts to execute the given stmt with the passed args.
executeQuery simply attempts to execute the given stmt with the passed args .