I'm having trouble knitting an Rmd when I set cache=TRUE for sql code chunks.
There is some discussion of a related error here and here, but those examples seem to be when output_var is set in the sql chunk and the bug was fixed a couple years ago.
The following Rmd will knit the first time, but the second time when it tries to read from the cache, I get this error:
Quitting from lines 12-13 (test-sql-cache-rmd.Rmd)
Error in fun(environment()) : invalid first argument
Calls: <Anonymous> ... call_block -> <Anonymous> -> lazyLoad -> lazyLoadDBexec -> fun
Execution halted
When cache=FALSE, the error goes away. Any ideas or is this a knitr bug?
---
title: "sql chunk"
output: html_document
---
```{r setup, include=FALSE}
con <- DBI::dbConnect(RSQLite::SQLite(), ":memory:")
knitr::opts_chunk$set(echo = TRUE, connection = "con")
```
```{sql select_1, cache=TRUE}
SELECT 1
```