DBIResourceConnector: DBI resource connector

DBIResourceConnectorR Documentation

DBI resource connector

Description

DBI resource connector

DBI resource connector

Format

A R6 object of class DBIResourceConnector

Details

Makes a DBI connection from a resource description, used in SQLResourceClient that is based on DBI.

Methods

Public methods


Method new()

Creates a new DBIResourceConnector instance

Usage
DBIResourceConnector$new()
Returns

A DBIResourceConnector object.


Method isFor()

Check that the provided parameter is of class "resource".

Usage
DBIResourceConnector$isFor(resource)
Arguments
resource

The resource object to validate.

Returns

A logical.


Method createDBIConnection()

Stub function which subclasses will implement to create a DBI connection object from a resource.

Usage
DBIResourceConnector$createDBIConnection(resource)
Arguments
resource

A valid resource object.


Method getTableName()

Get the SQL table name from the resource URL.

Usage
DBIResourceConnector$getTableName(resource)
Arguments
resource

A valid resource object.

Returns

The SQL table name.


Method readDBTable()

Read a table as a vanilla tibble using DBI connection object.

Usage
DBIResourceConnector$readDBTable(conn, resource)
Arguments
conn

A DBI connection object.

resource

A valid resource object.

Returns

A vanilla tibble.


Method readDBTibble()

Read a table as a SQL tibble using DBI connection object.

Usage
DBIResourceConnector$readDBTibble(conn, resource)
Arguments
conn

A DBI connection object.

resource

A valid resource object.

Returns

A SQL tibble.


Method closeDBIConnection()

Disconnect the DBI connection.

Usage
DBIResourceConnector$closeDBIConnection(conn)
Arguments
conn

A DBI connection object.


Method clone()

The objects of this class are cloneable with this method.

Usage
DBIResourceConnector$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


resourcer documentation built on April 25, 2023, 5:10 p.m.