Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code folding and cache = TRUE do not work for SQL engine #914

Closed
pkopps opened this issue Dec 16, 2016 · 3 comments · Fixed by yihui/knitr#1544
Closed

Code folding and cache = TRUE do not work for SQL engine #914

pkopps opened this issue Dec 16, 2016 · 3 comments · Fixed by yihui/knitr#1544
Milestone

Comments

@pkopps
Copy link

@pkopps pkopps commented Dec 16, 2016

sessionInfo()

R version 3.3.0 (2016-05-03)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 14.04.5 LTS

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] RSQLite_1.1

loaded via a namespace (and not attached):
 [1] backports_1.0.4 magrittr_1.5    rprojroot_1.1   htmltools_0.3.5 DBI_0.5-1       tools_3.3.0     yaml_2.1.14     memoise_1.0.0   Rcpp_0.12.8.2   stringi_1.1.1  
[11] rmarkdown_1.2   knitr_1.15.1    stringr_1.1.0   digest_0.6.10   evaluate_0.10 

.Rmd code below

---
title: "Untitled"
author: "Patrick Kopps"
date: "December 14, 2016"
output:
  html_document:
    code_folding: hide
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)

library(DBI)
db <- dbConnect(RSQLite::SQLite(), dbname = "sql.sqlite")
```

```{sql, connection=db, output.var="df", echo = TRUE, eval = FALSE, cache = TRUE}
SELECT * FROM trials
```

```{r df, eval = FALSE}
df
```

The "code" button above and to the right of the SQL chunk will be missing

It would be amazing to have end users of Rmarkdown output be able to see how data was pulled from a SQL DB in the event of any accuracy/logic (filtering typically) concerns

I tried messing with the different chunk arguments but no luck

Also caching with the SQL engine does not work

@pkopps pkopps changed the title Code folding does not work for SQL engine Code folding and cache = TRUE do not work for SQL engine Jan 26, 2017
@yihui yihui added this to the v1.8 milestone Oct 16, 2017
@yihui yihui modified the milestones: v1.8, v1.9 Nov 15, 2017
@stst6561
Copy link

@stst6561 stst6561 commented Dec 17, 2017

Somewhat unsurprisingly caching SQL engine chunks also does not work when knitting Rsweave files.

@yihui
Copy link
Member

@yihui yihui commented May 11, 2018

Fixed in the development version of knitr:

devtools::install_github('yihui/knitr')

Sorry, I wish I had looked at this issue earlier. It was actually fairly easy to fix.

@github-actions
Copy link

@github-actions github-actions bot commented Nov 3, 2020

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants