View source: R/aqrcDBconnect.R
aqrcDBconnect | R Documentation |
This function will connect to the AQRC databases (IMPROVE or CSN). The
database connection is through a pool object. See the documentation for the
pool
package for details.
aqrcDBconnect(network = c("IMPROVE", "CSN"), server)
network |
Character string of the network to connect to (IMPROVE or CSN). |
server |
Character string of the server to connect to. Typically something like "aqrc-sql", "aqrc-sql-test", and "aqrc-sql-appdev" (default is the production database server "aqrc-sql"). |
This function will open a database connection via the pool
package. Because this is opening pool connections to the database, it is
best practice to ensure these connections are closed after database
operations are finished. For details of the pool
package see its
website at
https://github.com/rstudio/pool.
A pool connection to the database defined by the parameters.
dbPool
## Not run: poolIMP <- aqrcDBconnect("IMPROVE", "aqrc-sql-test") poolCSN <- aqrcDBconnect("CSN", "aqrc-test") # Perform some database operations with the connection. # Once complete, close the pool connection. pool::poolClose(poolIMP); rm(poolIMP) pool::poolClose(poolCSN); rm(poolCSN) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.