Sometimes we need to get bits of data from databases. And one of the quick 
ways to do this is pass an SQL query to Mysql or Postgresql without loading 
up the special database specific (or not) Julia libraries. Backticks work 
well up to a point.
For example `psql $opts -c $sql` works nicely if $opts is an array of 
strings where there is no space between flag and value, as in 
["-hlocalhost","..."] to indicate which server to access. It has to be an 
array, a simple string does not fly since it is inserted with wrapping 
quotes intact. The $sql can be a string, which is nice.
I find I can pass pretty much any option in $opts but have hit a roadblock 
when trying to pass an output option such as "--pset="footer=off" at which 
point I seem to lose control of the quotes again. It's not a blocker since 
I can just adjust the result once it has been returned. Just interested to 
know if there is a workaround.

Reply via email to