% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dbMatrix.R, R/ingest.R
\name{as.dbMatrix}
\alias{as.dbMatrix}
\title{Convert \code{\link[Matrix:Matrix]{Matrix::Matrix}} to \code{\link{dbMatrix}}}
\usage{
as.dbMatrix(x, con = NULL, name = "dbMatrix", overwrite = FALSE, ...)

as.dbMatrix(x, con = NULL, name = "dbMatrix", overwrite = FALSE, ...)
}
\arguments{
\item{x}{Object to convert (e.g., matrix, dgCMatrix)}

\item{con}{DBI or duckdb connection object}

\item{name}{Table name to assign within database}

\item{overwrite}{Whether to overwrite if table already exists}

\item{...}{Additional arguments passed to methods}
}
\value{
A \code{\link{dbDenseMatrix}} for dense matrix inputs or a \code{\link{dbSparseMatrix}}
for sparse matrix inputs. The returned object keeps the input dimensions
and dimnames while storing matrix values in DuckDB.
}
\description{
Converts in-memory \code{\link{matrix}}, \code{\link[Matrix:dgeMatrix-class]{Matrix::dgeMatrix}}, or
\code{\link[Matrix:dgCMatrix-class]{Matrix::dgCMatrix}} into a \code{\link{dbMatrix}} object.

Generic function to convert in-memory objects to \code{dbMatrix} objects.
}
\details{
If no \code{con} is provided, a temporary in-memory database connection is created.
If no \code{name} is provided, a unique table name is generated.
}
\concept{dbMatrix}
