diff options
Diffstat (limited to 'lisp/org/ob-sqlite.el')
| -rw-r--r-- | lisp/org/ob-sqlite.el | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/lisp/org/ob-sqlite.el b/lisp/org/ob-sqlite.el index 84d4688ab38..fcfdb8ebd3e 100644 --- a/lisp/org/ob-sqlite.el +++ b/lisp/org/ob-sqlite.el | |||
| @@ -114,23 +114,22 @@ This function is called by `org-babel-execute-src-block'." | |||
| 114 | 114 | ||
| 115 | (defun org-babel-sqlite-expand-vars (body vars) | 115 | (defun org-babel-sqlite-expand-vars (body vars) |
| 116 | "Expand the variables held in VARS in BODY." | 116 | "Expand the variables held in VARS in BODY." |
| 117 | ;; FIXME: Redundancy with org-babel-sql-expand-vars! | ||
| 117 | (mapc | 118 | (mapc |
| 118 | (lambda (pair) | 119 | (lambda (pair) |
| 119 | (setq body | 120 | (setq body |
| 120 | (replace-regexp-in-string | 121 | (replace-regexp-in-string |
| 121 | (format "\$%s" (car pair)) | 122 | (format "\$%s" (car pair)) ;FIXME: "\$" == "$"! |
| 122 | ((lambda (val) | 123 | (let ((val (cdr pair))) |
| 123 | (if (listp val) | 124 | (if (listp val) |
| 124 | ((lambda (data-file) | 125 | (let ((data-file (org-babel-temp-file "sqlite-data-"))) |
| 125 | (with-temp-file data-file | 126 | (with-temp-file data-file |
| 126 | (insert (orgtbl-to-csv | 127 | (insert (orgtbl-to-csv |
| 127 | val '(:fmt (lambda (el) (if (stringp el) | 128 | val '(:fmt (lambda (el) (if (stringp el) |
| 128 | el | 129 | el |
| 129 | (format "%S" el))))))) | 130 | (format "%S" el))))))) |
| 130 | data-file) | 131 | data-file) |
| 131 | (org-babel-temp-file "sqlite-data-")) | 132 | (if (stringp val) val (format "%S" val)))) |
| 132 | (if (stringp val) val (format "%S" val)))) | ||
| 133 | (cdr pair)) | ||
| 134 | body))) | 133 | body))) |
| 135 | vars) | 134 | vars) |
| 136 | body) | 135 | body) |