op

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 29, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

The op package contains operation and aggregation nodes that can be added to a Builder.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Abs

func Abs(n ...interface{}) *OperationNode

func Add

func Add(args ...interface{}) *OperationNode

func All

func All() *OperationNode

All is a placeholder for when you need to return something that represents selecting everything

func And

func And(args ...interface{}) *OperationNode

func Avg

func Avg(n Node) *OperationNode

Avg is an aggregate function that will find the average value of the combinations of nodes in the result set. The result set is all the various combinations of the joined results before they are combined into slices of objects. Since this is an aggregate operation, it will result in only one row and find the average value over all the rows in the result set, unless you also add a GroupBy statement.

func BitAnd

func BitAnd(arg1, arg2 interface{}) *OperationNode

func BitInvert

func BitInvert(n interface{}) *OperationNode

func BitOr

func BitOr(arg1, arg2 interface{}) *OperationNode

func BitShiftLeft

func BitShiftLeft(arg1, arg2 interface{}) *OperationNode

func BitShiftRight

func BitShiftRight(arg1, arg2 interface{}) *OperationNode

func BitXor

func BitXor(arg1, arg2 interface{}) *OperationNode

func Ceil

func Ceil(n ...interface{}) *OperationNode

func Contains

func Contains(arg1, arg2 any) *OperationNode

Contains returns on operation node that will return true for the following situations:

  • A text type field contains the given string value
  • An enum array node contains the given value

func Count

func Count(nodes ...Node) *OperationNode

Count is an aggregate function that will count the number of occurrences of the combinations of nodes in the result set. The result set is all the various combinations of the joined results before they are combined into slices of objects. Since this is an aggregate operation, it will result in only one row and count over all the rows in the result set, unless you also add a GroupBy statement.

func DateAddSeconds

func DateAddSeconds(arg1 interface{}, arg2 interface{}) *OperationNode

func Divide

func Divide(args ...interface{}) *OperationNode

func EndsWith

func EndsWith(arg1 any, arg2 string) *OperationNode

func Equal

func Equal(arg1 interface{}, arg2 interface{}) *OperationNode

func Exp

func Exp(n ...interface{}) *OperationNode

func Floor

func Floor(n ...interface{}) *OperationNode

func Function

func Function(funcName string, args ...interface{}) *OperationNode

Function lets you use any custom function which your database driver supports. Simply tell it the name and give it the arguments, and the result of the function will be used in the query.

func GreaterOrEqual

func GreaterOrEqual(arg1 interface{}, arg2 interface{}) *OperationNode

func GreaterThan

func GreaterThan(arg1 interface{}, arg2 interface{}) *OperationNode

func In

func In[T any](n Node, what ...T) *OperationNode

In tests to see if the given node is in the "what" list

func IsNotNull

func IsNotNull(n interface{}) *OperationNode

func IsNull

func IsNull(n interface{}) *OperationNode

func LessOrEqual

func LessOrEqual(arg1 interface{}, arg2 interface{}) *OperationNode

func LessThan

func LessThan(arg1 interface{}, arg2 interface{}) *OperationNode

func Like

func Like(n interface{}, pattern string) *OperationNode

func Ln

func Ln(n interface{}) *OperationNode

func Max

func Max(n Node) *OperationNode

Max is an aggregate function that will find the maximum value of the combinations of nodes in the result set. The result set is all the various combinations of the joined results before they are combined into slices of objects. Since this is an aggregate operation, it will result in only one row and find the maximum value over all the rows in the result set, unless you also add a GroupBy statement.

func Min

func Min(n Node) *OperationNode

Min is an aggregate function that will find the minimum value of the combinations of nodes in the result set. The result set is all the various combinations of the joined results before they are combined into slices of objects. Since this is an aggregate operation, it will result in only one row and find the minimum value over all the rows in the result set, unless you also add a GroupBy statement.

func Mod

func Mod(args ...interface{}) *OperationNode

func Multiply

func Multiply(args ...interface{}) *OperationNode

func Negative

func Negative(n interface{}) *OperationNode

func None

func None() *OperationNode

func Not

func Not(n interface{}) *OperationNode

func NotEqual

func NotEqual(arg1 interface{}, arg2 interface{}) *OperationNode

func NotIn

func NotIn[T any](n Node, what ...T) *OperationNode

NotIn tests to see if the given node is NOT in the "what" list

func Or

func Or(args ...interface{}) *OperationNode

func Power

func Power(n ...interface{}) *OperationNode

func Round

func Round(n ...interface{}) *OperationNode

func Sqrt

func Sqrt(n interface{}) *OperationNode

func StartsWith

func StartsWith(arg1 any, arg2 string) *OperationNode

func Subquery

func Subquery(b BuilderI) *SubqueryNode

func Subtract

func Subtract(args ...interface{}) *OperationNode

func Sum

func Sum(n Node) *OperationNode

Sum is an aggregate function that will find the sum of the combinations of nodes in the result set. The result set is all the various combinations of the joined results before they are combined into slices of objects. Since this is an aggregate operation, it will result in only one row and find the average value over all the rows in the result set, unless you also add a GroupBy statement.

func Xor

func Xor(arg1, arg2 interface{}) *OperationNode

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL