Using sql language engine with Quarto #1737
Replies: 3 comments 8 replies
-
|
And as an additional question, presumably someone "taught" quarto about SQL comments, but this is currently not a documented feature, correct? Was this done just for SQL, or are there other secret languages quarto knows about? |
Beta Was this translation helpful? Give feedback.
-
|
Hi, One related follow-up question -- do sql chunks only work if the underlying engine for the rest of the notebook is knitr/R? Or also if it's jupyter/Python? Thanks |
Beta Was this translation helpful? Give feedback.
-
|
Regarding my final comment with respect to the use of The first two work, the next three fail, but the last one works again. Apparently |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I am just starting to play around with quarto. I use extensively the SQL language engine in Rmarkdown documents, so I wanted to give this a try, but there is currently no documentation on SQL in the Quarto documentation (at least none that I could find). As
#is not used for comments in SQL, I was curious how best to pass chunk options. I was surprised to find that the following two chunks both worked equivalently:My first question is which of these two is the "best" way to use chunk options in SQL chunks? I would prefer pure SQL (
--|), but#|is consistent with R and python chunks. More generally, for other Rmarkdown languages, am I correct to presume that#|will always work, but the native comment character (e.g.,;or%are used in some languages) will only work if special work has been done to "teach" quarto about that language?Second question: are there other ways of passing chunk options? For example, can block quotes (
/*...*/) be used somehow?Final question: I was surprised that
connection: dbandconnection: "db"worked, butconnection: !expr dbdid not. When is!exprnecessary and when is it not appropriate? Presumabledband"db"both get the string"db"passed to the SQL language engine and not the R objectdb, whereas!expr dbpasses the text that appears on the command line whenprint(db)is executed. Is this correct? Is there any way or need to be able to pass actual R objects as chunk options or is every chunk option in quarto eventually converted to a string?Thanks,
David
Beta Was this translation helpful? Give feedback.
All reactions