duckdb_explain_hook: Add chunk hook funtionality to print EXPLAIN results from...

View source: R/duckdb_explain_hook.R

duckdb_explain_hookR Documentation

Add chunk hook funtionality to print EXPLAIN results from DuckDB

Description

ChatGPT generated explanaition: this code defines a custom knitr hook (duckdb_explain) that modifies the rendering of SQL code chunks. When executed before a code chunk, it formats the SQL query explanation using HTML tags for preformatted code display. When executed after a code chunk, it reverts the rendering behavior to the default. This is useful for producing nicely formatted query explanations in knitr documents.

Usage

duckdb_explain_hook(all = NULL)

Arguments

all

whether to set all chunks as duckdb_explain

Value

function called for its side effects

Examples

## Not run: 
# Simply put this line on the setup chunk of your .Rmd file
# and then set the chunk option `duckdb_explain` to TRUE when
# you want to override standard printing of sql chunks
efun::duckdb_explain_hook()

## End(Not run)

edalfon/efun documentation built on June 23, 2024, 4:17 a.m.