I recently discovered that I could create SQL scripts in RStudio and execute them and see the results in the SQL Results window in RStudio. Pretty slick!
RStudio determines which connection to run the SQL on by the header comment in the SQL text:
-- !preview conn=DBI::dbConnect(RSQLite::SQLite())
Where is this documented? I'm wondering what the
!preview means. Are there other options? Can I use
rstudioapi::askForPassword("Enter your pw") in that somehow? It seems like all these things should be in the documentation, but I can't find any documentation around SQL files in RStudio. Any help is appreciated!