Arguments
- db
db A database connection, as created by
create_db().- lazy
Whether to evaluate lazily using dbplyr.
Examples
# Create a database
db <- create_db(tempdir(), "mydb.db")
# Add some participants
DBI::dbExecute(db, "INSERT INTO Study VALUES('study1', 'data_format1')")
#> [1] 1
DBI::dbExecute(db, "INSERT INTO Participant VALUES('participant1', 'study1')")
#> [1] 1
# Get the participants
get_participants(db)
#> participant_id study_id
#> 1 participant1 study1
# Cleanup
close_db(db)
file.remove(file.path(tempdir(), "mydb.db"))
#> [1] TRUE
