schema_source: Source schema file into dependency graph object

Description Usage Arguments Details

View source: R/schema_source.R

Description

The functions parses table schema (from database) and saves its structure yaml format. The defined structure is then used to prepare schema dependency graph, that is:

Usage

1
2
3
4
5
6
schema_source(
  source,
  schema = "public",
  file = if (is.character(source)) source else file.path(getwd(), "schema.yml"),
  faker_opts = getOption("dfkr_options", default_faker_opts)
)

Arguments

source

Connection to Redshift or Postgres database or path to YAML configuration file from which schema metadata should be sourced. When missing file defined file will be sourced if existing.

schema

Schema name from which the structure should be sourced.

file

Path to yaml file describing database schema, or target file when schema should be saved (when db_conn not mising). See vignette('todo').

faker_opts

Structure sourcing and columns simulation config.

Details

Detected dependencies are then saved in R6Class object that is returned and possible to pass for further methods. See schema_methods.

Keeping the schema as a graph allows to perform simulation process in proper order, preserving table dependencies and constraints.


DataFakeR documentation built on Sept. 24, 2021, 1:06 a.m.