aws_db_rds_con: Get a database connection to Amazon RDS

View source: R/database-rds.R

aws_db_rds_conR Documentation

Get a database connection to Amazon RDS

Description

Supports: MariaDB, MySQL, and Postgres

Usage

aws_db_rds_con(
  user = NULL,
  pwd = NULL,
  id = NULL,
  host = NULL,
  port = NULL,
  dbname = NULL,
  engine = 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.

engine

(character) The engine to use. optional if user, pwd, and id are supplied - otherwise required

Details

RDS supports many databases, but we only provide support for MariaDB, MySQL, and Postgres

If the engine you've chosen for your RDS instance is not supported with this function, you can likely connect to it on your own

Value

an S4 object that inherits from DBIConnection

See Also

Other database: aws_db_cluster_status(), aws_db_instance_status(), aws_db_rds_create(), aws_db_rds_list(), aws_db_redshift_con(), aws_db_redshift_create()

Examples

## Not run: 
con_rds <- aws_db_rds_con("<define all params here>")
con_rds

library(DBI)
library(RMariaDB)
dbListTables(con_rds)
dbWriteTable(con_rds, "mtcars", mtcars)
dbListTables(con_rds)
dbReadTable(con_rds, "mtcars")

library(dplyr)
tbl(con_rds, "mtcars")

## End(Not run)

sixtyfour documentation built on April 3, 2025, 8:22 p.m.