paleolimbot opened a new pull request, #2029:
URL: https://github.com/apache/arrow-adbc/pull/2029
Closes #855.
Work in progress!
``` r
library(adbcdrivermanager)
con <- adbc_database_init(
adbcpostgresql::adbcpostgresql(),
uri =
"postgresql://localhost:5432/postgres?user=postgres&password=password"
) |>
adbc_connection_init()
nycflights13::flights |>
write_adbc(con, "flights")
stream <- nanoarrow::nanoarrow_allocate_array_stream()
stmt <- con |>
adbc_statement_init() |>
adbc_statement_set_sql_query(
"SELECT * from flights where month = 1 AND day = 1"
) |>
adbc_statement_prepare() |>
adbc_statement_execute_query(stream)
tibble::as_tibble(stream)
#> # A tibble: 842 × 19
#> year month day dep_time sched_dep_time dep_delay arr_time
sched_arr_time
#> <int> <int> <int> <int> <int> <dbl> <int>
<int>
#> 1 2013 1 1 517 515 2 830
819
#> 2 2013 1 1 533 529 4 850
830
#> 3 2013 1 1 542 540 2 923
850
#> 4 2013 1 1 544 545 -1 1004
1022
#> 5 2013 1 1 554 600 -6 812
837
#> 6 2013 1 1 554 558 -4 740
728
#> 7 2013 1 1 555 600 -5 913
854
#> 8 2013 1 1 557 600 -3 709
723
#> 9 2013 1 1 557 600 -3 838
846
#> 10 2013 1 1 558 600 -2 753
745
#> # ℹ 832 more rows
#> # ℹ 11 more variables: arr_delay <dbl>, carrier <chr>, flight <int>,
#> # tailnum <chr>, origin <chr>, dest <chr>, air_time <dbl>, distance
<dbl>,
#> # hour <dbl>, minute <dbl>, time_hour <dttm>
con |>
execute_adbc("DROP TABLE flights")
```
<sup>Created on 2024-07-22 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]