SimpleDB Binding for Scala

Sample Code & Libraries>Amazon SimpleDB>SimpleDB Binding for Scala
Community Contributed Software

  • Amazon Web Services provides links to these packages as a convenience for our customers, but software not authored by an "@AWS" account has not been reviewed or screened by AWS.
  • Please review this software to ensure it meets your needs before using it.

A lightweight and easy to use interface to Amazon's SimpleDB web service, written in Scala.

Details

Submitted By: Robin Barooah
AWS Products Used: Amazon SimpleDB
License: Apache License 2.0
Source Control Access: git://github.com/rbarooah/simpledb-scala-binding.git
Created On: December 22, 2008 1:47 AM GMT
Last Updated: January 2, 2009 8:03 PM GMT
Download

Sublime SimpleDB

SimpleDB binding for Scala

A lightweight and easy to use interface to Amazon’s SimpleDB web service, designed to complement Scala’s expressiveness.

Discussion Here: Google Group

Bug tracking here: Lighthouse Bug Tracker

Documentation Here: ScalaDocs (Hint: All of the stuff you need is in the SimpleAPI trait…)

How to use

Either clone the repository and then mvn install, or: download the prebuilt jar

If you build with maven, the dependencies will be installed automatically otherwise you’ll need commons-codec and apache-httpclient on your classpath.

Some examples

Import the API Classes:

import org.sublime.amazon.simpleDB.api._

Create an account object representing your Amazon AWS account.:

val account = new SimpleDBAccount( <keyId>, <key> )

Import the symbols from the account for convenience:

import account._

Create a domain called ‘test’:

domain ("test") create

Add an attribute called “role” with a value “author” to the item named robin>

domain ("test") item ("robin") += ("role" -> "author")

Add an attribute called “role” with a value “reviewer” to the item named landon>

domain ("test") item ("landon") += ("role" -> "reviewer")

Print the names of the items in the ‘test’ domain who’s role is ‘reviewer’:

select ("select * from test where role='reviewer'") foreach ( e => println(e.name))

Set the ‘score’ attribute of every ‘reviewer’ to ‘2’:

select ("select * from test where role='reviewer'") foreach ( e => domain ("test") item (e) set ("score" -> "2"))

Documentation Here: ScalaDocs (Hint: All of the stuff you need is in the SimpleAPI trait…)

Discussion Here: Google Group

©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.