config.yml file connect to two databases

Hello,
I am using the config and pool packages in my shiny app. I need to connect to data tables stored in two database schema within the same database.
My question is how to configure the config.yml file and pool to do this.
My config.yml file:

default:
database:
Driver: 'PostgreSQL'
Server: xxxxxx
Database: 'db1'
UID: xxxxxx
PWD: xxxxxx
Port: xxxx
db2:
Driver: 'PostgreSQL'
Server: xxxxxx
Database: 'db2'
UID: xxxxxxx
PWD: xxxxxx
Port: xxxx

"db1' and "db2" are the two database schema. The current code produces the following error:
Warning in readLines(con) : incomplete final line found on '\config.yml'
Any suggestions about how to structure this file so that it reads two connections?

My pool code:

config <- get("database")
db1Pool <- dbPool(
drv <- dbDriver(config$Driver),
dbname = config$Database,
host = config$Server,
port = config$Port,
user = config$UID,
password = config$PWD
)

db2_con <- get("acs")
db2Pool <- dbPool(
drv <- dbDriver(db2_con$Driver),
dbname = db2_con$Database,
host = db2_con$Server,
port = db2_con$Port,
user = db2_con$UID,
password = db2_con$PWD
)

I'm not sure how to structure the pool. Do I need two independent pools to access two database schema?

Would appreciate any insights.
TIA
AB

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.