Enhanced 'sdb.class.php' 'select()' 'limit' behaviour and associative array output as an alternative. #35

Closed
wants to merge 3 commits into
from

Conversation

Projects
None yet
3 participants

jamesfu commented Aug 4, 2012

Hey there,

I made a change allowing users to send MySQL-style limit clause (limit ) in addition to 'limit '.

An earlier commit gives users the option to receive results as associative array by supplying 'Output'=>'array' to $opt.

I hope someone will find these useful!

Cheers,
James

jamesfu added some commits Aug 2, 2012

Update services/sdb.class.php
Updated select() method to accept 'Output'=>'array' in $opt array.

This prompts result to be returned as an associative array with itemName() as its key.
Multi-valued attributes are returned as a nested array.
Update services/sdb.class.php
Enhanced $select_expression to accept 'limit <offset> <limit>' on top of 'limit <limit>'.

If <offset> is 0, $select_expression is rewritten as 'limit <limit>'.

If <offset> is non-zero, 'select count(*)' query is performed to obtain 'NextToken' for use in actual query.

jamesfu commented on 4a40a35 Aug 4, 2012

Removed $opt['Output'] from count query to retain CFResponse.

This allows limit offsetting to be used concurrently with associative array response.

Contributor

jeremeamia commented Aug 7, 2012

These are definitely good features, but we unfortunately cannot accept this pull request due to logistical reasons. It might make more sense for this functionality to exist in a higher tier, like in a different class that uses the SimpleDB client (we would probably be able to accept something like that as an extension). I will leave this pull request open though for exposure in case anyone else would like to modify their SDK to do this or use your fork.

jeskew commented Mar 2, 2016

Closing, as we're only iterating on the versions 2 & 3 of the AWS SDK for PHP.

Please feel free to maintain a fork with whatever modifications you would like to make.

@jeskew jeskew closed this Mar 2, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment