diff --git a/README.Rmd b/README.Rmd index 34f9168..30a4b53 100644 --- a/README.Rmd +++ b/README.Rmd @@ -71,15 +71,14 @@ res <- dbSendQueryArrow(con, "SELECT * from swiss WHERE Agriculture < ?") dbBind(res, 30) -while (!dbHasCompleted(res)) { - ret <- dbFetchArrow(res) - message("fetched ", ret$length, " rows") -} +ret <- dbFetchArrow(res) +ret$length dbBind(res, 20) +# Chunked fetches while (!dbHasCompleted(res)) { - ret <- dbFetchArrow(res) + ret <- dbFetchArrowChunk(res) message("fetched ", ret$length, " rows") } diff --git a/README.md b/README.md index f754399..37bb4c5 100644 --- a/README.md +++ b/README.md @@ -96,6 +96,7 @@ as well. ``` r # Queries dbGetQueryArrow(con, "SELECT * from swiss WHERE Agriculture < 40") +#> [[1]] #> #> $ length : int 16 #> $ null_count: int 0 @@ -164,21 +165,19 @@ res <- dbSendQueryArrow(con, "SELECT * from swiss WHERE Agriculture < ?") dbBind(res, 30) -while (!dbHasCompleted(res)) { - ret <- dbFetchArrow(res) - message("fetched ", ret$length, " rows") -} -#> fetched 10 rows -#> fetched rows +ret <- dbFetchArrow(res) +ret$length +#> NULL dbBind(res, 20) -while(!dbHasCompleted(res)) { - ret <- dbFetchArrow(res) +# Chunked fetches +while (!dbHasCompleted(res)) { + ret <- dbFetchArrowChunk(res) message("fetched ", ret$length, " rows") } #> fetched 8 rows -#> fetched rows +#> fetched 0 rows # Cleanup dbClearResult(res)