sd_db_config function

Configure database settings

Configure database settings

Set up or modify database configuration settings in a .env file. These settings are used to establish database connections for storing survey responses.

sd_db_config( host = NULL, dbname = NULL, port = NULL, user = NULL, table = NULL, password = NULL, interactive = NULL )

Arguments

  • host: Character string. Database host
  • dbname: Character string. Database name
  • port: Character string. Database port
  • user: Character string. Database user
  • table: Character string. Table name
  • password: Character string. Database password
  • interactive: Logical. Whether to use interactive setup. Defaults to TRUE if no parameters provided

Returns

Invisibly returns a list of the current configuration settings

Examples

if (interactive()) { # Interactive setup sd_db_config() # Update specific settings sd_db_config(table = "new_table") # Update multiple settings sd_db_config( host = "new_host", port = "5433", table = "new_table" ) }

See Also

  • sd_db_connect() to connect to the database
  • Maintainer: John Paul Helveston
  • License: MIT + file LICENSE
  • Last published: 2025-03-18