Documentation ¶
Index ¶
- Variables
- type BasicTable
- type Column
- type ColumnFieldExprType
- type ColumnFieldExprTypePointer
- type Context
- type DB
- type DeleteContext
- func (c *DeleteContext[T]) Do(db DB) (rowsAffected int64, err error)
- func (c *DeleteContext[T]) DoCtx(ctx context.Context, db DB) (rowsAffected int64, err error)
- func (c *DeleteContext[T]) Limit(limit uint64) *DeleteContext[T]
- func (c *DeleteContext[T]) OrderBy(direction OrderDirection, expr TableExpr[T]) *DeleteContext[T]
- func (c *DeleteContext[T]) Where(condition TypedTableExpr[T, WrappedPrimitive[bool]]) *DeleteContext[T]
- type Expr
- type ExprPrimitive
- type ExprStruct
- type ExprType
- type FindContext
- func (c *FindContext[S, T, U]) Distinct() *FindContext[S, T, U]
- func (c *FindContext[S, T, U]) Get(db DB) (T, error)
- func (c *FindContext[S, T, U]) GetAll(db DB) ([]T, error)
- func (c *FindContext[S, T, U]) GetAllCtx(ctx context.Context, db DB) ([]T, error)
- func (c *FindContext[S, T, U]) GetCtx(ctx context.Context, db DB) (T, error)
- func (c *FindContext[S, T, U]) GroupBy(exprs ...TableExpr[S]) *FindContext[S, T, U]
- func (c *FindContext[S, T, U]) Having(condition TypedTableExpr[S, WrappedPrimitive[bool]]) *FindContext[S, T, U]
- func (c *FindContext[S, T, U]) Limit(limit uint64) *FindContext[S, T, U]
- func (c *FindContext[S, T, U]) Lock(lockType LockType) *FindContext[S, T, U]
- func (c *FindContext[S, T, U]) Offset(offset uint64) *FindContext[S, T, U]
- func (c *FindContext[S, T, U]) OrderBy(direction OrderDirection, expr TableExpr[S]) *FindContext[S, T, U]
- func (c *FindContext[S, T, U]) Where(condition TypedTableExpr[S, WrappedPrimitive[bool]]) *FindContext[S, T, U]
- type InsertContext
- func (c *InsertContext[T]) Do(db DB) (rowsAffected int64, err error)
- func (c *InsertContext[T]) DoCtx(ctx context.Context, db DB) (rowsAffected int64, err error)
- func (c *InsertContext[T]) Fields(fields ...TableColumns[T]) *InsertContext[T]
- func (c *InsertContext[T]) Values(tableBases ...T) *InsertContext[T]
- type JoinedTable
- type LockType
- type OrderDirection
- type PluckContext
- func (c *PluckContext[T, S]) Distinct() *PluckContext[T, S]
- func (c *PluckContext[T, S]) Get(db DB) (S, error)
- func (c *PluckContext[T, S]) GetAll(db DB) ([]S, error)
- func (c *PluckContext[T, S]) GetAllCtx(ctx context.Context, db DB) ([]S, error)
- func (c *PluckContext[T, S]) GetCtx(ctx context.Context, db DB) (S, error)
- func (c *PluckContext[T, S]) GroupBy(exprs ...TableExpr[T]) *PluckContext[T, S]
- func (c *PluckContext[T, S]) Having(condition TypedTableExpr[T, WrappedPrimitive[bool]]) *PluckContext[T, S]
- func (c *PluckContext[T, S]) Limit(limit uint64) *PluckContext[T, S]
- func (c *PluckContext[T, S]) Lock(lockType LockType) *PluckContext[T, S]
- func (c *PluckContext[T, S]) Offset(offset uint64) *PluckContext[T, S]
- func (c *PluckContext[T, S]) OrderBy(direction OrderDirection, expr TableExpr[T]) *PluckContext[T, S]
- func (c *PluckContext[T, S]) Where(condition TypedTableExpr[T, WrappedPrimitive[bool]]) *PluckContext[T, S]
- type Ref
- type SelectContext
- func (c *SelectContext[S, T]) Distinct() *SelectContext[S, T]
- func (c *SelectContext[S, T]) Fields(fields ...TableColumns[T]) *SelectContext[S, T]
- func (c *SelectContext[S, T]) Get(db DB) (T, error)
- func (c *SelectContext[S, T]) GetAll(db DB) ([]T, error)
- func (c *SelectContext[S, T]) GetAllCtx(ctx context.Context, db DB) ([]T, error)
- func (c *SelectContext[S, T]) GetCtx(ctx context.Context, db DB) (T, error)
- func (c *SelectContext[S, T]) GroupBy(exprs ...TableExpr[T]) *SelectContext[S, T]
- func (c *SelectContext[S, T]) Having(condition TypedTableExpr[T, WrappedPrimitive[bool]]) *SelectContext[S, T]
- func (c *SelectContext[S, T]) Limit(limit uint64) *SelectContext[S, T]
- func (c *SelectContext[S, T]) Lock(lockType LockType) *SelectContext[S, T]
- func (c *SelectContext[S, T]) Offset(offset uint64) *SelectContext[S, T]
- func (c *SelectContext[S, T]) OrderBy(direction OrderDirection, expr TableExpr[T]) *SelectContext[S, T]
- func (c *SelectContext[S, T]) Where(condition TypedTableExpr[T, WrappedPrimitive[bool]]) *SelectContext[S, T]
- type Table
- type TableAssignExpr
- type TableColumns
- type TableExpr
- type TablePointer
- type Tuple
- type Tuple2Struct
- type Tuple3Struct
- type Tuple4Struct
- type Tuple5Struct
- type TuplePointer
- type TypedColumns
- type TypedExpr
- type TypedTableColumns
- type TypedTableExpr
- func And[T Table](expr1 TypedTableExpr[T, WrappedPrimitive[bool]], ...) TypedTableExpr[T, WrappedPrimitive[bool]]
- func Avg[T Table, S ExprType](expr TypedTableExpr[T, S], distinct bool) TypedTableExpr[T, WrappedPrimitive[float64]]
- func Count[T Table, S ExprType](expr TypedTableExpr[T, S], distinct bool) TypedTableExpr[T, WrappedPrimitive[int64]]
- func Eq[T Table, S ExprType](expr1 TypedTableExpr[T, S], expr2 TypedTableExpr[T, S]) TypedTableExpr[T, WrappedPrimitive[bool]]
- func EqLit[T Table, S ExprType](expr TypedTableExpr[T, S], literal S) TypedTableExpr[T, WrappedPrimitive[bool]]
- func Geq[T Table, S ExprType](expr1 TypedTableExpr[T, S], expr2 TypedTableExpr[T, S]) TypedTableExpr[T, WrappedPrimitive[bool]]
- func GeqLit[T Table, S ExprType](expr TypedTableExpr[T, S], literal S) TypedTableExpr[T, WrappedPrimitive[bool]]
- func Gt[T Table, S ExprType](expr1 TypedTableExpr[T, S], expr2 TypedTableExpr[T, S]) TypedTableExpr[T, WrappedPrimitive[bool]]
- func GtLit[T Table, S ExprType](expr TypedTableExpr[T, S], literal S) TypedTableExpr[T, WrappedPrimitive[bool]]
- func In[T Table, S ExprType](expr1 TypedTableExpr[T, S], exprs ...TypedTableExpr[T, S]) TypedTableExpr[T, WrappedPrimitive[bool]]
- func InLit[T Table, S ExprType](expr TypedTableExpr[T, S], literals ...S) TypedTableExpr[T, WrappedPrimitive[bool]]
- func IsNotNull[T Table, S ExprType](expr TypedTableExpr[T, S]) TypedTableExpr[T, WrappedPrimitive[bool]]
- func IsNull[T Table, S ExprType](expr TypedTableExpr[T, S]) TypedTableExpr[T, WrappedPrimitive[bool]]
- func Leq[T Table, S ExprType](expr1 TypedTableExpr[T, S], expr2 TypedTableExpr[T, S]) TypedTableExpr[T, WrappedPrimitive[bool]]
- func LeqLit[T Table, S ExprType](expr TypedTableExpr[T, S], literal S) TypedTableExpr[T, WrappedPrimitive[bool]]
- func Lt[T Table, S ExprType](expr1 TypedTableExpr[T, S], expr2 TypedTableExpr[T, S]) TypedTableExpr[T, WrappedPrimitive[bool]]
- func LtLit[T Table, S ExprType](expr TypedTableExpr[T, S], literal S) TypedTableExpr[T, WrappedPrimitive[bool]]
- func Max[T Table, S ExprType](expr TypedTableExpr[T, S]) TypedTableExpr[T, S]
- func Min[T Table, S ExprType](expr TypedTableExpr[T, S]) TypedTableExpr[T, S]
- func Neq[T Table, S ExprType](expr1 TypedTableExpr[T, S], expr2 TypedTableExpr[T, S]) TypedTableExpr[T, WrappedPrimitive[bool]]
- func NeqLit[T Table, S ExprType](expr TypedTableExpr[T, S], literal S) TypedTableExpr[T, WrappedPrimitive[bool]]
- func Not[T Table](expr TypedTableExpr[T, WrappedPrimitive[bool]]) TypedTableExpr[T, WrappedPrimitive[bool]]
- func NotIn[T Table, S ExprType](expr1 TypedTableExpr[T, S], exprs ...TypedTableExpr[T, S]) TypedTableExpr[T, WrappedPrimitive[bool]]
- func NotInLit[T Table, S ExprType](expr TypedTableExpr[T, S], literals ...S) TypedTableExpr[T, WrappedPrimitive[bool]]
- func Or[T Table](expr1 TypedTableExpr[T, WrappedPrimitive[bool]], ...) TypedTableExpr[T, WrappedPrimitive[bool]]
- func Xor[T Table](expr1 TypedTableExpr[T, WrappedPrimitive[bool]], ...) TypedTableExpr[T, WrappedPrimitive[bool]]
- type UpdateContext
- func (c *UpdateContext[T]) Do(db DB) (rowsAffected int64, err error)
- func (c *UpdateContext[T]) DoCtx(ctx context.Context, db DB) (rowsAffected int64, err error)
- func (c *UpdateContext[T]) Limit(limit uint64) *UpdateContext[T]
- func (c *UpdateContext[T]) OrderBy(direction OrderDirection, expr TableExpr[T]) *UpdateContext[T]
- func (c *UpdateContext[T]) Set(assignExprs ...*TableAssignExpr[T]) (res *UpdateContext[T])
- func (c *UpdateContext[T]) Where(condition TypedTableExpr[T, WrappedPrimitive[bool]]) *UpdateContext[T]
- type WrappedPrimitive
Constants ¶
This section is empty.
Variables ¶
var ( ErrRecordNotFound = errors.New("record not found") ErrNullValue = errors.New("null value") )
Functions ¶
This section is empty.
Types ¶
type BasicTable ¶
type ColumnFieldExprTypePointer ¶ added in v1.1.1
type ColumnFieldExprTypePointer[T ExprType] interface { ColumnFieldExprType *T }
type DeleteContext ¶
type DeleteContext[T BasicTable] struct { *Context[T] // contains filtered or unexported fields }
func Delete ¶
func Delete[T BasicTable](table T) *DeleteContext[T]
func (*DeleteContext[T]) Limit ¶
func (c *DeleteContext[T]) Limit(limit uint64) *DeleteContext[T]
func (*DeleteContext[T]) OrderBy ¶
func (c *DeleteContext[T]) OrderBy(direction OrderDirection, expr TableExpr[T]) *DeleteContext[T]
func (*DeleteContext[T]) Where ¶
func (c *DeleteContext[T]) Where( condition TypedTableExpr[T, WrappedPrimitive[bool]], ) *DeleteContext[T]
type ExprPrimitive ¶
type ExprStruct ¶
type FindContext ¶ added in v1.1.1
type FindContext[S Table, T TuplePointer[U], U any] struct { *Context[S] // contains filtered or unexported fields }
func Find ¶ added in v1.1.1
func Find[T Table, S TuplePointer[U], U any](table T, tuple S) *FindContext[T, S, U]
func (*FindContext[S, T, U]) Distinct ¶ added in v1.1.1
func (c *FindContext[S, T, U]) Distinct() *FindContext[S, T, U]
func (*FindContext[S, T, U]) Get ¶ added in v1.1.1
func (c *FindContext[S, T, U]) Get(db DB) (T, error)
func (*FindContext[S, T, U]) GetAll ¶ added in v1.1.1
func (c *FindContext[S, T, U]) GetAll(db DB) ([]T, error)
func (*FindContext[S, T, U]) GetAllCtx ¶ added in v1.1.1
func (c *FindContext[S, T, U]) GetAllCtx(ctx context.Context, db DB) ([]T, error)
func (*FindContext[S, T, U]) GetCtx ¶ added in v1.1.1
func (c *FindContext[S, T, U]) GetCtx(ctx context.Context, db DB) (T, error)
func (*FindContext[S, T, U]) GroupBy ¶ added in v1.1.1
func (c *FindContext[S, T, U]) GroupBy(exprs ...TableExpr[S]) *FindContext[S, T, U]
func (*FindContext[S, T, U]) Having ¶ added in v1.1.1
func (c *FindContext[S, T, U]) Having( condition TypedTableExpr[S, WrappedPrimitive[bool]], ) *FindContext[S, T, U]
func (*FindContext[S, T, U]) Limit ¶ added in v1.1.1
func (c *FindContext[S, T, U]) Limit(limit uint64) *FindContext[S, T, U]
func (*FindContext[S, T, U]) Lock ¶ added in v1.1.1
func (c *FindContext[S, T, U]) Lock(lockType LockType) *FindContext[S, T, U]
func (*FindContext[S, T, U]) Offset ¶ added in v1.1.1
func (c *FindContext[S, T, U]) Offset(offset uint64) *FindContext[S, T, U]
func (*FindContext[S, T, U]) OrderBy ¶ added in v1.1.1
func (c *FindContext[S, T, U]) OrderBy(direction OrderDirection, expr TableExpr[S]) *FindContext[S, T, U]
func (*FindContext[S, T, U]) Where ¶ added in v1.1.1
func (c *FindContext[S, T, U]) Where( condition TypedTableExpr[S, WrappedPrimitive[bool]], ) *FindContext[S, T, U]
type InsertContext ¶
type InsertContext[T BasicTable] struct { *Context[T] // contains filtered or unexported fields }
func Insert ¶
func Insert[T BasicTable](table T) *InsertContext[T]
func (*InsertContext[T]) Fields ¶
func (c *InsertContext[T]) Fields(fields ...TableColumns[T]) *InsertContext[T]
func (*InsertContext[T]) Values ¶
func (c *InsertContext[T]) Values(tableBases ...T) *InsertContext[T]
type JoinedTable ¶
type JoinedTable interface { Table BaseTables() []BasicTable AddError(error) }
type PluckContext ¶
type PluckContext[T Table, S ExprType] struct { *Context[T] // contains filtered or unexported fields }
func Pluck ¶
func Pluck[T Table, S ExprType](table T, field TypedTableExpr[T, S]) *PluckContext[T, S]
func (*PluckContext[T, S]) Distinct ¶
func (c *PluckContext[T, S]) Distinct() *PluckContext[T, S]
func (*PluckContext[T, S]) Get ¶
func (c *PluckContext[T, S]) Get(db DB) (S, error)
func (*PluckContext[T, S]) GetAll ¶
func (c *PluckContext[T, S]) GetAll(db DB) ([]S, error)
func (*PluckContext[T, S]) GetAllCtx ¶
func (c *PluckContext[T, S]) GetAllCtx(ctx context.Context, db DB) ([]S, error)
func (*PluckContext[T, S]) GetCtx ¶
func (c *PluckContext[T, S]) GetCtx(ctx context.Context, db DB) (S, error)
func (*PluckContext[T, S]) GroupBy ¶
func (c *PluckContext[T, S]) GroupBy(exprs ...TableExpr[T]) *PluckContext[T, S]
func (*PluckContext[T, S]) Having ¶
func (c *PluckContext[T, S]) Having( condition TypedTableExpr[T, WrappedPrimitive[bool]], ) *PluckContext[T, S]
func (*PluckContext[T, S]) Limit ¶
func (c *PluckContext[T, S]) Limit(limit uint64) *PluckContext[T, S]
func (*PluckContext[T, S]) Lock ¶
func (c *PluckContext[T, S]) Lock(lockType LockType) *PluckContext[T, S]
func (*PluckContext[T, S]) Offset ¶
func (c *PluckContext[T, S]) Offset(offset uint64) *PluckContext[T, S]
func (*PluckContext[T, S]) OrderBy ¶
func (c *PluckContext[T, S]) OrderBy(direction OrderDirection, expr TableExpr[T]) *PluckContext[T, S]
func (*PluckContext[T, S]) Where ¶
func (c *PluckContext[T, S]) Where( condition TypedTableExpr[T, WrappedPrimitive[bool]], ) *PluckContext[T, S]
type SelectContext ¶
type SelectContext[S any, T TablePointer[S]] struct { *Context[T] // contains filtered or unexported fields }
func Select ¶
func Select[S any, T TablePointer[S]](table T) *SelectContext[S, T]
func (*SelectContext[S, T]) Distinct ¶
func (c *SelectContext[S, T]) Distinct() *SelectContext[S, T]
func (*SelectContext[S, T]) Fields ¶
func (c *SelectContext[S, T]) Fields(fields ...TableColumns[T]) *SelectContext[S, T]
func (*SelectContext[S, T]) Get ¶
func (c *SelectContext[S, T]) Get(db DB) (T, error)
func (*SelectContext[S, T]) GetAll ¶
func (c *SelectContext[S, T]) GetAll(db DB) ([]T, error)
func (*SelectContext[S, T]) GetAllCtx ¶
func (c *SelectContext[S, T]) GetAllCtx(ctx context.Context, db DB) ([]T, error)
func (*SelectContext[S, T]) GetCtx ¶
func (c *SelectContext[S, T]) GetCtx(ctx context.Context, db DB) (T, error)
func (*SelectContext[S, T]) GroupBy ¶
func (c *SelectContext[S, T]) GroupBy(exprs ...TableExpr[T]) *SelectContext[S, T]
func (*SelectContext[S, T]) Having ¶
func (c *SelectContext[S, T]) Having( condition TypedTableExpr[T, WrappedPrimitive[bool]], ) *SelectContext[S, T]
func (*SelectContext[S, T]) Limit ¶
func (c *SelectContext[S, T]) Limit(limit uint64) *SelectContext[S, T]
func (*SelectContext[S, T]) Lock ¶
func (c *SelectContext[S, T]) Lock(lockType LockType) *SelectContext[S, T]
func (*SelectContext[S, T]) Offset ¶
func (c *SelectContext[S, T]) Offset(offset uint64) *SelectContext[S, T]
func (*SelectContext[S, T]) OrderBy ¶
func (c *SelectContext[S, T]) OrderBy(direction OrderDirection, expr TableExpr[T]) *SelectContext[S, T]
func (*SelectContext[S, T]) Where ¶
func (c *SelectContext[S, T]) Where( condition TypedTableExpr[T, WrappedPrimitive[bool]], ) *SelectContext[S, T]
type Table ¶
type Table interface { Expr Columns() []Column // ColumnMap key: table_name.column_name ColumnMap() map[string]ColumnFieldExprType GetErrors() []error }
type TableAssignExpr ¶
type TableAssignExpr[T Table] struct { // contains filtered or unexported fields }
func Assign ¶
func Assign[T Table, S ExprType]( expr1 TypedTableColumns[T, S], expr2 TypedTableExpr[T, S], ) *TableAssignExpr[T]
Assign expr1 = expr2
func AssignLit ¶
func AssignLit[T Table, S ExprType]( expr TypedTableColumns[T, S], literal S, ) *TableAssignExpr[T]
AssignLit expr = literal
func (*TableAssignExpr[_]) AssignExpr ¶
func (tae *TableAssignExpr[_]) AssignExpr() (string, []ExprType, []error)
type TableColumns ¶
type TablePointer ¶ added in v1.1.1
type Tuple ¶ added in v1.1.1
type Tuple interface { Exprs() []Expr Columns() []ColumnFieldExprType }
type Tuple2Struct ¶ added in v1.1.1
type Tuple2Struct[ S Table, T1 ExprType, U1 ColumnFieldExprTypePointer[T1], T2 ExprType, U2 ColumnFieldExprTypePointer[T2], ] struct { // contains filtered or unexported fields }
func Tuple2 ¶ added in v1.1.1
func Tuple2[ S Table, T1 ExprType, U1 ColumnFieldExprTypePointer[T1], T2 ExprType, U2 ColumnFieldExprTypePointer[T2], ](expr1 TypedTableExpr[S, T1], expr2 TypedTableExpr[S, T2]) *Tuple2Struct[S, T1, U1, T2, U2]
func (*Tuple2Struct[_, _, U1, _, U2]) Columns ¶ added in v1.1.1
func (t *Tuple2Struct[_, _, U1, _, U2]) Columns() []ColumnFieldExprType
func (*Tuple2Struct[_, _, _, _, _]) Exprs ¶ added in v1.1.1
func (t *Tuple2Struct[_, _, _, _, _]) Exprs() []Expr
func (*Tuple2Struct[_, T1, _, T2, _]) Values ¶ added in v1.1.1
func (t *Tuple2Struct[_, T1, _, T2, _]) Values() (T1, T2)
type Tuple3Struct ¶ added in v1.1.1
type Tuple3Struct[ S Table, T1 ExprType, U1 ColumnFieldExprTypePointer[T1], T2 ExprType, U2 ColumnFieldExprTypePointer[T2], T3 ExprType, U3 ColumnFieldExprTypePointer[T3], ] struct { // contains filtered or unexported fields }
func Tuple3 ¶ added in v1.1.1
func Tuple3[ S Table, T1 ExprType, U1 ColumnFieldExprTypePointer[T1], T2 ExprType, U2 ColumnFieldExprTypePointer[T2], T3 ExprType, U3 ColumnFieldExprTypePointer[T3], ](expr1 TypedTableExpr[S, T1], expr2 TypedTableExpr[S, T2], expr3 TypedTableExpr[S, T3]) *Tuple3Struct[S, T1, U1, T2, U2, T3, U3]
func (*Tuple3Struct[_, _, U1, _, U2, _, U3]) Columns ¶ added in v1.1.1
func (t *Tuple3Struct[_, _, U1, _, U2, _, U3]) Columns() []ColumnFieldExprType
func (*Tuple3Struct[_, _, _, _, _, _, _]) Exprs ¶ added in v1.1.1
func (t *Tuple3Struct[_, _, _, _, _, _, _]) Exprs() []Expr
func (*Tuple3Struct[_, T1, _, T2, _, T3, _]) Values ¶ added in v1.1.1
func (t *Tuple3Struct[_, T1, _, T2, _, T3, _]) Values() (T1, T2, T3)
type Tuple4Struct ¶ added in v1.1.1
type Tuple4Struct[ S Table, T1 ExprType, U1 ColumnFieldExprTypePointer[T1], T2 ExprType, U2 ColumnFieldExprTypePointer[T2], T3 ExprType, U3 ColumnFieldExprTypePointer[T3], T4 ExprType, U4 ColumnFieldExprTypePointer[T4], ] struct { // contains filtered or unexported fields }
func Tuple4 ¶ added in v1.1.1
func Tuple4[ S Table, T1 ExprType, U1 ColumnFieldExprTypePointer[T1], T2 ExprType, U2 ColumnFieldExprTypePointer[T2], T3 ExprType, U3 ColumnFieldExprTypePointer[T3], T4 ExprType, U4 ColumnFieldExprTypePointer[T4], ](expr1 TypedTableExpr[S, T1], expr2 TypedTableExpr[S, T2], expr3 TypedTableExpr[S, T3], expr4 TypedTableExpr[S, T4]) *Tuple4Struct[S, T1, U1, T2, U2, T3, U3, T4, U4]
func (*Tuple4Struct[_, _, U1, _, U2, _, U3, _, U4]) Columns ¶ added in v1.1.1
func (t *Tuple4Struct[_, _, U1, _, U2, _, U3, _, U4]) Columns() []ColumnFieldExprType
func (*Tuple4Struct[_, _, _, _, _, _, _, _, _]) Exprs ¶ added in v1.1.1
func (t *Tuple4Struct[_, _, _, _, _, _, _, _, _]) Exprs() []Expr
func (*Tuple4Struct[_, T1, _, T2, _, T3, _, T4, _]) Values ¶ added in v1.1.1
func (t *Tuple4Struct[_, T1, _, T2, _, T3, _, T4, _]) Values() (T1, T2, T3, T4)
type Tuple5Struct ¶ added in v1.1.1
type Tuple5Struct[ S Table, T1 ExprType, U1 ColumnFieldExprTypePointer[T1], T2 ExprType, U2 ColumnFieldExprTypePointer[T2], T3 ExprType, U3 ColumnFieldExprTypePointer[T3], T4 ExprType, U4 ColumnFieldExprTypePointer[T4], T5 ExprType, U5 ColumnFieldExprTypePointer[T5], ] struct { // contains filtered or unexported fields }
func Tuple5 ¶ added in v1.1.1
func Tuple5[ S Table, T1 ExprType, U1 ColumnFieldExprTypePointer[T1], T2 ExprType, U2 ColumnFieldExprTypePointer[T2], T3 ExprType, U3 ColumnFieldExprTypePointer[T3], T4 ExprType, U4 ColumnFieldExprTypePointer[T4], T5 ExprType, U5 ColumnFieldExprTypePointer[T5], ](expr1 TypedTableExpr[S, T1], expr2 TypedTableExpr[S, T2], expr3 TypedTableExpr[S, T3], expr4 TypedTableExpr[S, T4], expr5 TypedTableExpr[S, T5]) *Tuple5Struct[S, T1, U1, T2, U2, T3, U3, T4, U4, T5, U5]
func (*Tuple5Struct[_, _, U1, _, U2, _, U3, _, U4, _, U5]) Columns ¶ added in v1.1.1
func (t *Tuple5Struct[_, _, U1, _, U2, _, U3, _, U4, _, U5]) Columns() []ColumnFieldExprType
func (*Tuple5Struct[_, _, _, _, _, _, _, _, _, _, _]) Exprs ¶ added in v1.1.1
func (t *Tuple5Struct[_, _, _, _, _, _, _, _, _, _, _]) Exprs() []Expr
func (*Tuple5Struct[_, T1, _, T2, _, T3, _, T4, _, T5, _]) Values ¶ added in v1.1.1
func (t *Tuple5Struct[_, T1, _, T2, _, T3, _, T4, _, T5, _]) Values() (T1, T2, T3, T4, T5)
type TuplePointer ¶ added in v1.1.1
type TuplePointer[T any] interface { Exprs() []Expr Columns() []ColumnFieldExprType *T }
type TypedColumns ¶
type TypedTableColumns ¶
type TypedTableColumns[T Table, S ExprType] interface { TableColumns[T] TypedColumns[S] }
type TypedTableExpr ¶
func And ¶
func And[T Table]( expr1 TypedTableExpr[T, WrappedPrimitive[bool]], expr2 TypedTableExpr[T, WrappedPrimitive[bool]], ) TypedTableExpr[T, WrappedPrimitive[bool]]
And (expr1 AND expr2)
func Avg ¶
func Avg[T Table, S ExprType](expr TypedTableExpr[T, S], distinct bool) TypedTableExpr[T, WrappedPrimitive[float64]]
Avg if (distinct) {return AVG(DISTINCT expr)} else {return AVG(expr)}
func Count ¶
func Count[T Table, S ExprType](expr TypedTableExpr[T, S], distinct bool) TypedTableExpr[T, WrappedPrimitive[int64]]
Count if (distinct) {return COUNT(DISTINCT expr)} else {return COUNT(expr)}
func Eq ¶
func Eq[T Table, S ExprType]( expr1 TypedTableExpr[T, S], expr2 TypedTableExpr[T, S], ) TypedTableExpr[T, WrappedPrimitive[bool]]
Eq (expr1 = expr2)
func EqLit ¶
func EqLit[T Table, S ExprType]( expr TypedTableExpr[T, S], literal S, ) TypedTableExpr[T, WrappedPrimitive[bool]]
EqLit (expr = literal)
func Geq ¶
func Geq[T Table, S ExprType]( expr1 TypedTableExpr[T, S], expr2 TypedTableExpr[T, S], ) TypedTableExpr[T, WrappedPrimitive[bool]]
Geq (expr1 >= expr2)
func GeqLit ¶
func GeqLit[T Table, S ExprType]( expr TypedTableExpr[T, S], literal S, ) TypedTableExpr[T, WrappedPrimitive[bool]]
GeqLit (expr >= literal)
func Gt ¶
func Gt[T Table, S ExprType]( expr1 TypedTableExpr[T, S], expr2 TypedTableExpr[T, S], ) TypedTableExpr[T, WrappedPrimitive[bool]]
Gt (expr1 > expr2)
func GtLit ¶
func GtLit[T Table, S ExprType]( expr TypedTableExpr[T, S], literal S, ) TypedTableExpr[T, WrappedPrimitive[bool]]
GtLit (expr > literal)
func In ¶
func In[T Table, S ExprType]( expr1 TypedTableExpr[T, S], exprs ...TypedTableExpr[T, S], ) TypedTableExpr[T, WrappedPrimitive[bool]]
In (expr1 IN (exprs[0], exprs[1], ...))
func InLit ¶
func InLit[T Table, S ExprType]( expr TypedTableExpr[T, S], literals ...S, ) TypedTableExpr[T, WrappedPrimitive[bool]]
InLit (expr IN (literals[0], literal[1], ...))
func IsNotNull ¶
func IsNotNull[T Table, S ExprType]( expr TypedTableExpr[T, S], ) TypedTableExpr[T, WrappedPrimitive[bool]]
IsNotNull (expr IS NOT NULL)
func IsNull ¶
func IsNull[T Table, S ExprType]( expr TypedTableExpr[T, S], ) TypedTableExpr[T, WrappedPrimitive[bool]]
IsNull (expr IS NULL)
func Leq ¶
func Leq[T Table, S ExprType]( expr1 TypedTableExpr[T, S], expr2 TypedTableExpr[T, S], ) TypedTableExpr[T, WrappedPrimitive[bool]]
Leq (expr1 <= expr2)
func LeqLit ¶
func LeqLit[T Table, S ExprType]( expr TypedTableExpr[T, S], literal S, ) TypedTableExpr[T, WrappedPrimitive[bool]]
LeqLit (expr <= literal)
func Lt ¶
func Lt[T Table, S ExprType]( expr1 TypedTableExpr[T, S], expr2 TypedTableExpr[T, S], ) TypedTableExpr[T, WrappedPrimitive[bool]]
Lt (expr1 < expr2)
func LtLit ¶
func LtLit[T Table, S ExprType]( expr TypedTableExpr[T, S], literal S, ) TypedTableExpr[T, WrappedPrimitive[bool]]
LtLit (expr < literal)
func Max ¶
func Max[T Table, S ExprType](expr TypedTableExpr[T, S]) TypedTableExpr[T, S]
Max MAX(expr)
func Min ¶
func Min[T Table, S ExprType](expr TypedTableExpr[T, S]) TypedTableExpr[T, S]
Min MIN(expr)
func Neq ¶
func Neq[T Table, S ExprType]( expr1 TypedTableExpr[T, S], expr2 TypedTableExpr[T, S], ) TypedTableExpr[T, WrappedPrimitive[bool]]
Neq (expr1 != expr2)
func NeqLit ¶
func NeqLit[T Table, S ExprType]( expr TypedTableExpr[T, S], literal S, ) TypedTableExpr[T, WrappedPrimitive[bool]]
NeqLit (expr != literal)
func Not ¶
func Not[T Table]( expr TypedTableExpr[T, WrappedPrimitive[bool]], ) TypedTableExpr[T, WrappedPrimitive[bool]]
Not (NOT expr)
func NotIn ¶
func NotIn[T Table, S ExprType]( expr1 TypedTableExpr[T, S], exprs ...TypedTableExpr[T, S], ) TypedTableExpr[T, WrappedPrimitive[bool]]
NotIn (expr1 NOT IN (exprs[0], exprs[1], ...))
func NotInLit ¶
func NotInLit[T Table, S ExprType]( expr TypedTableExpr[T, S], literals ...S, ) TypedTableExpr[T, WrappedPrimitive[bool]]
NotInLit (expr NOT IN (literals[0], literal[1], ...))
func Or ¶
func Or[T Table]( expr1 TypedTableExpr[T, WrappedPrimitive[bool]], expr2 TypedTableExpr[T, WrappedPrimitive[bool]], ) TypedTableExpr[T, WrappedPrimitive[bool]]
Or (expr1 OR expr2)
func Xor ¶
func Xor[T Table]( expr1 TypedTableExpr[T, WrappedPrimitive[bool]], expr2 TypedTableExpr[T, WrappedPrimitive[bool]], ) TypedTableExpr[T, WrappedPrimitive[bool]]
Xor (expr1 XOR expr2)
type UpdateContext ¶
func Update ¶
func Update[T Table](table T) *UpdateContext[T]
func (*UpdateContext[T]) Limit ¶
func (c *UpdateContext[T]) Limit(limit uint64) *UpdateContext[T]
func (*UpdateContext[T]) OrderBy ¶
func (c *UpdateContext[T]) OrderBy(direction OrderDirection, expr TableExpr[T]) *UpdateContext[T]
func (*UpdateContext[T]) Set ¶
func (c *UpdateContext[T]) Set(assignExprs ...*TableAssignExpr[T]) (res *UpdateContext[T])
func (*UpdateContext[T]) Where ¶
func (c *UpdateContext[T]) Where( condition TypedTableExpr[T, WrappedPrimitive[bool]], ) *UpdateContext[T]
type WrappedPrimitive ¶
type WrappedPrimitive[T ExprPrimitive] struct { // contains filtered or unexported fields }
func Wrap ¶
func Wrap[T ExprPrimitive](val T) WrappedPrimitive[T]
func (*WrappedPrimitive[T]) Scan ¶
func (wp *WrappedPrimitive[T]) Scan(src any) error
func (WrappedPrimitive[T]) Val ¶
func (wp WrappedPrimitive[T]) Val() (T, bool)