Skip to contents

Generic implementing of how to list all content available for different connectors:

Usage

list_content_cnt(connector_object, ...)

# S3 method for class 'connector_dbi'
list_content_cnt(connector_object, ...)

# S3 method for class 'connector_fs'
list_content_cnt(connector_object, ...)

Arguments

connector_object

connector The connector object to use.

...

Additional arguments passed to the method for the individual connector.

Value

A character vector of content names

Examples

# List tables in a DBI database
cnt <- connector_dbi$new(RSQLite::SQLite())

cnt |>
  list_content_cnt()
#> character(0)

# List content in a file storage
cnt <- connector_fs$new(tempdir())

cnt |>
  list_content_cnt()
#> [1] "bslib-9f68e11c24c13beda8ab56edec83b1cf"                                                             
#> [2] "downlit"                                                                                            
#> [3] "file203d297606d1"                                                                                   
#> [4] "file203d3606efd7"                                                                                   
#> [5] "file203d38a7d498"                                                                                   
#> [6] "file203d3beb2288"                                                                                   
#> [7] "file203d69e8380a"                                                                                   
#> [8] "iris.rds"                                                                                           
#> [9] "repos_https%3A%2F%2Fpackagemanager.posit.co%2Fcran%2F__linux__%2Fnoble%2Flatest%2Fsrc%2Fcontrib.rds"

# Only list CSV files using the pattern argument of list.files

cnt |>
  list_content_cnt(pattern = "\\.csv$")
#> character(0)