SQLResourceClient {resourcer} | R Documentation |
SQL database resource client
Description
SQL database resource client
SQL database resource client
Format
A R6 object of class SQLResourceClient
Details
Resource client that connects to a SQL database supported by DBI.
Super class
resourcer::ResourceClient
-> SQLResourceClient
Methods
Public methods
Inherited methods
Method new()
Creates a SQLResourceClient from a resource.
Usage
SQLResourceClient$new(resource, dbi.connector = NULL)
Arguments
resource
The resource object.
dbi.connector
An optional DBIResourceConnector object. If not provided, it will be looked up in the DBIResourceConnector registry.
Returns
The SQLResourceClient object.
Method getConnection()
Get or create the DBI connection object that will access the resource.
Usage
SQLResourceClient$getConnection()
Returns
The DBI connection object.
Method asDataFrame()
Coerce the SQL table to a data.frame.
Usage
SQLResourceClient$asDataFrame(...)
Arguments
...
Additional parameters (not used).
Returns
A data.frame (more specifically a tibble).
Method asTbl()
Get the SQL table as a dplyr's tbl.
Usage
SQLResourceClient$asTbl()
Returns
A dplyr's tbl object.
Method close()
Silently close the DBI connection.
Usage
SQLResourceClient$close()
Method clone()
The objects of this class are cloneable with this method.
Usage
SQLResourceClient$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.