spring-projects / spring-projects/spring-data-couchbase
Add support to N1QLExpression for UPDATE statements
Open
Nobody has claimed this yet.
status: waiting-for-triage
- Dominant language
- Java
- Stars
- 284
- Forks
- 197
- PR merge metrics
- No merged PRs in 30d
Description
Background:
We use N1QLExpression in our custom base repository
Solution: (from our workaround)
public N1QLExpression update(String bucketName) {
N1QLExpression bucket = escapedBucket(bucketName);
return prefix("UPDATE", bucket.toString());
}
public N1QLExpression set(N1QLExpression... expressions) {
// all the expressions just need to be separated by commas...
StringBuilder builder = new StringBuilder();
for (int i = 0; i < expressions.length; i++) {
builder.append(expressions[i].toString());
if (expressions.length - 1 > i) {
builder.append(", ");
}
}
return infix("SET", toString(), builder.toString());
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the N1QLExpression entry point and inspect how its existing expression-building methods compose clauses. Use the UPDATE and SET workaround in the issue as the behavioral reference, then verify that the resulting expressions generate the expected N1QL statements.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100