Skip to contents

get_enum_values() returns existing values within an enum

Usage

get_enum_values(
  con,
  enum = c("bin_code_enum", "survey_type_enum", "life_stage_enum", "origin_enum",
    "run_mode_enum", "optics_enum", "light_source_enum", "lamp_energy_enum",
    "well_location_enum")
)

Arguments

con

A DBI connection object obtained from DBI::dbConnect()

enum

Provide one of the following:

  • "bin_code_enum" Used for generating sampling protocols and sample IDs

  • "survey_type_enum" Used for describing the survey types in permits

  • "life_stage_enum" Used for specifying chinook life stage in permits

  • "origin_enum" Used for specifying the chinook origin in permits

  • "run_mode_enum" Used for describing the run mode in the Synergy H1 protocol

  • "optics_enum" Used for describing the optics setting in the Synergy H1 protocol

  • "light_source_enum" Used for describing the light source in the Synergy H1 protocol

  • "lamp_energy_enum" Used for describing the lamp energy setting in the Synergy H1 protocol

  • "well_location_enum" Used for mapping the Synergy H1 result output to sample IDs well location in the assay results

See also

Other enum method functions: add_enum_value(), update_enum_value()

Examples

# example database connection
cfg <- config::get()
con <- DBI::dbConnect(RPostgres::Postgres(),
                      dbname = cfg$dbname,
                      host = cfg$host,
                      port = cfg$port,
                      user = cfg$username,
                      password = cfg$password)
#> Error: connection to server at "localhost" (::1), port 5432 failed: Connection refused (0x0000274D/10061)
#> 	Is the server running on that host and accepting TCP/IP connections?
#> connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused (0x0000274D/10061)
#> 	Is the server running on that host and accepting TCP/IP connections?

get_enum_values(con, "bin_code_enum")
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'dbObj' in selecting a method for function 'dbIsValid': object 'con' not found