Get a database connection to Amazon Redshift
Arguments
- user, pwd, host, port, dbname, ...
named parameters passed on to DBI::dbConnect. Note that the
user
andpwd
are for your AWS IAM account; and the same as those you used to create the cluster withaws_db_redshift_create()
- id
(character) Cluster identifier. If you supply
id
, we'll fetchhost
,port
, anddbname
. Ifid
is not supplied. you have to supplyhost
,port
, anddbname
. Refer to this parameter definition inaws_db_redshift_create()
for more details.
Details
The connection returned is created using RPostgres
You can manage Redshift programatically via paws::redshift
See also
Other database:
aws_db_cluster_status()
,
aws_db_instance_status()
,
aws_db_rds_con()
,
aws_db_rds_create()
,
aws_db_rds_list()
,
aws_db_redshift_create()
Examples
if (FALSE) { # \dontrun{
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")
} # }