سؤال

I must be doing something really wrong, but I can't find anything on this issue with google. I'm using boto to access SDB on Amazon web services. I can create a new table, add items, and even iterate over all the items in the table, but I can't figure out how to query them. The "select" method is there, but "query" isn't. According to the documentation here: http://boto.s3.amazonaws.com/ref/sdb.html#module-boto.sdb.domain. It's possible to use a pythonic method to query your SDB, however this method doesn't exist for me!

Here is a small snippet of code which might help describe my problem:

>>>domain = conn.get_domain('testtable')
>>> domain.select()
<boto.sdb.queryresultset.SelectResultSet object at 0xb71bb2ac>
>>> domain.query()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: Domain instance has no attribute 'query'

Has this method been removed for some reason? I'm no expert in crafting queries, pointing me to additional documentation regarding using the select method would be great!

هل كانت مفيدة؟

المحلول

The "query" interface was the original search interface for SimpleDB. It was set-based, non-standard and quite lovely, I thought. However, over time AWS introduced a SQL-like query language (accessed via the Select request) and then deprecated and eventually removed the original query interface.

So, the reason it doesn't work in boto is because it is no longer supported by SimpleDB. For more up-to-date boto documentation, look here.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top