However, there are a few key changes from the stp.
connect_to_db is a new function that wraps DBI::dbConnect. We can use it to connect to a sqlite or any other DBIDriver interface by passing the specific driver and prefix i.e., "RCC", "STP", "LOG".
init_log_con now uses connect_to_db.
init_etl takes an additional log_db_drv parameter. The goal is to be able to pass a sqlite driver when running tests. If log_db_drv is null then it defaults to using MariaDB and looking for LOG_DB_* environment variables.
disable_non_interactive_quit is a new function that prevents quit_non_interactive_run from quitting. I think this should be only be called from tests to verify all possible test cases.
is_db_con uses inherits(con, "DBIConnection") instead of checking == "S4".
This pr does a few things:
devtools::check
However, there are a few key changes from
thestp.connect_to_db
is a new function that wrapsDBI::dbConnect
. We can use it to connect toasqlite or any otherDBIDriver
interface by passing the specific driver and prefix i.e.,"RCC", "STP", "LOG"
.init_log_con
now usesconnect_to_db
.init_etl
takes an additionallog_db_drv
parameter. The goal is to be able to pass a sqlite driver when running tests. Iflog_db_drv
is null then it defaults to using MariaDB and looking forLOG_DB_*
environment variables.disable_non_interactive_quit
is a new function that preventsquit_non_interactive_run
from quitting. I think this should be only be called from tests to verify all possible test cases.is_db_con
usesinherits(con, "DBIConnection")
instead of checking== "S4"
.