r - Can `knitr` suppress execution or output in an sql chunk? -


the document below runs sql , shows results. don't want output show up, either not running chunk, or hiding output.

is there way this?

--- output: html_document ---  ## hide sql output  first, set temporary database:  ```{r} library(rsqlite) conn <- dbconnect(sqlite(), tempfile()) df <- data.frame(value = runif(1)) dbwritetable(conn, "testtable", df) ```  show query, try not run it, , try hide output.  neither works:  runs, ,  displays table.  ```{sql connection = conn,results="hide",eval=false} select * testtable; ``` 

i output: enter image description here

i found workaround. if use mysql engine instead of sql engine, @ least eval = false works:

```{mysql eval=false} select * testtable; ``` 

will display code syntax highlighting not execute anything.

i don't know if results="hide" supported, because don't have mysql installed.


Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -