% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/verb-collapse.R
\name{collapse.tbl_sql}
\alias{collapse.tbl_sql}
\title{Collapse a query into a subquery}
\usage{
\method{collapse}{tbl_sql}(x, ...)
}
\arguments{
\item{x}{A lazy data frame backed by a database query.}

\item{...}{Ignored.}
}
\description{
\code{collapse()} forces computation of a lazy query by wrapping it in a subquery.
This is not generally needed, but can be useful if you need to work around
database/dbplyr limitations.
}
\examples{
library(dplyr, warn.conflicts = FALSE)

db <- memdb_frame(a = c(3, 4, 1, 2), b = c(5, 1, 2, NA))
db |> filter(a <= 2) |> show_query()
db |> filter(a <= 2) |> collapse() |> show_query()
}
