Ihor Radchenko <[email protected]> wrote: >> I use Org mode for several recurring SQL maintenance tasks, >> and it is quite nice for that purpose.
>> Two major obstacles that one should be aware of: In- and >> output of non-texty data. Passing a variable with a value >> containing "'" or querying data that might contain for >> example "|" usually leads to "let me M-x sql-postgres RET >> real quick". :-( > You can always contribute better output handling to ob-sql :) I wish I could :-). The last time I glanced at IIRC ob-shell's code, there was no explanation what was going on, and tracing seemed to suggest that data was passed between various parts as plain text formatted as a table (this is a vague memory, so don't quote me on that). Just now (again, with only minimal effort) I found https://orgmode.org/worg/org-contrib/babel/languages/(*1) referring to ob-template.el which (CMIIW) does not contain any explanation either. So the learning curve is rather steep for casual passersby. Tim (*1) Org mode's scattering of documentation on an external website and everywhere is not unique, yet still frustrating, especially for an extension to a "self-documenting editor". Why is information that the user needs (is it "postgres" or "postgresql"?) for using ob-sql at https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-sql.html and neither in the Org mode manual nor in something else apart from a very terse comment at the start of ob-sql? Why are the "Examples Of Use" at the website not about specifically using ob-sql (how many queries can be run in a source block, and how do I manage the table not being mangled by bits in ~/.psqlrc?), but rather about bog-standard noweb stuff? "<<quote-blks("my-query")>>" evaluating to "nil" looks like a mistake. Also, IIRC one can just verbatim insert a source block in another source block with "<<my-query>>". Is this some R issue that needs to be worked around? Shouldn't it rather be documented there?
