delete_all, destroy_all

9 views
Skip to first unread message

joshmckin

unread,
Aug 12, 2010, 12:53:47 PM8/12/10
to SimpleRecord
Before I create a ticket, does anyone else have issues with these
methods?

If get the following errors:

delete_all:
ruby-1.9.1-p378 > PayAccount.delete_all
##### Aws::SdbInterface returned an error: 400 Bad Request
<?xml version="1.0"?>
<Response><Errors><Error><Code>InvalidQueryExpression</
Code><Message>The specified query expression syntax is not valid.</
Message><BoxUsage>0.0000137200</BoxUsage></Error></
Errors><RequestID>04509e87-dbc8-62e3-f806-e4a567ca30e8</RequestID></
Response> #####
##### Aws::SdbInterface request: sdb.amazonaws.com:443/?
AWSAccessKeyId=********removed by
me**********&Action=Select&SelectExpression=SELECT%20%2A%20FROM
%20%60test_pay_accounts%60%20WHERE
%20%28%29&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2010-08-12T16%3A47%3A20.000Z&Version=2009-04-15&Signature=VCkRWdo9easC
%2BArSfuQKT1XFRUh4dRZMK0w851ylrV0%3D ####
Aws::AwsError: InvalidQueryExpression: The specified query expression
syntax is not valid.
REQUEST=sdb.amazonaws.com:443/?AWSAccessKeyId=*******removed by
me**********&Action=Select&SelectExpression=SELECT%20%2A%20FROM
%20%60test_pay_accounts%60%20WHERE
%20%28%29&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2010-08-12T16%3A47%3A20.000Z&Version=2009-04-15&Signature=VCkRWdo9easC
%2BArSfuQKT1XFRUh4dRZMK0w851ylrV0%3D


destroy_all:
ruby-1.9.1-p378 > PayAccount.destroy_all
Rightscale::HttpConnection : server sdb.amazonaws.com closed
connection
Opening new HTTPS connection to sdb.amazonaws.com:443
##### Aws::SdbInterface returned an error: 400 Bad Request
<?xml version="1.0"?>
<Response><Errors><Error><Code>InvalidQueryExpression</
Code><Message>The specified query expression syntax is not valid.</
Message><BoxUsage>0.0000137200</BoxUsage></Error></
Errors><RequestID>e3314b6e-7f25-8284-7962-6dfe96bb47f3</RequestID></
Response> #####
##### Aws::SdbInterface request: sdb.amazonaws.com:443/?
AWSAccessKeyId=*******removed by
me***********&Action=Select&SelectExpression=SELECT%20%2A%20FROM
%20%60test_pay_accounts%60%20WHERE
%20%28%29&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2010-08-12T16%3A51%3A23.000Z&Version=2009-04-15&Signature=
%2Bm26aH78%2Fw4n7TFDnmZzYw1TlDwrYqZlssm1uVxJwLw%3D ####
Aws::AwsError: InvalidQueryExpression: The specified query expression
syntax is not valid.
REQUEST=sdb.amazonaws.com:443/?AWSAccessKeyId=*******removed by
me**********&Action=Select&SelectExpression=SELECT%20%2A%20FROM
%20%60test_pay_accounts%60%20WHERE
%20%28%29&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2010-08-12T16%3A51%3A23.000Z&Version=2009-04-15&Signature=
%2Bm26aH78%2Fw4n7TFDnmZzYw1TlDwrYqZlssm1uVxJwLw%3D

Travis Reeder

unread,
Aug 12, 2010, 3:13:48 PM8/12/10
to simple...@googlegroups.com
I don't think those methods exist in SimpleRecord, funny they even try to work. SimpleDB doesn't have any functions to do mass deletes (or updates) like that. 

Travis


--
You received this message because you are subscribed to the Google Groups "SimpleRecord" group.
To post to this group, send email to simple...@googlegroups.com.
To unsubscribe from this group, send email to simple-recor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/simple-record?hl=en.


Gabriel

unread,
Aug 12, 2010, 3:22:09 PM8/12/10
to SimpleRecord
Yeah, I was just about to ask about that. Are those underlying sdb
methods? You can do mass updates using the batch save functionality
though. I use that all the time and it works great.

Gabriel
> > simple-recor...@googlegroups.com<simple-record%2Bunsubscribe@goog legroups.com>
> > .

joshmckin

unread,
Aug 12, 2010, 3:39:23 PM8/12/10
to SimpleRecord
That's weird I see them here: http://github.com/appoxy/simple_record/blob/master/lib/simple_record.rb
lines 614 and 625.

On Aug 12, 2:13 pm, Travis Reeder <tree...@gmail.com> wrote:
> I don't think those methods exist in SimpleRecord, funny they even try to
> work. SimpleDB doesn't have any functions to do mass deletes (or updates)
> like that.
>
> Travis
>
> > simple-recor...@googlegroups.com<simple-record%2Bunsu...@googlegroups.com>
> > .

Travis Reeder

unread,
Aug 12, 2010, 3:54:35 PM8/12/10
to simple...@googlegroups.com
Oh, heh, don't even know what I've got in there. ;)

Strange that the query is adding a WHERE with no parameters, guess this needs a test case. I'm gonna guess at first glance that that we need to splat the params on the find, ie:

obs = self.find(params)

to:

obs = self.find(*params)

If you want to give that a try.

To unsubscribe from this group, send email to simple-recor...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages