% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dm.R
\name{materialize}
\alias{materialize}
\alias{compute.dm}
\alias{collect.dm}
\title{Materialize}
\usage{
\method{compute}{dm}(x, ..., temporary = TRUE)

\method{collect}{dm}(x, ..., progress = NA)
}
\arguments{
\item{x}{A \code{dm} object.}

\item{...}{Passed on to \code{\link[=compute]{compute()}}.}

\item{temporary}{Must remain \code{TRUE}.}

\item{progress}{Whether to display a progress bar, if \code{NA} (the default)
hide in non-interactive mode, show in interactive mode. Requires the
'progress' package.}
}
\value{
A \code{dm} object of the same structure as the input.
}
\description{
\code{compute()} materializes all tables in a \code{dm} to new temporary
tables on the database.

\code{collect()} downloads the tables in a \code{dm} object as local \link{tibble}s.
}
\details{
Called on a \code{dm} object, these methods create a copy of all tables in the \code{dm}.
Depending on the size of your data this may take a long time.

To create permament tables, first create the database schema using \code{\link[=copy_dm_to]{copy_dm_to()}}
or \code{\link[=dm_sql]{dm_sql()}}, and then use \code{\link[=dm_rows_append]{dm_rows_append()}}.
}
\examples{
\dontshow{if (dm:::dm_has_financial() && rlang::is_installed("RSQLite")) withAutoprint(\{ # examplesIf}
financial <- dm_financial_sqlite()

financial \%>\%
  pull_tbl(districts) \%>\%
  dbplyr::remote_name()

# compute() copies the data to new tables:
financial \%>\%
  compute() \%>\%
  pull_tbl(districts) \%>\%
  dbplyr::remote_name()

# collect() returns a local dm:
financial \%>\%
  collect() \%>\%
  pull_tbl(districts) \%>\%
  class()
\dontshow{\}) # examplesIf}
}
