View source: R/pmap_db_utilities.R
get_sql_connection | R Documentation |
This function generates a connection object. Note that most of the functions in pmapUtilities
package require the specification of connection engine in the engine
parameter of the function.
However, all functions in the package requiring a connection will look for default_engine
in the
global environment, thus it is convenient (and recommended) to assign the return value of this
to a variable called default_engine
.
get_sql_connection(
dbname = "master",
username = NULL,
password = NULL,
server = "ESMPMDBPR4.WIN.AD.JHU.EDU",
driver = "FreeTDS",
tdsver = "8.0",
verbose = F,
trusted = F
)
dbname |
string name of database to connect to |
username |
username for the database connection |
password |
password (default is NULL); option to provide password; leave this blank will result in getPass being called for interactive entry of password |
server |
defaults to 'ESMPMDBPR4.WIN.AD.JHU.EDU', but another string server could be provided |
driver |
defaults to 'FreeTDS' |
tdsver |
defaults to "8.0" |
verbose |
(logical, default=FALSE; if TRUE will provide some details of the connection) |
trusted |
(logical, default=FALSE); if set to TRUE, will attempt a trusted connection using ODBC Driver 17 for SQL SERVER and Trusted_Connection="yes" |
Database connection object as returned by DBI::dbConnect()
default_engine = get_sql_connection(dbname = 'CAMP_PMCoE_Projection', username='<jhedid>')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.