% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/generics.R, R/connection-methods.R
\name{dbData-connection-accessors}
\alias{dbData-connection-accessors}
\alias{conn}
\alias{conn<-}
\alias{conn,dbData-method}
\alias{conn<-,dbData-method}
\title{Connection accessor methods for dbData objects}
\usage{
conn(x)

conn(x) <- value

\S4method{conn}{dbData}(x)

\S4method{conn}{dbData}(x) <- value
}
\arguments{
\item{x}{A \code{dbData} object}

\item{value}{A \code{DBIConnection} object}
}
\value{
For getter: The database connection. For setter: The updated object

For getter: \code{DBIConnection}. For setter: Updated object.
}
\description{
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 \code{dbData} object.
}
\details{
The connection accessor methods support multiple implementation patterns:
\enumerate{
\item Nested connection: Some classes (like dbMatrix) store connections in \code{value$src$con}
\item 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.
}
\seealso{
\linkS4class{dbData}
}
