-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(c/driver/postgresql): Enable basic connect/query workflow for Re…
…dshift (#2219) Just following up on #1563 to see if the missing `typarray` column is the only issue. To get the details right might be a large project, but we might be able to support a basic connection without too much effort. Paramter binding and non-COPY result fetching seem to work...the default query fetch method (COPY) is not supported, `connection_get_info()` fails, and at a glance, `connection_get_objects()` might be returning incorrect results (and fails at the column depth). ``` r library(adbcdrivermanager) db <- adbc_database_init( adbcpostgresql::adbcpostgresql(), uri = Sys.getenv("ADBC_REDSHIFT_TEST_URI"), adbc.postgresql.load_array_types = FALSE ) con <- db |> adbc_connection_init() stmt <- con |> adbc_statement_init(adbc.postgresql.use_copy = FALSE) stream <- nanoarrow::nanoarrow_allocate_array_stream() stmt |> adbc_statement_bind(data.frame(45)) |> adbc_statement_set_sql_query("SELECT 1 + $1 as foofy, 'string' as foofy_string") |> adbc_statement_execute_query(stream) #> [1] -1 tibble::as_tibble(stream) #> # A tibble: 1 × 2 #> foofy foofy_string #> <dbl> <chr> #> 1 46 string ``` <sup>Created on 2024-10-04 with [reprex v2.1.1](https://reprex.tidyverse.org)</sup> --------- Co-authored-by: William Ayd <[email protected]>
- Loading branch information
1 parent
9ac8f6c
commit 28b8c1b
Showing
13 changed files
with
339 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.