Skip to content

Commit

Permalink
cache sql result
Browse files Browse the repository at this point in the history
the original author of this idea is @yihui: yihui#1542 (review)
  • Loading branch information
yutannihilation committed May 10, 2018
1 parent 4b64980 commit 449b5a2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion R/block.R
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,10 @@ block_exec = function(options) {
output = knit_hooks$get('chunk')(output, options)
if (options$cache) block_cache(
options, output,
if (options$engine == 'stan') options$engine.opts$x else character(0)
switch(
options$engine,
'stan' = options$engine.opts$x, 'sql' = options$output.var
)
)
return(if (options$include) output else '')
}
Expand Down

0 comments on commit 449b5a2

Please sign in to comment.