开发者

Querying Amazon's Simple DB using boto

开发者 https://www.devze.com 2023-01-31 09:07 出处:网络
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 iterat

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 "&开发者_StackOverflow中文版lt;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.

0

精彩评论

暂无评论...
验证码 换一张
取 消