#' @title SQL Reader
#'
#' @description
#' Description
#'
#' @param f_pg Project enviorment option
#' @param f_db Project enviorment option
#' @param f_tb_name Project enviorment option
#'
#' @return
#' Return
#'
#' @importFrom magrittr %<>%
#' @export
SQL_reader <- function(
f_pg,
f_db,
f_tb_name
) {
# Reformat table name & colnames
f_tb_name %<>% tolower()
# Open PostgreSQL connection
f_con <- DBI::dbConnect(
drv = f_pg,
user = "drivas",
password = "",
host = "localhost",
port = 5432,
dbname = f_db
)
# Close PostgreSQL connection when process is done
on.exit(
DBI::dbDisconnect(f_con)
)
# Write to PostgreSQL table
DBI::dbReadTable(
conn = f_con,
name = f_tb_name,
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.