Add support to N1QLExpression for UPDATE statements

Open
#1,065 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
java
Domain
databases

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.

Description

status: waiting-for-triage

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());
    }
Dominant language
Java
Stars
284
Forks
197
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from spring-projects/spring-data-couchbase

All issues in spring-projects/spring-data-couchbase

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.