Learn R Programming

RSQLServer (version 0.2.0)

get_server_details: Get server details from YAML file

Description

The sql.yaml file in a user's HOME directory can store server details and login credentials (in plaintext). This works around the instability associated with jTDS's single-sign on functionality. The YAML file format is documented in this package's README file, while an example is provided in extdata/sql.yaml (see example). At a high level, each server should be documented in its own associative array with each aspect of the server documented in an associative array.

Usage

get_server_details(server, file = NULL)

Arguments

server
corresponds to the server name key in the YAML file and should be a string.
file
defaults to NULL which means that it will use $HOME/sql.yaml.

Value

a named list of server details if this is specified in the file. It stops and returns an error if port and type keys are not specified for found server. NULL is returned if the file does not contain the server key

See Also

RSQLServer README YAML Example SQL Server instance

Examples

Run this code
# See link below
aw <- dbConnect(RSQLServer::SQLServer(), server = "mhknbn2kdz.database.windows.net",
 database = 'AdventureWorks2012',
 properties = list(user = "sqlfamily", password = "sqlf@m1ly"))
dbListTables(aw)

Run the code above in your browser using DataLab