Skip to contents

Makes the sessions and responses tables and their indexes. It is safe to call on every start, because it leaves existing tables alone. survey_server() calls it for you; call it yourself to make the tables before the first user arrives.

Usage

init_database(con, quiet = FALSE)

Arguments

con

A connection from any DBI driver, or a pool::dbPool().

quiet

If TRUE, show no message when the tables are made.

Value

con, invisibly.

Examples

con <- DBI::dbConnect(RSQLite::SQLite(), ":memory:")
init_database(con)
#> ✔ Survey schema created on "SQLiteConnection"
DBI::dbListTables(con)
#> [1] "responses"       "sessions"        "sqlite_sequence"
DBI::dbDisconnect(con)