field

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package field provides a way to create field expressions for use with the docstore package.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertMods added in v1.3.0

func ConvertMods(mods []Mod) docstore.Mods

ConvertMods converts a slice of Mod objects to a docstore.Mods map. It iterates over each Mod in the input slice, calls the BuildMod method to get the field path and value, and adds them to the resulting map. The resulting map is then returned.

Types

type Asc

type Asc struct {
	Column Column
}

Asc asc for order by

func (Asc) BuildOrderBy

func (asc Asc) BuildOrderBy() (field string, direction string)

BuildOrderBy builds the order by clause

type Bool

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

Bool bool type field

func NewBool

func NewBool(table, column string, opts ...Option) Bool

NewBool creates a new Bool field

func (Bool) AddFieldPath

func (e Bool) AddFieldPath(path docstore.FieldPath) expr

AddFieldPath adds a field path to the column.

Example:

	field := field.Field{Column: field.Column{Name: "name"}}
 // "name"
	field = field.AddFieldPath("user")
 // "user.name"

func (Bool) Build

func (e Bool) Build() (fieldPath docstore.FieldPath, op string, value interface{})

Build returns the field path, operator, and value for the expression. If the expression is nil, it returns zero values for all three return types.

func (Bool) BuildMod added in v1.3.0

func (e Bool) BuildMod() (fieldPath docstore.FieldPath, value interface{})

BuildMod returns the docstore.FieldPath and value for the modifier.

func (Bool) ColumnName

func (e Bool) ColumnName() string

ColumnName returns the column name (same as the docstore tag name)

func (Bool) Eq

func (field Bool) Eq(value bool) Expr

Eq checks if the field is equal to the provided bool value

func (Bool) FieldPath

func (e Bool) FieldPath() docstore.FieldPath

FieldPath returns the docstore.FieldPath for the column.

func (Bool) Set added in v1.3.0

func (field Bool) Set(value bool) Mod

Set set value

func (Bool) Unset added in v1.3.0

func (e Bool) Unset() Mod

Unset returns a modifier to unset (delete) the value from the document.

type Bytes

type Bytes String

Bytes []byte type field

func NewBytes

func NewBytes(table, column string, opts ...Option) Bytes

NewBytes creates a new Bytes field

func (Bytes) Eq

func (field Bytes) Eq(value []byte) Expr

Eq checks if the field is equal to the provided bytes value

func (Bytes) Gt

func (field Bytes) Gt(value []byte) Expr

Gt checks if the field is greater than the provided bytes value

func (Bytes) Gte

func (field Bytes) Gte(value []byte) Expr

Gte checks if the field is greater than or equal to the provided bytes value

func (Bytes) In

func (field Bytes) In(values ...[]byte) Expr

In checks if the field is in the provided bytes values

func (Bytes) Lt

func (field Bytes) Lt(value []byte) Expr

Lt checks if the field is less than the provided bytes value

func (Bytes) Lte

func (field Bytes) Lte(value []byte) Expr

Lte checks if the field is less than or equal to the provided bytes value

func (Bytes) NotIn

func (field Bytes) NotIn(values ...[]byte) Expr

NotIn checks if the field is not in the provided bytes values

func (Bytes) Set added in v1.3.0

func (field Bytes) Set(value []byte) Mod

Set set value

type Column

type Column struct {
	Table string
	Name  string
	// contains filtered or unexported fields
}

Column represents a column in a table

func (Column) FieldPath

func (c Column) FieldPath() docstore.FieldPath

FieldPath returns the field path

type Columner added in v1.3.0

type Columner interface {
	// FieldPath returns the field path
	FieldPath() docstore.FieldPath
	// ColumnName returns the column name (same as the docstore tag name)
	ColumnName() string
}

Columner column interface

type Desc

type Desc Asc

Desc desc for order by

func (Desc) BuildOrderBy

func (desc Desc) BuildOrderBy() (field string, direction string)

BuildOrderBy builds the order by clause

type DocstoreTag

type DocstoreTag []string

DocstoreTag represents the docstore tag of the field

type Eq

type Eq struct {
	Column Column      // Column the column to compare
	Value  interface{} // Value the value to compare
}

Eq equal to for where

func (Eq) Build

func (eq Eq) Build() (fieldPath docstore.FieldPath, op string, value interface{})

Build builds the where clause

type Expr

type Expr interface {
	Columner
	Expression
}

Expr a query expression about field

type Expression

type Expression interface {
	// Build build expression
	Build() (fieldPath docstore.FieldPath, op string, value interface{})
}

Expression expression interface

type Field

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

Field represents a standard field struct

func NewField

func NewField(table, column string, opts ...Option) Field

NewField creates a new Field with the specified table, column, and options. It returns a Field struct that represents the field expression.

func (Field) Asc

func (e Field) Asc() OrderByExpression

Asc returns the field in ascending order

func (Field) BuildOrderBy

func (e Field) BuildOrderBy() (field string, direction string)

BuildOrderBy returns the field and direction for the order by expression

func (Field) Desc

func (e Field) Desc() OrderByExpression

Desc returns the field in descending order

func (Field) Eq

func (field Field) Eq(value interface{}) Expr

Eq checks if the field is equal to the provided value

Example
package main

import (
	"fmt"

	"github.com/bartventer/docstore-gen/field"
)

func main() {
	expr := field.NewField("user", "password").Eq("123")
	fieldPath, op, value := expr.Build()
	fmt.Println(fieldPath, op, value)
}
Output:

password = 123

func (Field) Gt

func (field Field) Gt(value interface{}) Expr

Gt checks if the field is greater than the provided value

Example
package main

import (
	"fmt"

	"github.com/bartventer/docstore-gen/field"
)

func main() {
	expr := field.NewField("user", "password").Gt(123)
	fieldPath, op, value := expr.Build()
	fmt.Println(fieldPath, op, value)
}
Output:

password > 123

func (Field) Gte

func (field Field) Gte(value interface{}) Expr

Gte checks if the field is greater than or equal to the provided value

Example
package main

import (
	"fmt"

	"github.com/bartventer/docstore-gen/field"
)

func main() {
	expr := field.NewField("user", "password").Gte(123)
	fieldPath, op, value := expr.Build()
	fmt.Println(fieldPath, op, value)
}
Output:

password >= 123

func (Field) In

func (field Field) In(values ...interface{}) Expr

In checks if the field is in the provided values

Example
package main

import (
	"fmt"

	"github.com/bartventer/docstore-gen/field"
)

func main() {
	expr := field.NewField("user", "password").In(123, 456, 789)
	fieldPath, op, value := expr.Build()
	fmt.Println(fieldPath, op, value)
}
Output:

password in [123 456 789]

func (Field) Lt

func (field Field) Lt(value interface{}) Expr

Lt checks if the field is less than the provided value

Example
package main

import (
	"fmt"

	"github.com/bartventer/docstore-gen/field"
)

func main() {
	expr := field.NewField("user", "password").Lt(123)
	fieldPath, op, value := expr.Build()
	fmt.Println(fieldPath, op, value)
}
Output:

password < 123

func (Field) Lte

func (field Field) Lte(value interface{}) Expr

Lte checks if the field is less than or equal to the provided value

Example
package main

import (
	"fmt"

	"github.com/bartventer/docstore-gen/field"
)

func main() {
	expr := field.NewField("user", "password").Lte(123)
	fieldPath, op, value := expr.Build()
	fmt.Println(fieldPath, op, value)
}
Output:

password <= 123

func (Field) NotIn

func (field Field) NotIn(values ...interface{}) Expr

NotIn checks if the field is not in the provided values

Example
package main

import (
	"fmt"

	"github.com/bartventer/docstore-gen/field"
)

func main() {
	expr := field.NewField("user", "password").NotIn(123, 456, 789)
	fieldPath, op, value := expr.Build()
	fmt.Println(fieldPath, op, value)
}
Output:

password not-in [123 456 789]

func (Field) Set added in v1.3.0

func (field Field) Set(value interface{}) Mod

Set set value

type Float32

type Float32 Float64

Float32 float32 type field

func NewFloat32

func NewFloat32(table, column string, opts ...Option) Float32

NewFloat32 creates a new Float32 field

func (Float32) Eq

func (field Float32) Eq(value float32) Expr

Eq checks if the field is equal to the provided float32 value

func (Float32) Gt

func (field Float32) Gt(value float32) Expr

Gt checks if the field is greater than the provided float32 value

func (Float32) Gte

func (field Float32) Gte(value float32) Expr

Gte checks if the field is greater than or equal to the provided float32 value

func (Float32) In

func (field Float32) In(values ...float32) Expr

In checks if the field is in the provided float32 values

func (Float32) Inc added in v1.3.0

func (field Float32) Inc(value float32) Mod

Inc increments the field by the provided float32 value

func (Float32) Lt

func (field Float32) Lt(value float32) Expr

Lt checks if the field is less than the provided float32 value

func (Float32) Lte

func (field Float32) Lte(value float32) Expr

Lte checks if the field is less than or equal to the provided float32 value

func (Float32) NotIn

func (field Float32) NotIn(values ...float32) Expr

NotIn checks if the field is not in the provided float32 values

func (Float32) Set added in v1.3.0

func (field Float32) Set(value float32) Mod

Set set value

type Float64

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

Float64 float64 type field

func NewFloat64

func NewFloat64(table, column string, opts ...Option) Float64

NewFloat64 creates a new Float64 field

func (Float64) Asc

func (e Float64) Asc() OrderByExpression

Asc returns the field in ascending order

func (Float64) BuildOrderBy

func (e Float64) BuildOrderBy() (field string, direction string)

BuildOrderBy returns the field and direction for the order by expression

func (Float64) Desc

func (e Float64) Desc() OrderByExpression

Desc returns the field in descending order

func (Float64) Eq

func (field Float64) Eq(value float64) Expr

Eq checks if the field is equal to the provided float64 value

func (Float64) Gt

func (field Float64) Gt(value float64) Expr

Gt checks if the field is greater than the provided float64 value

func (Float64) Gte

func (field Float64) Gte(value float64) Expr

Gte checks if the field is greater than or equal to the provided float64 value

func (Float64) In

func (field Float64) In(values ...float64) Expr

In checks if the field is in the provided float64 values

func (Float64) Inc added in v1.3.0

func (field Float64) Inc(value float64) Mod

Inc increments the field by the provided float64 value

func (Float64) Lt

func (field Float64) Lt(value float64) Expr

Lt checks if the field is less than the provided float64 value

func (Float64) Lte

func (field Float64) Lte(value float64) Expr

Lte checks if the field is less than or equal to the provided float64 value

func (Float64) NotIn

func (field Float64) NotIn(values ...float64) Expr

NotIn checks if the field is not in the provided float64 values

func (Float64) Set added in v1.3.0

func (field Float64) Set(value float64) Mod

Set set value

type Gt

type Gt Eq

Gt greater than for where

func (Gt) Build

func (gt Gt) Build() (fieldPath docstore.FieldPath, op string, value interface{})

Build builds the where clause

type Gte

type Gte Eq

Gte greater than or equal to for where

func (Gte) Build

func (gte Gte) Build() (fieldPath docstore.FieldPath, op string, value interface{})

Build builds the where clause

type In

type In struct {
	Column Column
	Values []interface{}
}

In in for where

func (In) Build

func (in In) Build() (fieldPath docstore.FieldPath, op string, value interface{})

Build builds the where clause

type Inc added in v1.3.0

type Inc[T numeric] struct {
	Column Column // Column represents the column to increment.
	Value  T      // Value represents the value to increment.
}

Inc represents an increment operation on a numeric column.

func (Inc[T]) BuildMod added in v1.3.0

func (inc Inc[T]) BuildMod() (fieldPath docstore.FieldPath, value interface{})

BuildMod returns the field path and value for an increment operation. It constructs a docstore.FieldPath using the column's field path and creates a driver.IncOp with the specified increment amount.

type Int

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

Int int type field

func NewInt

func NewInt(table, column string, opts ...Option) Int

NewInt creates a new Int field

func (Int) Asc

func (e Int) Asc() OrderByExpression

Asc returns the field in ascending order

func (Int) BuildOrderBy

func (e Int) BuildOrderBy() (field string, direction string)

BuildOrderBy returns the field and direction for the order by expression

func (Int) Desc

func (e Int) Desc() OrderByExpression

Desc returns the field in descending order

func (Int) Eq

func (field Int) Eq(value int) Expr

Eq checks if the field is equal to the provided int value

func (Int) Gt

func (field Int) Gt(value int) Expr

Gt checks if the field is greater than the provided int value

func (Int) Gte

func (field Int) Gte(value int) Expr

Gte checks if the field is greater than or equal to the provided int value

func (Int) In

func (field Int) In(values ...int) Expr

In checks if the field is in the provided int values

func (Int) Inc added in v1.3.0

func (field Int) Inc(value int) Mod

Inc increments the field by the provided int value

func (Int) Lt

func (field Int) Lt(value int) Expr

Lt checks if the field is less than the provided int value

func (Int) Lte

func (field Int) Lte(value int) Expr

Lte checks if the field is less than or equal to the provided int value

func (Int) NotIn

func (field Int) NotIn(values ...int) Expr

NotIn checks if the field is not in the provided int values

func (Int) Set added in v1.3.0

func (field Int) Set(value int) Mod

Set set value

type Int16

type Int16 Int

Int16 int16 type field

func NewInt16

func NewInt16(table, column string, opts ...Option) Int16

NewInt16 creates a new Int16 field

func (Int16) Eq

func (field Int16) Eq(value int16) Expr

Eq checks if the field is equal to the provided int16 value

func (Int16) Gt

func (field Int16) Gt(value int16) Expr

Gt checks if the field is greater than the provided int16 value

func (Int16) Gte

func (field Int16) Gte(value int16) Expr

Gte checks if the field is greater than or equal to the provided int16 value

func (Int16) In

func (field Int16) In(values ...int16) Expr

In checks if the field is in the provided int16 values

func (Int16) Inc added in v1.3.0

func (field Int16) Inc(value int16) Mod

Inc increments the field by the provided int16 value

func (Int16) Lt

func (field Int16) Lt(value int16) Expr

Lt checks if the field is less than the provided int16 value

func (Int16) Lte

func (field Int16) Lte(value int16) Expr

Lte checks if the field is less than or equal to the provided int16 value

func (Int16) NotIn

func (field Int16) NotIn(values ...int16) Expr

NotIn checks if the field is not in the provided int16 values

func (Int16) Set added in v1.3.0

func (field Int16) Set(value int16) Mod

Set set value

type Int32

type Int32 Int

Int32 int32 type field

func NewInt32

func NewInt32(table, column string, opts ...Option) Int32

NewInt32 creates a new Int32 field

func (Int32) Eq

func (field Int32) Eq(value int32) Expr

Eq checks if the field is equal to the provided int32 value

func (Int32) Gt

func (field Int32) Gt(value int32) Expr

Gt checks if the field is greater than the provided int32 value

func (Int32) Gte

func (field Int32) Gte(value int32) Expr

Gte checks if the field is greater than or equal to the provided int32 value

func (Int32) In

func (field Int32) In(values ...int32) Expr

In checks if the field is in the provided int32 values

func (Int32) Inc added in v1.3.0

func (field Int32) Inc(value int32) Mod

Inc increments the field by the provided int32 value

func (Int32) Lt

func (field Int32) Lt(value int32) Expr

Lt checks if the field is less than the provided int32 value

func (Int32) Lte

func (field Int32) Lte(value int32) Expr

Lte checks if the field is less than or equal to the provided int32 value

func (Int32) NotIn

func (field Int32) NotIn(values ...int32) Expr

NotIn checks if the field is not in the provided int32 values

func (Int32) Set added in v1.3.0

func (field Int32) Set(value int32) Mod

Set set value

type Int64

type Int64 Int

Int64 int64 type field

func NewInt64

func NewInt64(table, column string, opts ...Option) Int64

NewInt64 creates a new Int64 field

func (Int64) Eq

func (field Int64) Eq(value int64) Expr

Eq checks if the field is equal to the provided int64 value

func (Int64) Gt

func (field Int64) Gt(value int64) Expr

Gt checks if the field is greater than the provided int64 value

func (Int64) Gte

func (field Int64) Gte(value int64) Expr

Gte checks if the field is greater than or equal to the provided int64 value

func (Int64) In

func (field Int64) In(values ...int64) Expr

In checks if the field is in the provided int64 values

func (Int64) Inc added in v1.3.0

func (field Int64) Inc(value int64) Mod

Inc increments the field by the provided int64 value

func (Int64) Lt

func (field Int64) Lt(value int64) Expr

Lt checks if the field is less than the provided int64 value

func (Int64) Lte

func (field Int64) Lte(value int64) Expr

Lte checks if the field is less than or equal to the provided int64 value

func (Int64) NotIn

func (field Int64) NotIn(values ...int64) Expr

NotIn checks if the field is not in the provided int64 values

func (Int64) Set added in v1.3.0

func (field Int64) Set(value int64) Mod

Set set value

type Int8

type Int8 Int

Int8 int8 type field

func NewInt8

func NewInt8(table, column string, opts ...Option) Int8

NewInt8 creates a new Int8 field

func (Int8) Eq

func (field Int8) Eq(value int8) Expr

Eq checks if the field is equal to the provided int8 value

func (Int8) Gt

func (field Int8) Gt(value int8) Expr

Gt checks if the field is greater than the provided int8 value

func (Int8) Gte

func (field Int8) Gte(value int8) Expr

Gte checks if the field is greater than or equal to the provided int8 value

func (Int8) In

func (field Int8) In(values ...int8) Expr

In checks if the field is in the provided int8 values

func (Int8) Inc added in v1.3.0

func (field Int8) Inc(value int8) Mod

Inc increments the field by the provided int8 value

func (Int8) Lt

func (field Int8) Lt(value int8) Expr

Lt checks if the field is less than the provided int8 value

func (Int8) Lte

func (field Int8) Lte(value int8) Expr

Lte checks if the field is less than or equal to the provided int8 value

func (Int8) NotIn

func (field Int8) NotIn(values ...int8) Expr

NotIn checks if the field is not in the provided int8 values

func (Int8) Set added in v1.3.0

func (field Int8) Set(value int8) Mod

Set set value

type Lt

type Lt Eq

Lt less than for where

func (Lt) Build

func (lt Lt) Build() (fieldPath docstore.FieldPath, op string, value interface{})

Build builds the where clause

type Lte

type Lte Eq

Lte less than or equal to for where

func (Lte) Build

func (lte Lte) Build() (fieldPath docstore.FieldPath, op string, value interface{})

Build builds the where clause

type Mod added in v1.3.0

type Mod interface {
	// BuildMod build a field path and value for the modifier
	BuildMod() (fieldPath docstore.FieldPath, value interface{})
}

Mod modifier interface

type NotIn

type NotIn In

NotIn not in for where

func (NotIn) Build

func (notIn NotIn) Build() (fieldPath docstore.FieldPath, op string, value interface{})

Build builds the where clause

type Option

type Option func(Column) Column

Option field option

type OrderByExpression

type OrderByExpression interface {
	// BuildOrderBy build order by expression
	BuildOrderBy() (field string, direction string)
}

OrderByExpression order by expression interface

type Set added in v1.3.0

type Set struct {
	Column Column // Column the column to set
	Value  any    // Value the value to set
}

Set set field value

func (Set) BuildMod added in v1.3.0

func (set Set) BuildMod() (fieldPath docstore.FieldPath, value any)

BuildMod build a field path and value for the modifier

type String

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

String string type field

func NewString

func NewString(table, column string, opts ...Option) String

NewString creates a new String field

func (String) Asc

func (e String) Asc() OrderByExpression

Asc returns the field in ascending order

Example
package main

import (
	"fmt"

	"github.com/bartventer/docstore-gen/field"
)

func main() {
	expr := field.NewString("table", "column").Asc()
	fieldPath, direction := expr.BuildOrderBy()
	fmt.Println(fieldPath, direction)
}
Output:

column asc

func (String) BuildOrderBy

func (e String) BuildOrderBy() (field string, direction string)

BuildOrderBy returns the field and direction for the order by expression

func (String) Desc

func (e String) Desc() OrderByExpression

Desc returns the field in descending order

Example
package main

import (
	"fmt"

	"github.com/bartventer/docstore-gen/field"
)

func main() {
	expr := field.NewString("table", "column").Desc()
	fieldPath, direction := expr.BuildOrderBy()
	fmt.Println(fieldPath, direction)
}
Output:

column desc

func (String) Eq

func (field String) Eq(value string) Expr

Eq checks if the field is equal to the provided string value

func (String) Gt

func (field String) Gt(value string) Expr

Gt checks if the field is greater than the provided string value

func (String) Gte

func (field String) Gte(value string) Expr

Gte checks if the field is greater than or equal to the provided string value

func (String) In

func (field String) In(values ...string) Expr

In checks if the field is in the provided string values

func (String) Lt

func (field String) Lt(value string) Expr

Lt checks if the field is less than the provided string value

func (String) Lte

func (field String) Lte(value string) Expr

Lte checks if the field is less than or equal to the provided string value

func (String) NotIn

func (field String) NotIn(values ...string) Expr

NotIn checks if the field is not in the provided string values

func (String) Set added in v1.3.0

func (field String) Set(value string) Mod

Set set value

type Tag

type Tag map[string]string

Tag represents the tag of the field

type Time

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

Time time type field

func NewTime

func NewTime(table, column string, opts ...Option) Time

NewTime creates a new Time field

func (Time) Asc

func (e Time) Asc() OrderByExpression

Asc returns the field in ascending order

func (Time) BuildOrderBy

func (e Time) BuildOrderBy() (field string, direction string)

BuildOrderBy returns the field and direction for the order by expression

func (Time) Desc

func (e Time) Desc() OrderByExpression

Desc returns the field in descending order

func (Time) Eq

func (field Time) Eq(value time.Time) Expr

Eq checks if the field is equal to the provided time value

func (Time) Gt

func (field Time) Gt(value time.Time) Expr

Gt checks if the field is greater than the provided time value

func (Time) Gte

func (field Time) Gte(value time.Time) Expr

Gte checks if the field is greater than or equal to the provided time value

func (Time) In

func (field Time) In(values ...time.Time) Expr

In checks if the field is in the provided time values

func (Time) Lt

func (field Time) Lt(value time.Time) Expr

Lt checks if the field is less than the provided time value

func (Time) Lte

func (field Time) Lte(value time.Time) Expr

Lte checks if the field is less than or equal to the provided time value

func (Time) NotIn

func (field Time) NotIn(values ...time.Time) Expr

NotIn checks if the field is not in the provided time values

func (Time) Set added in v1.3.0

func (field Time) Set(value time.Time) Mod

Set set value

type Uint

type Uint Int

Uint uint type field

func NewUint

func NewUint(table, column string, opts ...Option) Uint

NewUint creates a new Uint field

func (Uint) Eq

func (field Uint) Eq(value uint) Expr

Eq checks if the field is equal to the provided uint value

func (Uint) Gt

func (field Uint) Gt(value uint) Expr

Gt checks if the field is greater than the provided uint value

func (Uint) Gte

func (field Uint) Gte(value uint) Expr

Gte checks if the field is greater than or equal to the provided uint value

func (Uint) In

func (field Uint) In(values ...uint) Expr

In checks if the field is in the provided uint values

func (Uint) Inc added in v1.3.0

func (field Uint) Inc(value uint) Mod

Inc increments the field by the provided uint value

func (Uint) Lt

func (field Uint) Lt(value uint) Expr

Lt checks if the field is less than the provided uint value

func (Uint) Lte

func (field Uint) Lte(value uint) Expr

Lte checks if the field is less than or equal to the provided uint value

func (Uint) NotIn

func (field Uint) NotIn(values ...uint) Expr

NotIn checks if the field is not in the provided uint values

func (Uint) Set added in v1.3.0

func (field Uint) Set(value uint) Mod

Set set value

type Uint16

type Uint16 Int

Uint16 uint16 type field

func NewUint16

func NewUint16(table, column string, opts ...Option) Uint16

NewUint16 creates a new Uint16 field

func (Uint16) Eq

func (field Uint16) Eq(value uint16) Expr

Eq checks if the field is equal to the provided uint16 value

func (Uint16) Gt

func (field Uint16) Gt(value uint16) Expr

Gt checks if the field is greater than the provided uint16 value

func (Uint16) Gte

func (field Uint16) Gte(value uint16) Expr

Gte checks if the field is greater than or equal to the provided uint16 value

func (Uint16) In

func (field Uint16) In(values ...uint16) Expr

In checks if the field is in the provided uint16 values

func (Uint16) Inc added in v1.3.0

func (field Uint16) Inc(value uint16) Mod

Inc increments the field by the provided uint16 value

func (Uint16) Lt

func (field Uint16) Lt(value uint16) Expr

Lt checks if the field is less than the provided uint16 value

func (Uint16) Lte

func (field Uint16) Lte(value uint16) Expr

Lte checks if the field is less than or equal to the provided uint16 value

func (Uint16) NotIn

func (field Uint16) NotIn(values ...uint16) Expr

NotIn checks if the field is not in the provided uint16 values

func (Uint16) Set added in v1.3.0

func (field Uint16) Set(value uint16) Mod

Set set value

type Uint32

type Uint32 Int

Uint32 uint32 type field

func NewUint32

func NewUint32(table, column string, opts ...Option) Uint32

NewUint32 creates a new Uint32 field

func (Uint32) Eq

func (field Uint32) Eq(value uint32) Expr

Eq checks if the field is equal to the provided uint32 value

func (Uint32) Gt

func (field Uint32) Gt(value uint32) Expr

Gt checks if the field is greater than the provided uint32 value

func (Uint32) Gte

func (field Uint32) Gte(value uint32) Expr

Gte checks if the field is greater than or equal to the provided uint32 value

func (Uint32) In

func (field Uint32) In(values ...uint32) Expr

In checks if the field is in the provided uint32 values

func (Uint32) Inc added in v1.3.0

func (field Uint32) Inc(value uint32) Mod

Inc increments the field by the provided uint32 value

func (Uint32) Lt

func (field Uint32) Lt(value uint32) Expr

Lt checks if the field is less than the provided uint32 value

func (Uint32) Lte

func (field Uint32) Lte(value uint32) Expr

Lte checks if the field is less than or equal to the provided uint32 value

func (Uint32) NotIn

func (field Uint32) NotIn(values ...uint32) Expr

NotIn checks if the field is not in the provided uint32 values

func (Uint32) Set added in v1.3.0

func (field Uint32) Set(value uint32) Mod

Set set value

type Uint64

type Uint64 Int

Uint64 uint64 type field

func NewUint64

func NewUint64(table, column string, opts ...Option) Uint64

NewUint64 creates a new Uint64 field

func (Uint64) Eq

func (field Uint64) Eq(value uint64) Expr

Eq checks if the field is equal to the provided uint64 value

func (Uint64) Gt

func (field Uint64) Gt(value uint64) Expr

Gt checks if the field is greater than the provided uint64 value

func (Uint64) Gte

func (field Uint64) Gte(value uint64) Expr

Gte checks if the field is greater than or equal to the provided uint64 value

func (Uint64) In

func (field Uint64) In(values ...uint64) Expr

In checks if the field is in the provided uint64 values

func (Uint64) Inc added in v1.3.0

func (field Uint64) Inc(value uint64) Mod

Inc increments the field by the provided uint64 value

func (Uint64) Lt

func (field Uint64) Lt(value uint64) Expr

Lt checks if the field is less than the provided uint64 value

func (Uint64) Lte

func (field Uint64) Lte(value uint64) Expr

Lte checks if the field is less than or equal to the provided uint64 value

func (Uint64) NotIn

func (field Uint64) NotIn(values ...uint64) Expr

NotIn checks if the field is not in the provided uint64 values

func (Uint64) Set added in v1.3.0

func (field Uint64) Set(value uint64) Mod

Set set value

type Uint8

type Uint8 Int

Uint8 uint8 type field

func NewUint8

func NewUint8(table, column string, opts ...Option) Uint8

NewUint8 creates a new Uint8 field

func (Uint8) Eq

func (field Uint8) Eq(value uint8) Expr

Eq checks if the field is equal to the provided uint8 value

func (Uint8) Gt

func (field Uint8) Gt(value uint8) Expr

Gt checks if the field is greater than the provided uint8 value

func (Uint8) Gte

func (field Uint8) Gte(value uint8) Expr

Gte checks if the field is greater than or equal to the provided uint8 value

func (Uint8) In

func (field Uint8) In(values ...uint8) Expr

In checks if the field is in the provided uint8 values

func (Uint8) Inc added in v1.3.0

func (field Uint8) Inc(value uint8) Mod

Inc increments the field by the provided uint8 value

func (Uint8) Lt

func (field Uint8) Lt(value uint8) Expr

Lt checks if the field is less than the provided uint8 value

func (Uint8) Lte

func (field Uint8) Lte(value uint8) Expr

Lte checks if the field is less than or equal to the provided uint8 value

func (Uint8) NotIn

func (field Uint8) NotIn(values ...uint8) Expr

NotIn checks if the field is not in the provided uint8 values

func (Uint8) Set added in v1.3.0

func (field Uint8) Set(value uint8) Mod

Set set value

type Unset added in v1.3.0

type Unset struct {
	Column Column // Column the column to unset
}

Unset unset field value

func (Unset) BuildMod added in v1.3.0

func (unset Unset) BuildMod() (fieldPath docstore.FieldPath, value interface{})

BuildMod build a field path and value for the modifier

Jump to

Keyboard shortcuts

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