Connection accessor methods for dbData objects
Source:R/generics.R, R/connection-methods.R
dbData-connection-accessors.RdThese methods provide a unified interface for accessing and setting database connections across all dbverse packages. They handle different connection storage patterns across various subclasses.
Get or set the database connection for a dbData object.
Usage
conn(x)
conn(x) <- value
# S4 method for class 'dbData'
conn(x)
# S4 method for class 'dbData'
conn(x) <- valueValue
For getter: The database connection. For setter: The updated object
For getter: DBIConnection. For setter: Updated object.
Details
The connection accessor methods support multiple implementation patterns:
Nested connection: Some classes (like dbMatrix) store connections in
value$src$condbplyr connections: Objects with tbl_duckdb_connection values can use dbplyr::remote_con()
The implementation automatically tries these access patterns in order of specificity, falling back to more generic approaches if needed.
Auto-reconnects if the current connection is invalid.