% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/writer.R
\name{ggsql_render}
\alias{ggsql_render}
\title{Render a spec with a writer}
\usage{
ggsql_render(writer, spec)
}
\arguments{
\item{writer}{A \code{Writer} object created by e.g. \code{\link[=vegalite_writer]{vegalite_writer()}}.}

\item{spec}{A \code{Spec} object returned by \code{\link[=ggsql_execute]{ggsql_execute()}}.}
}
\value{
Writer dependent:
\itemize{
\item \code{vegalite_writer}: A string holding the vegalite JSON representation of the
visualization
}
}
\description{
This function takes a \code{Spec} object as returned by \code{\link[=ggsql_execute]{ggsql_execute()}} and
renders it with the provided writer.
}
\examples{
reader <- duckdb_reader()
ggsql_register(reader, mtcars, "cars")
spec <- ggsql_execute(reader,
  "SELECT * FROM cars VISUALISE mpg AS x DRAW histogram"
)

ggsql_render(vegalite_writer(), spec)

}
