sql-buffer-live-p
sql-buffer-live-p is a compiled Lisp function in `sql.el
'.
(sql-buffer-live-p BUFFER &optional PRODUCT CONNECTION)
Return non-nil if the process associated with buffer is live.
BUFFER can be a buffer object or a buffer name. The buffer must
be a live buffer, have a running process attached to it, be in
`sql-interactive-mode', and, if PRODUCT or CONNECTION are
specified, it's `sql-product' or `sql-connection' must match.