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 query-expr clause to handle duplicate table keys #22983

Closed

Conversation

lasinicl
Copy link
Contributor

Purpose

$title

Fixes #22641

Approach

Add on conflict clause to query expression.

Samples

            from var person in personList
            select {
                   firstName: person.firstName,
                   lastName: person.lastName,
                   age: person.age
            }
            on conflict error("PersonNotFound");

Check List

  • Read the Contributing Guide
  • Updated Change Log
  • Checked Tooling Support (#)
  • Added necessary tests
    • Unit Tests
    • Spec Conformance Tests
    • Integration Tests
    • Ballerina By Example Tests
  • Increased Test Coverage
  • Added necessary documentation
    • API documentation
    • Module documentation in Module.md files
    • Ballerina By Examples

@codecov-io
Copy link

codecov-io commented Apr 30, 2020

Codecov Report

Merging #22983 into new-table-impl will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@               Coverage Diff               @@
##           new-table-impl   #22983   +/-   ##
===============================================
  Coverage           14.59%   14.59%           
===============================================
  Files                  51       51           
  Lines                1411     1411           
  Branches              219      219           
===============================================
  Hits                  206      206           
  Misses               1189     1189           
  Partials               16       16           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aebf529...154f09c. Read the comment docs.

@lasinicl lasinicl requested a review from mohanvive April 30, 2020 08:23
@CLAassistant
Copy link

CLAassistant commented May 3, 2020

CLA assistant check
All committers have signed the CLA.


Person[] outputPersonList =
from var person in personList
on printHello()
Copy link
Contributor

Choose a reason for hiding this comment

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

Better to use a proper example. This shouldn't be allowed and type checker should only allow following [1];

join-on-condition := "on" expression "equals" expression

[1] ballerina-platform/ballerina-spec#435

lastName: person.lastName,
age: person.age
}
on conflict printHello();
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as previous; better to use a proper example.

@grainier
Copy link
Contributor

grainier commented May 4, 2020

merged in : grainier#29

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.

5 participants