Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for querying Global Secondary Indexes which have no range… #36

Merged
merged 4 commits into from
Nov 9, 2015

Conversation

glidester
Copy link
Contributor

Could not see a way of querying global secondary indexes so I have created a new method queryOnGlobalSecondaryIndex that allows you to specify the index name, attribute name and an optional range condition.

As an aside can I ask how you run the integration tests from sbt? I can't seem to figure it out.

Thanks

@glidester
Copy link
Contributor Author

Ok, I've worked out the command to run the it test now:

awsWrapTest/it:test

@nefilim
Copy link

nefilim commented Oct 21, 2015

Thanks for this, just ran into the same missing functionality, hope this gets merged soon!

@dwhjames
Copy link
Owner

dwhjames commented Nov 8, 2015

@glidester, thanks a lot for your pull request. I’m sorry that it’s taken so long for me to get back to you.

I just set your a PR to add to this one: glidester#1


val keyConditions: Seq[(String, Condition)] =
Seq((hashAttributeName, QueryCondition.equalTo(hashValue))) ++
rangeCondition.map( Seq(_) ).getOrElse(Seq.empty[(String, Condition)])
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this might be more neatly done as something like:

val keyConditions = {
  val b = Map.newBuilder[String, Condition]
  b += (hashAttributeName -> QueryCondition.equalTo(hashValue))
  rangeCondition.foreach(b += _)
  b.result()
}

@dwhjames
Copy link
Owner

dwhjames commented Nov 8, 2015

@glidester, You’ve added the right stuff to QueryMagnet, but for completeness, support should also be added to QueryOnceMagnet.

add integration test for DyDB global secondary index
…daryIndex functionality to QueryOnceMagnet trait.
@glidester
Copy link
Contributor Author

Hi @dwhjames, thanks for the feed back.

I've made the change that you suggested and added QueryOnceMagnet support. Please take a look and let me know if its ok.

Thanks

@dwhjames
Copy link
Owner

dwhjames commented Nov 9, 2015

👍

FYI, I’m going to merge this and release as 0.7.3, and then merge the AWS SDK upgrade and then release again as 0.8.0, just so that this is available for both 1.9.x and 1.10.x SDK versions.

dwhjames added a commit that referenced this pull request Nov 9, 2015
Add support for querying Global Secondary Indexes which have no range…
@dwhjames dwhjames merged commit 1080b86 into dwhjames:master Nov 9, 2015
@dwhjames
Copy link
Owner

dwhjames commented Nov 9, 2015

released in v0.7.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants