Skip to content

Commit

Permalink
fix vignette
Browse files Browse the repository at this point in the history
  • Loading branch information
nbenn committed Nov 14, 2023
1 parent f56d677 commit 21b5124
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 72 deletions.
4 changes: 2 additions & 2 deletions R/dbBind_Result.R
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,6 @@ dbBind_AdbiResult <- function(res, params, ...) {
"It is possible that not all data has been fetched.",
call. = FALSE
)
} else {
meta(res, "has_completed") <- FALSE
}

meta(res, "data")$release()
Expand All @@ -128,6 +126,8 @@ dbBind_AdbiResult <- function(res, params, ...) {
meta(res, "remainder") <- NULL
}

meta(res, "has_completed") <- FALSE

invisible(res)
}
#' @rdname DBI
Expand Down
8 changes: 5 additions & 3 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,15 @@ res <- dbSendQueryArrow(con, "SELECT * from swiss WHERE Agriculture < ?")
dbBind(res, 30)
while (!dbHasCompleted(res)) {
print(dbFetchArrow(res))
ret <- dbFetchArrow(res)
message("fetched ", ret$length, " rows")
}
dbBind(res, 20)
while (!dbHasCompleted(res)) {
print(dbFetchArrow(res))
while(!dbHasCompleted(res)) {
ret <- dbFetchArrow(res)
message("fetched ", ret$length, " rows")
}
# Cleanup
Expand Down
75 changes: 8 additions & 67 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,79 +165,20 @@ res <- dbSendQueryArrow(con, "SELECT * from swiss WHERE Agriculture < ?")
dbBind(res, 30)

while (!dbHasCompleted(res)) {
print(dbFetchArrow(res))
ret <- dbFetchArrow(res)
message("fetched ", ret$length, " rows")
}
#> <nanoarrow_array struct[10]>
#> $ length : int 10
#> $ null_count: int 0
#> $ offset : int 0
#> $ buffers :List of 1
#> ..$ :<nanoarrow_buffer validity<bool>[0][0 b]> ``
#> $ children :List of 6
#> ..$ Fertility :<nanoarrow_array double[10]>
#> .. ..$ length : int 10
#> .. ..$ null_count: int -1
#> .. ..$ offset : int 0
#> .. ..$ buffers :List of 2
#> .. .. ..$ :<nanoarrow_buffer validity<bool>[16][2 b]> `TRUE TRUE TRUE TRUE...`
#> .. .. ..$ :<nanoarrow_buffer data<double>[10][80 b]> `80.2 55.7 54.3 58.3 ...`
#> .. ..$ dictionary: NULL
#> .. ..$ children : list()
#> ..$ Agriculture :<nanoarrow_array double[10]>
#> .. ..$ length : int 10
#> .. ..$ null_count: int -1
#> .. ..$ offset : int 0
#> .. ..$ buffers :List of 2
#> .. .. ..$ :<nanoarrow_buffer validity<bool>[16][2 b]> `TRUE TRUE TRUE TRUE...`
#> .. .. ..$ :<nanoarrow_buffer data<double>[10][80 b]> `17.0 19.4 15.2 26.8 ...`
#> .. ..$ dictionary: NULL
#> .. ..$ children : list()
#> ..$ Examination :<nanoarrow_array int64[10]>
#> .. ..$ length : int 10
#> .. ..$ null_count: int -1
#> .. ..$ offset : int 0
#> .. ..$ buffers :List of 2
#> .. .. ..$ :<nanoarrow_buffer validity<bool>[16][2 b]> `TRUE TRUE TRUE TRUE...`
#> .. .. ..$ :<nanoarrow_buffer data<int64>[10][80 b]> `15 26 31 25 29 22 35 ...`
#> .. ..$ dictionary: NULL
#> .. ..$ children : list()
#> ..$ Education :<nanoarrow_array int64[10]>
#> .. ..$ length : int 10
#> .. ..$ null_count: int -1
#> .. ..$ offset : int 0
#> .. ..$ buffers :List of 2
#> .. .. ..$ :<nanoarrow_buffer validity<bool>[16][2 b]> `TRUE TRUE TRUE TRUE...`
#> .. .. ..$ :<nanoarrow_buffer data<int64>[10][80 b]> `12 28 20 19 11 13 32 ...`
#> .. ..$ dictionary: NULL
#> .. ..$ children : list()
#> ..$ Catholic :<nanoarrow_array double[10]>
#> .. ..$ length : int 10
#> .. ..$ null_count: int -1
#> .. ..$ offset : int 0
#> .. ..$ buffers :List of 2
#> .. .. ..$ :<nanoarrow_buffer validity<bool>[16][2 b]> `TRUE TRUE TRUE TRUE...`
#> .. .. ..$ :<nanoarrow_buffer data<double>[10][80 b]> `9.96 12.11 2.15 18.4...`
#> .. ..$ dictionary: NULL
#> .. ..$ children : list()
#> ..$ Infant.Mortality:<nanoarrow_array double[10]>
#> .. ..$ length : int 10
#> .. ..$ null_count: int -1
#> .. ..$ offset : int 0
#> .. ..$ buffers :List of 2
#> .. .. ..$ :<nanoarrow_buffer validity<bool>[16][2 b]> `TRUE TRUE TRUE TRUE...`
#> .. .. ..$ :<nanoarrow_buffer data<double>[10][80 b]> `22.2 20.2 10.8 20.9 ...`
#> .. ..$ dictionary: NULL
#> .. ..$ children : list()
#> $ dictionary: NULL
#> [1] Fertility Agriculture Examination Education
#> [5] Catholic Infant.Mortality
#> <0 rows> (or 0-length row.names)
#> fetched 10 rows
#> fetched rows

dbBind(res, 20)

while(!dbHasCompleted(res)) {
print(dbFetchArrow(res))
ret <- dbFetchArrow(res)
message("fetched ", ret$length, " rows")
}
#> fetched 8 rows
#> fetched rows

# Cleanup
dbClearResult(res)
Expand Down

0 comments on commit 21b5124

Please sign in to comment.