Sequel Pro Bundles: Copy As HTML, Copy As Wiki Table, Copy as CSV

Posted by & filed under , , .

Sequel Pro for Mac OS XSome of you might know that I’ve moved to Mac recently (no comment!) — as such I had to ditch the HeidiSQL client for MySQL (booo! why does it only run on Windows????) and had to figure out another handy MySQL client which works on Mac OS X. You can of course use the MySQL Workbench but I found it clunky and not that helpful to be honest. So digging around I found this open source (hence free) client called Sequel Pro: http://www.sequelpro.com . I have to admit it doesn’t yet rival with HeidiSQL but like all the open-source projects, they had to start somewhere so a bit of patience is required.

One of the good things I found about it, is it offers a plugin framework (bundles) which allows you to write your own bundles — and even better, these can be written in Bash script, or, any other scripting language you can shebang from bash. Now that I found to be cool because I don’t want to learn a new scripting/programming language for each product which allows me to write my own plugins.

In Cognitive Match we use Redmine internally as our task tracking system, and when dealing with production investigation, I found myself quite often having to copy and paste rows of data from MySQL into Redmine — either so data can be investigated/approved by colleagues, or simply as an effective way of “saving to stack” row ID’s, campaign settings etc. (saves me running the same SELECT over and over again every time I need to check a campaign flag for instance). Redmine supports wiki text — and this is where HeidiSQL came in handy as you could select a few rows of data and it allowed you to copy that to clipboard as wiki text/table so you could then just paste it into Redmine and have the data formatted and therefore easy to read. Unfortunately Sequel Pro doesn’t support that, however, as I said, it offers the possibility of writing your own “bundle” (effectively a plugin).

I’m not the best bash‘er in the world, but since Sequel Pro came already with a bundle which allows you to copy rows as JSON (“Copy as JSON” from the Bundles -> Copy menu), I thought I’d adapt that to allow me to copy text to clipboard as wiki as well. And before I knew it, I ended up with these 3 bundles: one which copies tows to clipboard as wiki (in the same format as HeidiSQL does), one which copies the rows as HTML table and one which copies the rows as CSV. As I said before, all of these are straight copies of the HeidiSQL functionality — so if you’ve been a HeidiSQL user in the past, you might appreciate these.

Below you will find the links to the 3 bundles — as I understand talking to the Sequel Pro developers, you just need to bunzip/untar these folders and then simply double-click on the folder itself and Sequel Pro will install the bundle locally for you. However, if this doesn’t work, have a read of the Sequel Pro Bundles framework here : http://www.sequelpro.com/bundles/reference/ as it explains how bundles are used by the framework.

  • Copy As Wiki: CopyAsWiki.tar.bz2 — copies row data to clipboard in wiki table format
  • Copy As HTML: CopyAsHTML.tar.bz2 — copies row data to clipboard in HTML table format
  • Copy as CSV: CopyAsCSV.tar.bz2 — copies row data to clipboard in the same CSV format that HeidiSQL does

Now, as I said, the above bundles are adaptation of the original “Copy as JSON” bundle that ships with Sequel Pro — my bash and perl are not the best so if you find any problems with these I would appreciate if you notify me and/or the Sequel Pro developers (I’ve sent an email to them already and hoping to get these into a future release). To get in touch with me, add a comment to this post with your email (don’t worry, it doesn’t get published so you won’t get spammed) or find more ways of getting in touch with me on my about.me page (e.g. Tweet me, contact me on LinkedIn etc).

Hope these bundles help a few others and not just me 🙂

Update as of Monday, 3rd of September 2012:

I have just received this email from Matt (see below) which suggests that my patches have been integrated into the main code for Sequel Pro, so expect any releases after this date to include these:

Hi Liviu,

I’m sorry it took almost a year to get this integrated!

We hadn’t really thought how we wanted to accept contributions until now. I have restructured the way we do bundles a little, so please take a look at that if you want to make any changes to your bundle. (https://github.com/sequelpro/Bundles).

In the meantime I have merged your 3 new bundles in here: https://github.com/sequelpro/Bundles/tree/master/contributed .

Thanks again for submitting these.

Matt

In fact, if you download a newer version with these integrated in, I would really appreciate it if you drop me a line about it!

5 Responses to “Sequel Pro Bundles: Copy As HTML, Copy As Wiki Table, Copy as CSV”

  1. Ella

    Thanks.. exactly what I needed!

  2. liviu.tudor

    Wow! First comment on these plugins — encouraging! Thank you!

  3. Liv

    Update on this: I have finally managed to get myself onto github.com and sent a pull requests to the Sequel Pro guys to include these bundles in their repository. If that proves successful soon enough you should be able to get these 3 bundles from : https://github.com/sequelpro/Bundles
    I will of course keep this page up, but the latest bundles code from there on will always be on github.

  4. Liviu Tudor

    By the way, just to make things clear (since I’ve been asked this by a few users): the “Copy as wiki table” DOES work with JIRA too!

    Would be in fact curious to find out what other systems it works with (apart from Redmine, wikimedia and JIRA) — so drop me a line if you find more.

  5. Chandra