Learn R Programming

odbc.resourcer (version 1.0.0)

MSSQLResourceConnector: MS SQL DBI resource connector

Description

MS SQL DBI resource connector

MS SQL DBI resource connector

Arguments

Format

A R6 object of class MSSQLResourceConnector

Super classes

resourcer::DBIResourceConnector -> odbc.resourcer::ODBCResourceConnector -> MSSQLResourceConnector

Methods

Inherited methods


Method new()

Creates a new MSSQLResourceConnector instance.

Usage

MSSQLResourceConnector$new()

Returns

A MSSQLResourceConnector object.


Method isFor()

Check that the provided resource has a URL that locates a MS SQL object: the URL scheme must be "odbc+mssql".

Usage

MSSQLResourceConnector$isFor(resource)

Arguments

resource

The resource object to validate.

Returns

A logical.


Method getConnectionParameters()

Get the MS SQL ODBC driver connection string.

Usage

MSSQLResourceConnector$getConnectionParameters(resource)

Arguments

resource

A valid resource object.

Returns

The MS SQL ODBC driver connection parameters list.


Method clone()

The objects of this class are cloneable with this method.

Usage

MSSQLResourceConnector$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Details

Makes a ODBC DBI connection to a MS SQL server from a resource description.

Examples

Run this code
if (FALSE) {
# Create a resource
res <- resourcer::newResource(
  url = "odbc+mssql://localhost:1433/EpidemiologyDB/PatientData", 
  identity = "sa", secret = "YourStrong@Password123")
# Create a resource client
client <- resourcer::newResourceClient(res)
# Coerce resource to a data frame
df <- client$asDataFrame()
# Disconnect the client
client$close()
}

Run the code above in your browser using DataLab