paleolimbot opened a new pull request, #706:
URL: https://github.com/apache/arrow-adbc/pull/706

   After #693 and https://github.com/apache/arrow-nanoarrow/pull/196 we have 
enough lifecycle management to implement some convenience methods. This makes 
it about 1000% easier to play around with queries. An example with the SQLite 
driver:
   
   ``` r
   library(adbcdrivermanager)
   
   temp <- tempfile()
   db <- adbc_database_init(adbcsqlite::adbcsqlite(), uri = temp)
   
   write_adbc(data.frame(x = 1:10), db, "some_table")
   
   read_adbc(db, "SELECT * from some_table") |> 
     tibble::as_tibble()
   #> # A tibble: 10 × 1
   #>        x
   #>    <dbl>
   #>  1     1
   #>  2     2
   #>  3     3
   #>  4     4
   #>  5     5
   #>  6     6
   #>  7     7
   #>  8     8
   #>  9     9
   #> 10    10
   
   execute_adbc(
     db, 
     "UPDATE some_table SET x = ? WHERE x >= ?",
     bind = data.frame(123, 8)
   )
   
   read_adbc(db, "SELECT * from some_table") |> 
     tibble::as_tibble()
   #> # A tibble: 10 × 1
   #>        x
   #>    <dbl>
   #>  1     1
   #>  2     2
   #>  3     3
   #>  4     4
   #>  5     5
   #>  6     6
   #>  7     7
   #>  8   123
   #>  9   123
   #> 10   123
   ```
   
   <sup>Created on 2023-05-24 with [reprex 
v2.0.2](https://reprex.tidyverse.org)</sup>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to