Copies an example import to a new temp directory, sets up git for the directory and creates a test SQLite DB in the temp directory as test.sqlite.

prepare_test_import(
  example_dir = "example",
  dettl_config = "dettl_config.yml",
  create_db = TRUE,
  add_data = FALSE,
  add_job_table = FALSE,
  add_log_table = TRUE,
  add_fk_data = FALSE,
  add_cyclic_fks = FALSE
)

Arguments

example_dir

The example directory to copy to temp.

dettl_config

Path to the dettl config file.

create_db

If TRUE then test SQLite db will be created

add_data

If TRUE data is bootstrapped to people table in test DB.

add_job_table

If TRUE also bootstrap job table related to people table.

add_log_table

If TRUE then also bootstrap log table.

add_fk_data

If TRUE then bootstrap three tables with foreign key

add_cyclic_fks

If TRUE then bootstrap two tables with cyclic foreign key constraints. constraints for testing automatic reading of foreign key constraints from db.

Details

This should only be called from a test, vignette or roxygen example.

Examples

dettl:::prepare_test_import(
  system.file("examples", "person_information", package = "dettl"),
  system.file("examples", "dettl_config.yml", package = "dettl")
)
#> [1] "/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T//RtmpiqOfW1/file14a9424f482e"