23 lines
860 B
R
23 lines
860 B
R
#' Query a specific table in the Postgres database containing the metadata
|
|
#' @param table Table name. See [list_metadata_tables()] for valid tables.
|
|
#' @importFrom DBI dbConnect dbGetQuery
|
|
#' @importFrom RPostgres Postgres
|
|
#' @importFrom dplyr tbl
|
|
query_metadata_table <- function(table = "single_builds") {
|
|
con <- DBI::dbConnect(RPostgres::Postgres(),
|
|
dbname = "build_metadata", host = "postgres-arm-binaries-r.devxy.io",
|
|
port = 15432, user = "arm_binaries", password = Sys.getenv("PGPASS")
|
|
)
|
|
metadata <- tbl(con, table)
|
|
return(metadata)
|
|
}
|
|
|
|
#' List existing database tables
|
|
#' @export
|
|
list_metadata_tables <- function() {
|
|
con <- DBI::dbConnect(RPostgres::Postgres(),
|
|
dbname = "build_metadata", host = "postgres-arm-binaries-r.devxy.io",
|
|
port = 15432, user = "arm_binaries", password = Sys.getenv("PGPASS")
|
|
)
|
|
dbListTables(con)
|
|
}
|