Query Tool for Amazon SimpleDB

Although these projects are never really finished, I can say I’ve completed version 1 of the Amazon SimpleDB Query Tool. This is built on top of a new SimpleDB API that will be part of an upcoming typica release. The code currently resides in a branch, but will hopefully get merges into trunk in the next few weeks.

OK, more about the tool. It was built to provide a convenient way to test queries. That’s it. Towards that end, there is a list of features I included that really met a need for me.

  • flexible query workspace (scratch pad)
  • run query on the line where the cursor is
  • allow domain selection via the UI
  • display domain metadata
  • show results from several queries at once
  • show box usage and other stats

Now, the moment you’ve all been waiting for, a screenshot!


Right now, the code is still in SVN, so if you’d like to run it, you’ll need to check out the branch and build it.  If you get that far, to run it, you can use this command, “ant test.main -Dclass=QueryTool -Dargs=”<access id> <secret key>”

For an official release, I’ll make an executable jar, so you’d run “java -jar QueryTool.jar <access id> <secret key>”

22 thoughts on “Query Tool for Amazon SimpleDB

  1. This is great. Probably the best free SimpleDB query tool currently. Thanks. My only feature request at this time would be to be able to copy individual cells to the clipboard. Thanks for a great tool.

    1. It looks like the support a much older version of the SImpleDB API (2007-11-07), which I think means no Select support. Certainly you could take the query tool source code and modify it to work with something like M/DB without too much trouble.

    1. In that case, does typica work with it? Can you just plug in a different endpoint host name? if I added some better command line arg parsing, it would be pretty trivial to support a host name.

  2. I’ve not tried typica. However you are correct – the only difference is a different endpoint host name, typically of the form http://xxxx/mdb/request.mgwsi. Otherwise the behaviour is identical to SimpleDB. Build 26 provides full SignatureVersion=2 support with SignatureMethod=HmacSHA1 or HmacSHA256. M/DB uses the REST interface, not the SOAP/WSDL interface, but I would guess you’d be using the REST interface anyway.

  3. Very cool, I found this to be one of the nicer ways to access simpledb.

    Would be nice if it included wrappers around some of the other calls, letting you ‘drop’ and ‘create’ domains as well as rows themselves. Then it would be perfect. :)

    1. Thanks! I was trying to avoid going down the slippery slope of supporting put operations. I think domain create/delete make sense (though, create is a bit of a “put”).

      1. So I pulled from the branch and after figuring out it was pointing to the wrong simple db service (at least for my testing) I got it up and running off of built code. But it looks like there are still some other issues as I’m not getting results back.

        I’m going to keep digging a bit, but is the branch in a known ‘unstable’ state. Are you interested in receiving patches for create/drop/delete functionality?

  4. Hi again,

    Figured out what my problem was, queries fail on the first go unless you set the domain via the drop down. I’ve fixed that along with a few other issues (better error reporting) and changed the input layout a bit. It now has a single text field for the query with up/down history support and then a scrollable log/history above it. This makes communication of errors / status messages a bit more natural IMO.

    I’d be happy to submit it back, just drop me an email and I’ll get it to you.


    1. Hi Nic,
      Yes, e-mail me the patches and I’ll integrate them. I’m about to check-in the new/delete domain features. I’ll wait a bit before pushing a release out (for your changes). you can find my e-mail via the typica home page.


      1. I couldn’t find a reference to your email on the typica page, but took a guess. If you didn’t receive it, echo me back at nicpottier at the gmail.


  5. Cool tool. I got some basic stuff working. However, I’m trying to use it with some domains autocreated by SimpleJPA and they have the name format “MyDB-Users”;

    i’ve tried

    select * from MyDB-Users
    select * from `MyDB-Users`

    and single/double quotes. None of them work. I’m guessing the dash is the problem (which is automatically inserted by simplejpa) but the backtick should still work. I’m guessing this isn’t built it. Or maybe this is just a serious case of user error.

  6. Funny how after you post, you find the solution to your problem.

    So it was user error partially.

    Backticks are required around the domain name.

    The reason why my queries weren’t executing was because I had them ending in a semi-colon (habit from years of demarcating sql this way). The ending semi-colon caused it not to run correctly.

  7. Where would I get the source code for querytool and what would i have to change to make it use us-west-1 instead of us-east? How do I recompile it?

    1. The source is in svn. Look at code.google.com/p/typica and grab the source. It’s in the test directory. There’s an ant target in the build.xml which builds the jar file for the tool.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s