Skip to contents

Get a database connection to Amazon Redshift

Usage

aws_db_redshift_con(
  user,
  pwd,
  id = NULL,
  host = NULL,
  port = NULL,
  dbname = NULL,
  ...
)

Arguments

user, pwd, host, port, dbname, ...

named parameters passed on to DBI::dbConnect. Note that the user and pwd are for your AWS IAM account; and the same as those you used to create the cluster with aws_db_redshift_create()

id

(character) Cluster identifier. If you supply id, we'll fetch host, port, and dbname. If id is not supplied. you have to supply host, port, and dbname. Refer to this parameter definition in aws_db_redshift_create() for more details.

Value

an object of class RedshiftConnection

Details

The connection returned is created using RPostgres

You can manage Redshift programatically via paws::redshift

Examples

if (FALSE) {
library(DBI)
library(RPostgres)

con_rshift <- aws_db_redshift_con("<define all params here>")
con_rshift
library(RPostgres)
dbListTables(con_rshift)
dbWriteTable(con_rshift, "mtcars", mtcars)
dbListTables(con_rshift)

library(dplyr)
tbl(con_rshift, "mtcars")
}