This is a helper function that retrieves the most recent SQL query generated by dbplyr, which can be useful for debugging.
Examples
library(dplyr, warn.conflicts = FALSE)
df <- lazy_frame(x = 1:3)
df |> filter(x > 1)
#> <SQL>
#> SELECT "df".*
#> FROM "df"
#> WHERE ("x" > 1.0)
last_sql()
#> <SQL> SELECT "df".*
#> FROM "df"
#> WHERE ("x" > 1.0)
