Status queryInternal(const std::string& query,
                     QueryData& results,
                     const SQLiteDBInstanceRef& instance) {
  QueryDataTyped typedResults;
  Status status = queryInternal(query, typedResults, instance);
  if (status.ok()) {
    results.reserve(typedResults.size());
    for (const auto& row : typedResults) {
      Row r;
      for (const auto& col : row) {
        r[col.first] = castVariant(col.second);
      }
      results.push_back(std::move(r));
    }
  }
  return status;
}
Status queryInternal(const std::string& query,
                     QueryData& results,
                     const SQLiteDBInstanceRef& instance) {
  QueryDataTyped typedResults;
  Status status = queryInternal(query, typedResults, instance);
  if (status.ok()) {
    results.reserve(typedResults.size());
    for (const auto& row : typedResults) {
      Row r;
      for (const auto& col : row) {
        r[col.first] = castVariant(col.second);
      }
      results.push_back(std::move(r));
    }
  }
  return status;
}