views:

36

answers:

1

I am considering the following a "complex" query, given the fact that simpledb is a really simple data storage: I am trying to query a aws-sdb domain with an OR query. using ruby, rails (2) and ActiveResource. I am using the code examples from http://developer.amazonwebservices.com/connect/entry.jspa?externalID=1242 (which don't show Or queries by the way)

class Team < ActiveResource::Base
  self.site   = "http://localhost:8888" # Proxy host + port
  self.prefix = "/foo_dev/"       # SDB domain
end

select code (not working):

Team.find(:all, :from => :query, :params => "['player1' = 100001160313805 or 'player2' = 100001160313806]")

select code (working, but no OR):

Team.find(:all, :from => :query, :params => "['player1' = 100001160313805]")

i am very thankful for any insights, since i am struggling with this for a few hours now. thanks a lot in advance for all comments.

A: 

Try SimpleRecord at http://github.com/appoxy/simple_record to use SimpleDB as the database. You're queries should work with a little tweaking like swapping the quotes around, eg:

Team.find(:all, :conditions => "[player1 = '100001160313805']")

Travis R