connector_dbi {connector} | R Documentation |
Create dbi
connector
Description
Initializes the connector for DBI type of storage. See ConnectorDBI for details.
Usage
connector_dbi(drv, ..., extra_class = NULL)
Arguments
drv |
Driver object inheriting from DBI::DBIDriver. |
... |
Additional arguments passed to |
extra_class |
character Extra class to assign to the new connector. |
Details
The extra_class
parameter allows you to create a subclass of the
ConnectorDBI
object. This can be useful if you want to create
a custom connection object for easier dispatch of new s3 methods, while still
inheriting the methods from the ConnectorDBI
object.
Value
A new ConnectorDBI object
Examples
# Create DBI connector
cnt <- connector_dbi(RSQLite::SQLite(), ":memory:")
cnt
# Create subclass connection
cnt_subclass <- connector_dbi(RSQLite::SQLite(), ":memory:",
extra_class = "subclass"
)
cnt_subclass
class(cnt_subclass)
[Package connector version 0.1.1 Index]