Run renv::restore() and shiny::runApp().
Add the folling snippet to config.yml:
dev:
db_driver: sqlite
db_args:
dbname: dev.sqlite3- Run
config::get(). - Compare with
config::get(config = "dev").
Create a .Renviron file with this content:
R_CONFIG_ACTIVE=dev
- Restart your R session.
- Try
config::get()now.
- Open
app/logic/db.R. - Use the
create_pool()function to define an exportedpoolobject. - Run
box::use(app/logic/db)followed byDBI::dbReadTable(db$pool, "favorites").
- Use
log$info()to show a message when creating a DB pool. - Run
box::reload(db)and check if you get a message.
- Restart your R session and notice the warnings from pool.
- Add the following snippet to
db.R:
reg.finalizer(pool, close_pool, onexit = TRUE)
.on_unload <- function(ns) {
close_pool(pool)
}- Play with steps 4-6 and see that the warnings are gone.
- Fill in the
fetch_favorites()andfilter_favorites()functions inapp/logic/data.R. - Use
tbl(),filter(), andcollect()from dplyr.
Use the defined functions to fetch and filter the data
in the app/view/filters module.
- Add the
app/view/filtersmodule to the app. - Display the returned data using the
app/view/tablemodule.