Executes a SQL query against SedonaDB, allowing R sedonadb_dataframe objects
or sf objects to be used directly in the SQL string via {} interpolation.
Supports piping: df |> sx_sql("SELECT * FROM {.}").
Usage
sx_sql(..., .envir = parent.frame(), verbosity = NULL)Arguments
- ...
SQL string parts (passed to
glue::glue). The first argument can optionally be a data object (context) which is ignored in string construction but available for interpolation as{.}.- .envir
Environment to evaluate expressions in. Defaults to
parent.frame().- verbosity
Character or NULL. Controls message output for this function call.
"quiet": Suppress all informational messages."info": Show standard progress and status messages."debug": Show additional diagnostic messages for troubleshooting.
If NULL (the default), uses the global
sx.verbosityoption. Seesx_options()for persistent configuration.
Examples
if (FALSE) { # \dontrun{
nc <- sx_read("shape/nc.shp")
# Reference object by name
sx_sql("SELECT * FROM {nc} WHERE AREA > 0.1")
# Reference via pipe
nc |> sx_sql("SELECT * FROM {.} WHERE AREA > 0.1")
} # }
