Did I tell you about Sequel Pro?

You can use it to connect to your local MAMP and also to remote LAMP mysql servers (via SSH). Why is this so awesome?

Well, not only is it 100 times faster than that phpMyAdmin, but you can edit your DB super easily, like a spreadsheet. It is a snap to filter/search/order a table for viewing and editing.

Caveat emptor: what I am about to show you can do tremendous damage. You can accidentally kill your entire application, so BACK YOUR DATABASES UP! Test on a copy first.

You can do simple things like turn 1′s to 0′s and quickly disable a drupal module faster than drush can (but watch out if you don’t know your dependencies).

Edit your system table in Sequel Pro

Edit your system table in Sequel Pro

I had this interesting and daunting problem:
I am working on this site for a soccer league that has a couple hundred teams and I realize that I need to modify a whole slew of node titles based on values that appear in their CCK fields.
Many of the Organic Group Group nodes (each team is a group)
Views Bulk Operations gets me part, but not all the way quickly enough for this one-time operation.

I’m not crafty enough to write a join and update statement across all these tables, but I do already have a view listing Teams and CCK fields for Division and Type.

Hey, if I scroll down to the bottom of the view, I can copy the query right from views into Sequel Pro!

Holy Moly. It just works. As it should.

Edit the result of a sequel statement created with views

Edit the result of a sequel statement created with views

Now I can just go down the list and edit my node titles.
Sweet.

Because there was a pattern here, I ended up usingĀ  the fabulous auto nodetitle module and tokens. I temporarliy added a pattern to the node titles of my team content type and used views bulk operations to update some of my node titles. After the update, i set the pattern to be used only if the title was blank.

Even though I solved my use case another way, I can see plenty of use for this technique in the future. Great way to fix typos in content, for example.

Add to Yahoo Add to Google Save to Del.icio.us Digg IT! Live Bookmarks!

One Response to “Sequel Pro: look at the nerdy things I can do at 1 AM”  

  1. 1 Sathya

    Thank you so much for this useful information actually. Hereafter we will do how to take back up in this method.


ABOUT

This is the blog of Andrew Mallis, a Toronto-born, San Francisco-based polymedia artist. I work in new(er) media with code, photography and electronics, and in traditional media by writing, drawing & painting.

Categories