Create a new PostgreSQL database.

psql_create_db(
  dbname,
  config_path = getOption("psql.config_path", NULL),
  config_value = getOption("psql.config_value", "default")
)

Arguments

dbname

A string of the name of the new database to create.

config_path

A string of a file path to the yaml configuration file. The default value grabs the file path from the psql.config_path option and uses NULL if no value supplied.

config_value

A string of the name of value. The default value grabs the value from the psql.config_value option and uses "default" if no value is supplied.

Value

TRUE (or errors).

Details

The function open and closes its own database connection. You do not need to close the database connection afterwards.

Examples

if (FALSE) { # \dontrun{
psql_create_db("new_database")
psql_create_db("new_database", config_path = "keys/config.yml")
} # }