go-jet / jet

Type safe SQL builder with code generation and automatic query result data mapping
Apache License 2.0
2.23k stars 110 forks source link

Export BinaryOperator function #339

Closed kblomster closed 3 months ago

kblomster commented 3 months ago

This PR exports a BinaryOperator function that is similar in spirit to jet.Func, but for custom/unsupported operators rather than for functions. See https://github.com/go-jet/jet/issues/338

This is kind of a proof-of-concept PR; maybe this should have tests? It should probably have docs as well.

Maybe there should also be a UnaryOperator and a TernaryOperator but at least from my perspective I don't foresee a huge need for those.

codecov-commenter commented 3 months ago

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 90.39%. Comparing base (1fd423b) to head (1d31062).

Files Patch % Lines
internal/jet/operators.go 0.00% 2 Missing :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #339 +/- ## ========================================== - Coverage 90.42% 90.39% -0.03% ========================================== Files 125 125 Lines 7434 7436 +2 ========================================== Hits 6722 6722 - Misses 552 554 +2 Partials 160 160 ```

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

go-jet commented 3 months ago

LGTM. :+1: