From b81d7c16a90e7e0b4bc5aad2c69042323a45b5fa Mon Sep 17 00:00:00 2001 From: Stephen Afam-Osemene Date: Wed, 15 Nov 2023 17:31:30 +0000 Subject: [PATCH] Add generic operator method to Chain --- expr/chain.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/expr/chain.go b/expr/chain.go index 1bd0f385..df1109fb 100644 --- a/expr/chain.go +++ b/expr/chain.go @@ -35,6 +35,11 @@ func (x Chain[T, B]) IsNotNull() T { return X[T, B](Join{Exprs: []bob.Expression{x.Base, isNotNull}}) } +// Generic Operator +func (x Chain[T, B]) OP(op string, target bob.Expression) T { + return X[T, B](leftRight{left: x.Base, right: target, operator: op}) +} + // Equal func (x Chain[T, B]) EQ(target bob.Expression) T { return X[T, B](leftRight{left: x.Base, right: target, operator: "="})