Connect to Redshift clusters via ODBC.
In particular, the custom dbConnect() method for Redshift ODBC drivers
automatically determines whether IAM-based credentials are available, much
like other AWS SDKs and tools. This requires the paws.common package.
redshift()
# S4 method for class 'RedshiftOdbcDriver'
dbConnect(
drv,
clusterId,
server,
database,
region = NULL,
driver = NULL,
uid = NULL,
pwd = NULL,
dbUser = uid,
...
)An object that inherits from DBI::DBIDriver, or an existing DBI::DBIConnection object (in order to clone an existing connection).
The Redshift cluster identifier. Only one of clusterId or
the more verbose server is required.
The full hostname of the Redshift cluster.
The name of the Redshift database to connect to.
The AWS region the Redshift cluster runs in. Ignored when
server is provided. Defaults to the value of the environment variable
AWS_REGION, then AWS_REGION, or uses us-east-1 if both are unset.
The name of or path to a Redshift ODBC driver, or NULL to
locate one automatically.
Disable IAM credentials and manually specify a username and password for authentication.
The Redshift database account.
Further arguments passed on to dbConnect().
An OdbcConnection object with an active connection to a Redshift
cluster or SQL warehouse.
if (FALSE) { # \dontrun{
# Connect to Redshift using IAM credentials.
DBI::dbConnect(
odbc::redshift(),
clusterId = "my-testing-cluster",
database = "dev",
dbUser = "me"
)
} # }