Skip to contents

Helper function to streamline queries of the WDFW Postgres database.

Usage

fetch_db_table(con, schema, table, filter = NULL)

Arguments

con

Connection to WDFW PostgreSQL database made with DBI-compliant RPostgres package. 'con' created by establish_db_con.R function.

schema

query schema

table

table in database

filter

filter to apply during query

Value

tibble of query results

Examples

if (FALSE) { # \dontrun{
a <- fetch_db_table(con, "creel", "fishery_location_lut")
b <- fetch_db_table(con, "creel", "fishery_location_lut", filter = "survey_type == 'Index'")
c <- fetch_db_table(con, "creel", "fishery_location_lut",
filter = c("survey_type == 'Index'", "section_num == '1'"))
} # }