where

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Copyright (c) 2025 DaggerTech. All rights reserved. Use of this source code is governed by an MIT license that can be found in the LICENSE file. Package where provides functionality for building SQL WHERE clauses

Copyright (c) 2025 DaggerTech. All rights reserved. Use of this source code is governed by an MIT license that can be found in the LICENSE file. Package where provides functionality for building SQL WHERE clauses

Copyright (c) 2025 DaggerTech. All rights reserved. Use of this source code is governed by an MIT license that can be found in the LICENSE file. Package where provides functionality for building SQL WHERE clauses

Copyright (c) 2025 DaggerTech. All rights reserved. Use of this source code is governed by an MIT license that can be found in the LICENSE file. Package where provides functionality for building SQL WHERE clauses

Copyright (c) 2025 DaggerTech. All rights reserved. Use of this source code is governed by an MIT license that can be found in the LICENSE file. Package where provides functionality for building SQL WHERE clauses

Copyright (c) 2025 DaggerTech. All rights reserved. Use of this source code is governed by an MIT license that can be found in the LICENSE file. Package where provides functionality for building SQL WHERE clauses

Copyright (c) 2025 DaggerTech. All rights reserved. Use of this source code is governed by an MIT license that can be found in the LICENSE file. Package clause This is a very basic, and yet versatile ORM package. At present, this is only for postgres

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

Builder is the main clause builder mechanism used for dagger

func Between

func Between(field string, value1 interface{}, value2 interface{}) *Builder

Between creates a new Builder with the first clause being a between clause @param f @param v1 @param v2 @return *Builder

func Contains

func Contains(field string, value string) *Builder

Contains creates a new Builder with the first clause being a contains clause @param f @param v @return *Builder

func EndsWith

func EndsWith(field string, value string) *Builder

EndsWith creates a new Builder with the first clause being an ends with clause @param f @param v @return *Builder

func Equal

func Equal(field string, value interface{}) *Builder

Equal creates a new Builder with the first clause being an equal clause @param f @param v @return *Builder

func Greater

func Greater(field string, value interface{}) *Builder

Greater creates a new Builder with the first clause being a greater than clause @param f @param v @return *Builder

func In

func In(field string, value interface{}) *Builder

In creates a new Builder with the first clause being an in clause @param f @param v @return *Builder

func IsNotNull

func IsNotNull(field string) *Builder

IsNotNull creates a new Builder with the first clause being an is null clause @param f @return *Builder

func IsNull

func IsNull(field string) *Builder

IsNull creates a new Builder with the first clause being an is null clause @param f @return *Builder

func Less

func Less(field string, value interface{}) *Builder

Less creates a new Builder with the first clause being a less than clause @param f @param v @return *Builder

func Like

func Like(field string, value string) *Builder

Like creates a new Builder with the first clause being a like clause @param f @param v @return *Builder

func NewBuilder

func NewBuilder(c ...conjunction) *Builder

NewBuilder @param c @return *Builder

func NotBetween

func NotBetween(field string, value1 interface{}, value2 interface{}) *Builder

NotBetween creates a new Builder with the first clause being a not between clause @param f @param v1 @param v2 @return *Builder

func NotContains

func NotContains(field string, value string) *Builder

NotContains creates a new Builder with the first clause being a not contains clause @param f @param v @return *Builder

func NotEndsWith

func NotEndsWith(field string, value string) *Builder

NotEndsWith creates a new Builder with the first clause being a not ends with clause @param f @param v @return *Builder

func NotEqual

func NotEqual(field string, value interface{}) *Builder

NotEqual creates a new Builder with the first clause being a not equal clause @param f @param v @return *Builder

func NotGreater

func NotGreater(field string, value interface{}) *Builder

NotGreater creates a new Builder with the first clause being a not greater than clause @param f @param v @return *Builder

func NotIn

func NotIn(field string, value interface{}) *Builder

NotIn creates a new Builder with the first clause being a not in clause @param f @param v @return *Builder

func NotLess

func NotLess(field string, value interface{}) *Builder

NotLess creates a new Builder with the first clause being a not less than clause @param f @param v @return *Builder

func NotLike

func NotLike(field string, value string) *Builder

NotLike creates a new Builder with the first clause being a not like clause @param f @param v @return *Builder

func NotStartsWith

func NotStartsWith(field string, value string) *Builder

NotStartsWith creates a new Builder with the first clause being a not starts with clause @param f @param v @return *Builder

func StartsWith

func StartsWith(field string, value string) *Builder

StartsWith creates a new Builder with the first clause being a starts with clause @param f @param v @return *Builder

func Sub

func Sub(c *Builder) *Builder

Sub creates a new Builder with the first clause being a sub clause @param c @return *Builder

func (*Builder) AndBetween

func (c *Builder) AndBetween(field string, value1 interface{}, value2 interface{}) *Builder

AndBetween add a between clause to the clause with an AND conjunction

func (*Builder) AndContains

func (c *Builder) AndContains(field string, value string) *Builder

AndContains add a contains clause to the clause with an AND conjunction

func (*Builder) AndEndsWith

func (c *Builder) AndEndsWith(field string, value string) *Builder

AndEndsWith add a ends with clause to the clause with an AND conjunction

func (*Builder) AndEqual

func (c *Builder) AndEqual(field string, value interface{}) *Builder

AndEqual add an equal clause to the clause with an AND conjunction @receiver c @param f @param v @return *Builder

func (*Builder) AndGreater

func (c *Builder) AndGreater(field string, value interface{}) *Builder

AndGreater add a greater than clause to the clause with an AND conjunction @receiver c @param f @param v @return *Builder

func (*Builder) AndIn

func (c *Builder) AndIn(field string, value interface{}) *Builder

AndIn add an in clause to the clause with an AND conjunction

func (*Builder) AndIsNull

func (c *Builder) AndIsNull(field string) *Builder

AndIsNull adds an is null clause to the clause with an AND conjunction

func (*Builder) AndLess

func (c *Builder) AndLess(field string, value interface{}) *Builder

AndLess add a less than clause to the clause with an AND conjunction

func (*Builder) AndLike

func (c *Builder) AndLike(field string, value string) *Builder

AndLike add a like clause to the clause with an AND conjunction

func (*Builder) AndNotBetween

func (c *Builder) AndNotBetween(field string, value1 interface{}, value2 interface{}) *Builder

AndNotBetween add a not between clause to the clause with an AND conjunction

func (*Builder) AndNotContains

func (c *Builder) AndNotContains(field string, value string) *Builder

AndNotContains add a contains clause to the clause with an AND conjunction

func (*Builder) AndNotEndsWith

func (c *Builder) AndNotEndsWith(field string, value string) *Builder

AndNotEndsWith add a ends with clause to the clause with an AND conjunction

func (*Builder) AndNotEqual

func (c *Builder) AndNotEqual(field string, value interface{}) *Builder

AndNotEqual add a not equal clause to the clause with an AND conjunction

func (*Builder) AndNotGreater

func (c *Builder) AndNotGreater(field string, value interface{}) *Builder

AndNotGreater add a not greater than clause to the clause with an AND conjunction

func (*Builder) AndNotIn

func (c *Builder) AndNotIn(field string, value interface{}) *Builder

AndNotIn add a not in clause to the clause with an AND conjunction

func (*Builder) AndNotIsNull

func (c *Builder) AndNotIsNull(field string) *Builder

AndNotIsNull adds a not is null clause to the clause with an AND conjunction

func (*Builder) AndNotLess

func (c *Builder) AndNotLess(field string, value interface{}) *Builder

AndNotLess add a not less than clause to the clause with an AND conjunction

func (*Builder) AndNotLike

func (c *Builder) AndNotLike(field string, value string) *Builder

AndNotLike add a not like clause to the clause with an AND conjunction

func (*Builder) AndNotStartsWith

func (c *Builder) AndNotStartsWith(field string, value string) *Builder

AndNotStartsWith add a starts with clause to the clause with an AND conjunction

func (*Builder) AndStartsWith

func (c *Builder) AndStartsWith(field string, value string) *Builder

AndStartsWith add a starts with clause to the clause with an AND conjunction

func (*Builder) AndSub

func (c *Builder) AndSub(n *Builder) *Builder

AndSub add and existing subclause to the clause with an AND conjunction @receiver c @param n @return *Builder

func (*Builder) Count

func (c *Builder) Count() int

func (*Builder) OrBetween

func (c *Builder) OrBetween(field string, value1 interface{}, value2 interface{}) *Builder

OrBetween add a between clause to the clause with an OR conjunction

func (*Builder) OrContains

func (c *Builder) OrContains(field string, value string) *Builder

OrContains add a contains clause to the clause with an OR conjunction

func (*Builder) OrEndsWith

func (c *Builder) OrEndsWith(field string, value string) *Builder

OrEndsWith add a ends with clause to the clause with an OR conjunction

func (*Builder) OrEqual

func (c *Builder) OrEqual(field string, value interface{}) *Builder

OrEqual add an equal clause to the clause with an OR conjunction

func (*Builder) OrGreater

func (c *Builder) OrGreater(field string, value interface{}) *Builder

OrGreater add a greater than clause to the clause with an OR conjunction

func (*Builder) OrIn

func (c *Builder) OrIn(field string, value interface{}) *Builder

OrIn add an in clause to the clause with an OR conjunction

func (*Builder) OrIsNull

func (c *Builder) OrIsNull(field string) *Builder

OrIsNull adds an is null clause to the clause with an OR conjunction

func (*Builder) OrLess

func (c *Builder) OrLess(field string, value interface{}) *Builder

OrLess add a less than clause to the clause with an OR conjunction

func (*Builder) OrLike

func (c *Builder) OrLike(field string, value string) *Builder

OrLike add a like clause to the clause with an OR conjunction

func (*Builder) OrNotBetween

func (c *Builder) OrNotBetween(field string, value1 interface{}, value2 interface{}) *Builder

OrNotBetween add a not between clause to the clause with an OR conjunction

func (*Builder) OrNotContains

func (c *Builder) OrNotContains(field string, value string) *Builder

OrNotContains add a not contains clause to the clause with an OR conjunction

func (*Builder) OrNotEndsWith

func (c *Builder) OrNotEndsWith(field string, value string) *Builder

OrNotEndsWith add a not ends with clause to the clause with an OR conjunction

func (*Builder) OrNotEqual

func (c *Builder) OrNotEqual(field string, value interface{}) *Builder

OrNotEqual add a not equal clause to the clause with an OR conjunction

func (*Builder) OrNotGreater

func (c *Builder) OrNotGreater(field string, value interface{}) *Builder

OrNotGreater add a not greater than clause to the clause with an OR conjunction

func (*Builder) OrNotIn

func (c *Builder) OrNotIn(field string, value interface{}) *Builder

OrNotIn add a not in clause to the clause with an OR conjunction

func (*Builder) OrNotIsNull

func (c *Builder) OrNotIsNull(field string) *Builder

OrNotIsNull adds a not is null clause to the clause with an OR conjunction

func (*Builder) OrNotLess

func (c *Builder) OrNotLess(field string, value interface{}) *Builder

OrNotLess add a not less than clause to the clause with an OR conjunction

func (*Builder) OrNotLike

func (c *Builder) OrNotLike(field string, value string) *Builder

OrNotLike add a not like clause to the clause with an OR conjunction

func (*Builder) OrNotStartsWith

func (c *Builder) OrNotStartsWith(field string, value string) *Builder

OrNotStartsWith add a not starts with clause to the clause with an OR conjunction

func (*Builder) OrStartsWith

func (c *Builder) OrStartsWith(field string, value string) *Builder

OrStartsWith add a starts with clause to the clause with an OR conjunction

func (*Builder) OrSub

func (c *Builder) OrSub(n *Builder) *Builder

OrSub add and existing subclause to the clause with an OR conjunction

func (*Builder) String

func (c *Builder) String(operators []string) string

String returns the string version of the clause @receiver c @return string

type DBField

type DBField interface {
	DBNumeric | bool | string | time.Time
}

DBField represents all valid database field types This includes numeric types, boolean, string, and time.Time

type DBFloat

type DBFloat interface {
	float32 | float64
}

DBFloat represents floating-point number types supported by the database

type DBInt

type DBInt interface {
	int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64
}

DBInt represents all integer types supported by the database This includes both signed and unsigned integers of various sizes

type DBNumeric

type DBNumeric interface {
	DBInt | DBFloat
}

DBNumeric is a union type that includes all numeric types (both integers and floating-point numbers) supported by the database

Jump to

Keyboard shortcuts

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