read_adbc | R Documentation |
These are convenience methods useful for testing connections. Note that
S3 dispatch is always on db_or_con
(i.e., drivers may provide their own
implementations).
read_adbc(db_or_con, query, ..., bind = NULL)
execute_adbc(db_or_con, query, ..., bind = NULL)
write_adbc(
tbl,
db_or_con,
target_table,
...,
mode = c("default", "create", "append"),
temporary = FALSE
)
db_or_con |
An adbc_database or adbc_connection. If a database, a
connection will be opened. For |
query |
An SQL query |
... |
Passed to S3 methods. |
bind |
A data.frame, nanoarrow_array, or nanoarrow_array_stream of bind parameters or NULL to skip the bind/prepare step. |
tbl |
A data.frame, nanoarrow_array, or nanoarrow_array_stream. |
target_table |
A target table name to which |
mode |
One of "create", "append", or "default" (error if the schema is not compatible or append otherwise). |
temporary |
Use TRUE to create a table as a temporary table. |
read_adbc()
: A nanoarrow_array_stream
execute_adbc()
: db_or_con
, invisibly.
write_adbc()
: tbl
, invisibly.
# On a database, connections are opened and closed
db <- adbc_database_init(adbc_driver_log())
try(read_adbc(db, "some sql"))
try(execute_adbc(db, "some sql"))
try(write_adbc(mtcars, db, "some_table"))
# Also works on a connection
con <- adbc_connection_init(db)
try(read_adbc(con, "some sql"))
try(execute_adbc(con, "some sql"))
try(write_adbc(mtcars, con, "some_table"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.