Hen*Plus
I thhought I would just mention the best command line SQL tool in the world ever! (a little in-joke for those children of the 90's). Seriously though it is just the best, it has readline support to allow for simple change of the previous command (unlike it's closest competition sqltool.
(it also has an ebuild, just emerge it!)