ejc-sql icon indicating copy to clipboard operation
ejc-sql copied to clipboard

Where would be a good place to escape/handle the pipe char "|" in the results?

Open mbarton98 opened this issue 2 years ago • 1 comments

I have been using ejc-sql for adhoc queries for a while to integrate with my notes in org mode. Recently I noticed my data was shifted over with the wrong values for the columns. Turns out one of the columns had the "|" in the middle of a string value and that was interpreted as a column boundary.

I might be able to patch this, but wanted to get your opinion first on whether it should be done in the clojure or elisp code.

mbarton98 avatar Aug 31 '23 20:08 mbarton98

It does not seem trivial. I tried in org result table to surround the string with double quotes, but org still interpreted the pipe char. Even tried | (backslash pipe) and that did not work. I ended up just replacing the pipe with a unicode BROKEN BAR "¦". Seems like I can just hack that when I see a problem with a result unless you can think of a better solution that does not involve modifying the returned value stored in the database.

mbarton98 avatar Aug 31 '23 21:08 mbarton98