Am relatively new to both databases and Redshift, and I'd like to use the Connections within R Studio to be able to query a set of databases to extract subsets of data.
Specific Question: after connecting to the correct database in Redshift, how do I then specify sub databases and their tables using dbplyr
?
The main database is production
, and within that there are several sub-databases (?) such as customerdb
, supplierdb
, membersdb
.. and each of these have several tables. Say I want to subset the data of the table companies
within customerdb
, I'm trying to do this by:
# `con` is the connection to Redshift database via DBI and it connects successfully
dataset <- tbl(con, "customerdb.companies")
Error in new_result(connection@ptr, statement) :
nanodbc/nanodbc.cpp:1344: 42P01: [Amazon][Amazon Redshift] (30)
Error occurred while trying to execute a query: [SQLState 42P01]
ERROR: relation "customerdb.companies" does not exist
Have looked at various resources, from AWS to dbplyr's page, as well as other SO questions and none seem to show this setup style or methods to connect to underlying tables.