chaisql / chai

Modern embedded SQL database
MIT License
1.56k stars 95 forks source link

Add coalesce function #513

Closed yaziine closed 1 year ago

yaziine commented 1 year ago

This PR fixes #509 by adding support to COALESCE method. Unlike PosgreSQL, our implementation doesn't fail if the arguments aren't of the same type. However, an error is returned if there is no argument at all.

codecov[bot] commented 1 year ago

Codecov Report

Attention: 11 lines in your changes are missing coverage. Please review.

Comparison is base (6dc2964) 78.94% compared to head (31c0128) 78.87%. Report is 1 commits behind head on main.

:exclamation: Current head 31c0128 differs from pull request most recent head e065575. Consider uploading reports for the commit e065575 to get more accurate results

Files Patch % Lines
internal/expr/functions/builtins.go 53.33% 6 Missing and 1 partial :warning:
internal/expr/functions/definition.go 33.33% 1 Missing and 1 partial :warning:
internal/sql/parser/parser.go 0.00% 1 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #513 +/- ## ========================================== - Coverage 78.94% 78.87% -0.07% ========================================== Files 126 126 Lines 10890 10907 +17 ========================================== + Hits 8597 8603 +6 - Misses 1571 1579 +8 - Partials 722 725 +3 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.