Guidelines
Description
Curious if using pool to establish DB connections would be possible? Just to be a bit more economical with DB connections.
Not sure if all implemented DB backends are supported by pool, but the SQL ones should be covered
Problem
In my setup, I don't have a dedicated telemetry database, rather the telemetry data are stored in the same DB as the user data. So, the logging would "compete" with users for DB connections.
Proposed Solution
The private method connect could be reworked to use pool::dbPool.
from:
# Private methods
connect = function(user, password, hostname, port, dbname, driver) {
# Initialize connection with database
private$db_con <- odbc::dbConnect(
driver,
user = user,
password = password,
dbname = dbname,
host = hostname,
port = port
)
}
to:
# Private methods
connect = function(user, password, hostname, port, dbname, driver) {
# Initialize connection with database
private$db_con <- pool::dbPool(
driver,
user = user,
password = password,
dbname = dbname,
host = hostname,
port = port
)
}
Alternatives Considered
None that I know of.
Guidelines
Description
Curious if using
poolto establish DB connections would be possible? Just to be a bit more economical with DB connections.Not sure if all implemented DB backends are supported by
pool, but the SQL ones should be coveredProblem
In my setup, I don't have a dedicated telemetry database, rather the telemetry data are stored in the same DB as the user data. So, the logging would "compete" with users for DB connections.
Proposed Solution
The private method
connectcould be reworked to usepool::dbPool.from:
to:
Alternatives Considered
None that I know of.