In spirit, dbGetQuery can be replicated with this sequence of calls:
rs <- dbSendQuery(conn, ...)
x <- dbFetch(rs, n = -1, ...)
dbClearResult(rs)
Note that the n = -1 portion in dbFetch returns all rows into x.
One of the scenarios for which the send, fetch, and clear idiom is used instead of dbGetQuery is when you want to process the resultant data frame in batches, e.g.
chunk_size <- 10e3
rs <- dbSendQuery(conn, ...)
while(!dbHasCompleted(rs)) {
dbFetch(rs, n = chunk_size) %>% analysis_code_goes_here
}
dbClearResult(rs)
If you want each chunk to return some value, you could append to a list, then perhaps bind those results into a single value, so forth and so on.