dr_sql_transform()
The input is available as
data in a private, temporary DuckDB connection.
SQL is executed unchanged by DuckDB and must return a table. This adapter is
intended for trusted analytical queries; it does not sandbox SQL.
Usage
dr_sql_transform(query)Arguments
- query
- SQL query referencing the input table
data.
Value
A transformation accepted by
dataraft.core::dr_step_transform().
Examples
\dontshow{if (requireNamespace("duckdb", quietly = TRUE)) withAutoprint(\{ # examplesIf}
dataraft.core::dr_product("totals") |>
dataraft.core::dr_add_source(data.frame(amount = c(10, 20))) |>
dataraft.core::dr_add_recipe(dataraft.core::dr_recipe() |> dataraft.core::dr_step_transform(dr_sql_transform("SELECT sum(amount) AS total FROM data"))) |>
dataraft.core::dr_run() |>
dataraft.core::dr_collect()
\dontshow{\}) # examplesIf}Documentation source snapshot · View source at 2f9432d ↗
Code examples are documented source examples; they are not executed in this website build.
Code examples are documented source examples; they are not executed in this website build.