EmacSQL is a very impressive piece of software. It allows Emacs to talk to all of sqlite, mysql and postgres!