Weekend Project: Worksheets
Last week, I had need to run some queries against the internal database at work. These weren’t reports that needed to be run forever more, but I wanted to keep a record of them - both the queries and the results. I ended up writing my queries into a text file, evaluating them using Emacs’ SQL mode, and pasting the results back into the file. This worked quite well, but I thought I could do better.
I’ve been wondering about worksheet-style interface, as found in, for example, the Sage open source maths system. SQL, at least if you’re running SELECT queries, is ideal for this, as each query is independent, so you don’t have to manage things like ordering and mutation. Hence, last weekend, I knocked up a rough draft of what such an interface might look like. I’ve tidied it up a little, and an posted it here. There’s still plenty to add (support for other databases, UI improvements, some semblance of security), but the basic functionality is there, and it should serve as a basis for further experiments.