These 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.
conn(x)conn(x) <- value
# S4 method for dbData
conn(x)
# S4 method for dbData
conn(x) <- value
For getter: The database connection. For setter: The updated object
For getter: DBIConnection. For setter: Updated object.
A dbData object
A DBIConnection object
The connection accessor methods support multiple implementation patterns:
Nested connection: Some classes (like dbMatrix) store connections in value$src$con
dbplyr 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.
dbData