3030# ' @param mode One of `"create"`, `"append"`, `"replace"`, `"create_append"` (error if the schema
3131# ' is not compatible or append otherwise), or `"default"` (use the `adbc.ingest.mode`
3232# ' argument of [adbc_statement_init()]). The default is `"default"`.
33+ # ' @param catalog_name If not `NULL`, the catalog to create/locate the table in.
34+ # ' **This API is EXPERIMENTAL.**
35+ # ' @param db_schema_name If not `NULL`, the schema to create/locate the table in.
36+ # ' **This API is EXPERIMENTAL.**
3337# ' @param query An SQL query
3438# ' @param bind A data.frame, nanoarrow_array, or nanoarrow_array_stream of
3539# ' bind parameters or NULL to skip the bind/prepare step.
@@ -69,7 +73,9 @@ execute_adbc <- function(db_or_con, query, ..., bind = NULL) {
6973# ' @export
7074write_adbc <- function (tbl , db_or_con , target_table , ... ,
7175 mode = c(" default" , " create" , " append" , " replace" , " create_append" ),
72- temporary = FALSE ) {
76+ temporary = FALSE ,
77+ catalog_name = NULL ,
78+ db_schema_name = NULL ) {
7379 UseMethod(" write_adbc" , db_or_con )
7480}
7581
@@ -113,7 +119,9 @@ execute_adbc.default <- function(db_or_con, query, ..., bind = NULL, stream = NU
113119# ' @export
114120write_adbc.default <- function (tbl , db_or_con , target_table , ... ,
115121 mode = c(" default" , " create" , " append" , " replace" , " create_append" ),
116- temporary = FALSE ) {
122+ temporary = FALSE ,
123+ catalog_name = NULL ,
124+ db_schema_name = NULL ) {
117125 assert_adbc(db_or_con , c(" adbc_database" , " adbc_connection" ))
118126 mode <- match.arg(mode )
119127
@@ -127,6 +135,8 @@ write_adbc.default <- function(tbl, db_or_con, target_table, ...,
127135 stmt <- adbc_statement_init(
128136 con ,
129137 adbc.ingest.target_table = target_table ,
138+ adbc.ingest.target_catalog = catalog_name ,
139+ adbc.ingest.target_db_schema = db_schema_name ,
130140 adbc.ingest.mode = if (! identical(mode , " default" )) paste0(" adbc.ingest.mode." , mode ),
131141 adbc.ingest.temporary = if (temporary ) " true"
132142 )
0 commit comments