Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

Struct args in Spanner queries #787

Closed
ChengyuanZhao opened this issue Jun 25, 2018 · 4 comments · Fixed by #826
Closed

Struct args in Spanner queries #787

ChengyuanZhao opened this issue Jun 25, 2018 · 4 comments · Fixed by #826
Assignees
Labels
Milestone

Comments

@ChengyuanZhao
Copy link
Contributor

This will be available soon in spanner client lib. See for more detail: googleapis/google-cloud-java#3287

Perhaps wait for GA spanner client lib to add this functionality?

@ChengyuanZhao ChengyuanZhao added spanner awaiting waiting for something external labels Jun 25, 2018
@artembilan
Copy link
Contributor

We can add it even before to play and provide some feedback if that.

Only the problem that we can't release our GA without their GA.

@jabubake
Copy link
Contributor

@meltsufin meltsufin removed the awaiting waiting for something external label Jun 26, 2018
@meltsufin meltsufin added this to the 1.1.0.M1 milestone Jun 26, 2018
@ChengyuanZhao ChengyuanZhao self-assigned this Jun 26, 2018
@ChengyuanZhao
Copy link
Contributor Author

@jabubake

How do people usually use the @Param tags with Struct and array types? For Spring Data query methods I think people use these tags on the right hand side of where-statements. like ... where colA = @valA and colB + colC < @val2 .

Users can't put arrays or Structs on the right sides of those where-statements, correct? If that's the case, then I'm not sure how this new struct-arg feature would fit in to spring data spanner..

@meltsufin FYI

@ChengyuanZhao
Copy link
Contributor Author

https://cloud.google.com/spanner/docs/data-types

Looks like STRUCTs can be used in WHERE clauses with some caveats, so I think this is worth implementing support in our @Query annotated query methods.

The user can provide:

  • a Struct typed arg, which would be directly bound to the tag like any other tag and param currently supported.
  • a POJO, which we will use the same logic as our write-conversion for making mutations to construct a Struct to then bind to the tag.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging a pull request may close this issue.

4 participants