lisp/ob-sqlite.el: Prevent output from being incorrectly parsed if it contains double-quotes.

* lisp/ob-sqlite.el (org-babel-sqlite--read-cell): New function.
(org-babel-sqlite-table-or-scalar): Use `org-babel-sqlite--read-cell'
instead of `org-babel-string-read' to prevent data from being ignored
if it contains double-quotes.

Reported-by: learnorchids@gmail.com
Link: https://orgmode.org/list/CAK5xwica4i8h09ObzCVPx2pe-T6B0_ju_MXiduRiY7GH+PkE_A@mail.gmail.com/
This commit is contained in:
Nicholas Savage 2021-05-04 11:02:20 -04:00 committed by Bastien
parent b718b7035d
commit f8ee4ab4a7
1 changed files with 5 additions and 1 deletions

View File

@ -137,7 +137,7 @@ This function is called by `org-babel-execute-src-block'."
(mapcar (lambda (row)
(if (eq 'hline row)
'hline
(mapcar #'org-babel-string-read row)))
(mapcar #'org-babel-sqlite--read-cell row)))
result)))
(defun org-babel-sqlite-offset-colnames (table headers-p)
@ -151,6 +151,10 @@ This function is called by `org-babel-execute-src-block'."
Prepare SESSION according to the header arguments specified in PARAMS."
(error "SQLite sessions not yet implemented"))
(defun org-babel-sqlite--read-cell (cell)
"Process CELL to remove unnecessary characters."
(org-babel-read cell t))
(provide 'ob-sqlite)
;;; ob-sqlite.el ends here