tags:

views:

36

answers:

1

When using Emacs to create a SQL query in SQL-mode, the SQLi buffer is the typical, ugly console window of the command-line tool for the target database. Most of the output is the same with ASCII characters trying to build a visual representation of a table.

Has anyone created a minor mode to make the output more readable? Here are some features that could be useful:

  1. Create a Header. I'm not sure how this could be done, but it would be very cool if there was a way to visually show the user which columns go with the data. If I'm looking at line 300 of an output, it's a bit challenging to count the columns and read the SQL that was used. Maybe it would be something like a hacked up mode-line that doesn't change when scrolling vertically, but does when scrolling horizontally.
  2. Only Show the Last Result. When I run a new query, that's all I want to see in the SQLi window. It'd be nice to have a feature to jump through the history of results from previous SQL queries.
  3. Faces. Create different colors for grid lines and data. Maybe even different colors for different data types (maybe this is too hard)

I think these features would make Emacs more palatable for database developers. There are a ton of packages that do these these same tasks and others well, but they aren't nearly as powerful as Emacs. Also, it's quite annoying to switch editors just to write my SQL queries.

EDIT: Something like hexl-mode would be very cool.

+2  A: 

All the SQL mode related wisdom of the Emacs community is probably gathered here. Sadly there is nothing like the mode you wish for - I've been wishing for something like that for quite some time and that's the reason I use sql-mode only for simple queries - the results for anything big is totally unreadable. Hopefully the situation will change in the future...

Bozhidar Batsov