View source: R/helper_testing.R
prepare_example_db | R Documentation |
Create a SQLite database for testing called test.sqlite in specified directory. This bootstraps a simple table called people with data optionally added. This should only be called from a test, vignette or roxygen example.
prepare_example_db( dir, add_data = FALSE, add_job_table = FALSE, add_log_table = TRUE, add_fk_data = FALSE, add_cyclic_fks = FALSE )
dir |
Directory to create the db in |
add_data |
If TRUE data is bootstrapped to people table |
add_job_table |
If TRUE also bootstrap job table related to people table |
add_log_table |
If TRUE also bootstrap log table using sql in inst dir |
Create a simple "people" table in the DB for testing the import process. Ideally this would be in a helper-*.R file in testthat directory but we need to be able to setup a DB for vignette. Expect the calling function to cleanup the created db if it is not in a tempdir.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.