Przeglądaj źródła

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/
Nicholas Savage 4 lat temu
rodzic
commit
f8ee4ab4a7
1 zmienionych plików z 5 dodań i 1 usunięć
  1. 5 1
      lisp/ob-sqlite.el

+ 5 - 1
lisp/ob-sqlite.el

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