message: Extract helper function duckdb_execute_R_impl()
diff: @@ -385,6 +385,8 @@ SEXP duckdb_bind_R(SEXP stmtsexp, SEXP paramsexp) {
  return R_NilValue;
  }
  +SEXP duckdb_execute_R_impl(MaterializedQueryResult *result);
  +
  SEXP duckdb_execute_R(SEXP stmtsexp) {
  if (TYPEOF(stmtsexp) != EXTPTRSXP) {
  Rf_error("duckdb_execute_R: Need external pointer parameter");
  @@ -394,6 +396,9 @@ SEXP duckdb_execute_R(SEXP stmtsexp) {
  Rf_error("duckdb_execute_R: Invalid statement");
  }
  + SEXP out;
  +
  + {
  auto generic_result = stmtholder->stmt->Execute(stmtholder->parameters, false);
  if (!generic_result->success) {
  @@ -402,6 +407,13 @@ SEXP duckdb_execute_R(SEXP stmtsexp) {
  assert(generic_result->type == QueryResultType::MATERIALIZED_RESULT);
  MaterializedQueryResult *result = (MaterializedQueryResult *)generic_result.get();
  + out = duckdb_execute_R_impl(result);
  + }
  +
  + return out;
  +}
  +
  +SEXP duckdb_execute_R_impl(MaterializedQueryResult *result) {
  // step 2: create result data frame and allocate columns
  uint32_t ncols = result->types.size();
  uint64_t nrows = result->collection.count;
  