Learn R Programming

connector (version 1.0.0)

add_datasource: Add a new datasource to a YAML configuration file

Description

This function adds a new datasource to a YAML configuration file by appending the provided datasource information to the existing datasources.

Usage

add_datasource(config_path, name, backend)

Value

(invisible) config_path where the configuration have been updated

Arguments

config_path

The file path to the YAML configuration file

name

The name of the new datasource

backend

A named list representing the backend configuration for the new datasource

Examples

Run this code
config <- tempfile(fileext = ".yml")

file.copy(
  from = system.file("config", "_connector.yml", package = "connector"),
  to = config
)

config <- config |>
  add_datasource(
    name = "new_datasource",
    backend = list(type = "connector_fs", path = "new_path")
  )
config

Run the code above in your browser using DataLab