Learn R Programming

connector (version 1.0.0)

write_datasources: Write datasources attribute into a config file

Description

Reproduce your workflow by creating a config file based on a connectors object and the associated datasource attributes.

Usage

write_datasources(connectors, file)

Value

A config file with datasource attributes which can be reused in the connect function

Arguments

connectors

A connectors object with associated "datasources" attribute.

file

path to the config file

Examples

Run this code
folder <- withr::local_tempdir("test", .local_envir = .GlobalEnv)

cnt <- connectors(fs = connector_fs(folder))

# Extract the datasources to a config file
yml_file <- tempfile(fileext = ".yml")
write_datasources(cnt, yml_file)
# Check the content of the file
cat(readLines(yml_file), sep = "\n")
# Reconnect using the new config file
re_connect <- connect(yml_file)
re_connect

Run the code above in your browser using DataLab