Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## Connect to a local Postgres database running in a Docker container
- ## although the Docker part isn't of any importance here.
- ## Working with dplyr 0.7, DBI 0.7, dbplyr 1.1.0
- library(DBI)
- library(dplyr)
- library(dbplyr)
- con <- DBI::dbConnect(RPostgreSQL::PostgreSQL(), host = 'localhost', port = 8990,
- dbname = <name of db>, user = <user>, password = <pass>)
- DBI::dbListTables(con)
- deployments <- tbl(con, <name of table>)
- dbExistsTable(con, <name of table>)
- t <- dbGetQuery(con, <name of table>)
- dbDisconnect(con)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement