RImport: Manage R based data import.

RImportR Documentation

Manage R based data import.

Description

Manage R based data import.

Manage R based data import.

Details

This object should not be initialised directly. Use dettl to create the object.

Import can be run by working with import object returned by dettl or by running top-level functions. Run the import by working with this object if you want to step through the import process stage by stage and inspect the data after each stage.

Super class

dettl::Import -> RImport

Methods

Public methods

Inherited methods

Method reload()

Reload the objects sources to refresh source code or repair a broken Postgres connection.

Usage
RImport$reload()

Method read_config()

Read and parse config from path.

Usage
RImport$read_config()

Method get_extracted_data()

Get the extracted data created by the extract step

Usage
RImport$get_extracted_data()
Returns

The extracted data


Method get_transformed_data()

Get the transformed data created by the transform step

Usage
RImport$get_transformed_data()
Returns

The transformed data


Method extract()

Run the extract stage of the data import

Usage
RImport$extract()

Method transform()

Run the transform stage of the data import

Usage
RImport$transform()

Method pre_modify_checks()

Run suite of checks to verify that db can be modified

Usage
RImport$pre_modify_checks(dry_run, allow_dirty_git)
Arguments
dry_run

Whether to run in dry run mode. If TRUE then any database changes will be rolled back. Defaults to FALSE.

allow_dirty_git

If TRUE then skips check that the import is up to date with remote git repo. FALSE by default.


Method run_import()

Run multiple stages of the data import

Usage
RImport$run_import(
  comment = NULL,
  dry_run = FALSE,
  allow_dirty_git = FALSE,
  stage = c("extract", "transform"),
  save = FALSE
)
Arguments
comment

Optional comment to be written to db log table when import is run.

dry_run

If TRUE then any changes to the database will be rolled back.

allow_dirty_git

If TRUE then skips check that the import is up to date

stage

The stage or stages of the import to be run.

save

Path and name to save data from each stage at, if TRUE then will save to a tempfile.

Examples

path <- dettl:::prepare_test_import(
  system.file("examples", "person_information", package = "dettl"),
  system.file("examples", "dettl_config.yml", package = "dettl"))
import_path <- file.path(path, "person_information")

import <- dettl::dettl(import_path, db_name = "test")
import$extract()
import$transform()
import$load()


vimc/dettl documentation built on Oct. 6, 2022, 2:13 p.m.