I would like to run a sql chunk in the background of an R notebook. The chunk makes a table and takes ~20 minutes. Like with the jobs tab, I wonder if there is a way to run an rmarkdown chunk as a 'job'?
```{sql, connection = conn}
CREATE TABLE db.dans_data AS
SELECT * FROM gov.data
LIMIT 100
(By the way, I'm not really looking for a 'hack' to do this. I'd like to keep the whole analysis together if possible, and if there's some parameter I can add to put it in the background, great! If not, no big deal)
If you only want to run this chunk occasionally, it might be worth looking at the options for caching it. You can either use the cache system built into rmarkdown chunk arguments, or an a solution like the drake package. I prefer the drake package.