dbGetPlot: Generate a plot from a SGL statement

View source: R/dbGetPlot.R

dbGetPlotR Documentation

Generate a plot from a SGL statement

Description

dbGetPlot takes a database connection and a SGL statement and returns the corresponding plot.

Usage

dbGetPlot(con, sgl_stmt)

Arguments

con

A database connection (as returned by DBI::dbConnect())

sgl_stmt

A SGL statement (string)

Value

The plot defined by the SGL statement (a sgl_plot object)

Examples

library(duckdb)
con <- dbConnect(duckdb())
dbWriteTable(con, "cars", cars)
p <- dbGetPlot(con, "
  visualize
    horsepower as x,
    miles_per_gallon as y
  from cars
  using points
")
print(p)


rsgl documentation built on June 9, 2026, 1:07 a.m.