Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(c/driver/framework): Add documentation for building a driver using the driver framework #2186

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

paleolimbot
Copy link
Member

@paleolimbot paleolimbot commented Sep 24, 2024

Example driver in action:

library(adbcdrivermanager)

drv <- adbc_driver(
  "/Users/deweydunnington/Desktop/rscratch/arrow-adbc/docs/source/cpp/recipe_driver/build/libdriver_example.dylib",
  "AdbcDriverExampleInit"
)

db <- drv |> adbc_database_init(uri = paste0("file://", getwd()))
con <- db |> adbc_connection_init()

nycflights13::flights |> 
  write_adbc(con, "flights.arrows", mode = "create")

con |> 
  read_adbc("SELECT * FROM flights.arrows") |> 
  tibble::as_tibble()
#> # A tibble: 336,776 × 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
#> # ℹ 336,766 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>

Created on 2024-09-24 with reprex v2.1.1

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I'm not mistaken we already have cpp_recipe.sh for testing? Can we just fold all the test scripts into one?

(We could even have a single parent CMake that adds the quickstart/driver example as child CMakes, though I can understand if you want the driver example to be fully self-contained there)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a self-contained CMakeLists.txt is more realistic although I'm open to any suggestions here! I mostly just tried to emulate the existing art here which is great!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I'm mostly just saying, we can just have a single shell script to invoke all the CMake builds for recipes. Not too big deal to me though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants