And the debate rages on.
I basically agree with Jared, at least as far as the broken UX of sql-mode goes. If you say it’s broken, it’s broken.
What I don’t understand is this: Here we have a coder, willing to investigate solutions to his problems. Reads documentation. Presumably Googles. Finds something that appears to be what he wants. Tries it, and gets one error message. Gives up and writes his own.
I like to think I’m well acquainted with human laziness, but this is a species I just don’t understand. But that’s somewhat off point now.
So. We can agree that:
Given this situation, I think it’s insane to say that the correct solution is to document how to work around the bad UX. So, I’ve put my money where my mouth is and patched sql-mode to improve it’s behavior. So with this patch, SQL-mode:
sql-change-buffer function, which can set or change the sql-interactive buffer the sql-mode buffer will send commands to. The command has a default keybinding, and auto-completes buffer names. It only completes names of live interactive SQL buffers.sql-send-* commands, and sql-buffer isn’t pointing to a live SQLi buffer, you get an error which points you to sql-change-buffer.Here’s the patch: sql-change-buffer, against Emacs’ CVS HEAD. It’s still a bit rough around the edges. In particular, I’m not thrilled with how sql-buffer is indicated in the mode-line. Contributions are welcomed.
Discussion