Closed hh closed 8 months ago
Here's a possible work around if there isn't already something obvious that I'm missing.
Maybe something like:
(defun org-babel-sql-mode-initiate-session (&optional session _params)
"Return the comint buffer for this `SESSION'.
Determines the buffer from values in `PARAMS'."
(let* ((bufname (org-babel-sql-mode--buffer-name _params))
(sql-bufname (format "*SQL: %s*" bufname))
(buf (get-buffer sql-bufname))
(product (intern (cdr (assoc :product _params))))
;;; Add connection parameter to src-mode SRC blocks
(connection (intern (cdr (assoc :connection _params))))
)
;;; currently we call sql-product-interactive with only the product and buffname
(sql-product-interactive product bufname)
;;; It would be nice to use connection if it's provided and available in sql-connection-alist
(sql-connect connection bufname)
Including folks from #3: /cc @conornash @indigoviolet @stardiviner @nikclayton
Hi there!
Is this still an issue? Reading the code, it seems to me that the change is intended to plug-in to the :session header for src blocks. Have you experimented with this, at all? (I haven't, yet.)
TIA
just tried right now and it works: just put your sql-connection-alist's entry name in :session and it will take parameters from there.
This was my intention, as we wanted to have multiple connections defined and only change the :session.
3 is closed, and #4 is merged, but I'm still unsure how to configure an
sql-mode
src-block to use a particular sql-connection.