.-'''-. ,---------. ,-----. ,---. .--. .-''-. .-------. / _ \\ \ .' .-, '. | \ | | .'_ _ \ | _ _ \ (`' )/`--' `--. ,---'/ ,-.| \ _ \ | , \ | | / ( ` ) '| ( ' ) | (_ o _). | \ ; \ '_ / | :| |\_ \| |. (_ o _) ||(_ o _) / (_,_). '. :_ _: | _`,/ \ _/ || _( )_\ || (_,_)___|| (_,_).' __ .---. \ : (_I_) : ( '\_/ \ ;| (_ o _) |' \ .---.| |\ \ | | \ `-' | (_(=)_) \ `"/ \ ) / | (_,_)\ | \ `-' /| | \ `' / \ / (_I_) '. \_/``".' | | | | \ / | | \ / `-...-' '---' '-----' '--' '--' `'-..-' ''-' `'-'
Stoner is a helper package for writing montagu-imports concerning touchstones and associated responsibilities and expectations. It allows creation of or changes to a touchstone to be specified by CSV files.
install.packages("stoner")
meta
inside that import folder, or use stoner::stone_dump(con, touchstone, path)
to dump a set of CSVs for an existing touchstone, which you could (carefully) modify.stoner::stone_extract(path, con)
stoner::stone_test_extract(extracted_data)
stoner::stone_transform(extracted_data)
stoner::stone_test_transform(transform_data)
stoner::stone_load(transformed_data, con)
The above is the simplest case. You should also write some load tests as usual, but these can now concentrate entirely on what rows the particular import is expected to add. See the vignette for more detail.
Some unit tests require a database connection to be able to run. Use helper commands to start a docker container with a testing database * ./inst/db/db_start
- to start the test database * ./inst/db/db_stop
- stop the test database * ./inst/db/db_clear
- remove all data from the test database
Or from R
test_db_start()
test_db_stop()
test_db_clear()