Documentation
¶
Index ¶
- Variables
- func All(v any) any
- func Any(v any) any
- func Arg(v any) any
- func NotArg(v any) any
- func Raw(v any) any
- type Cond
- type CondMode
- type DeleteStatement
- type Distinct
- type InsertStatement
- type Join
- type OnConflict
- type OrderBy
- type Result
- func (r *Result) Exec(f func(string, ...any) (sql.Result, error)) (sql.Result, error)
- func (r *Result) ExecContext(ctx context.Context, ...) (sql.Result, error)
- func (r *Result) ExecWith(ctx context.Context) (sql.Result, error)
- func (r *Result) IterWith(ctx context.Context, iter pgsql.Iterator) error
- func (r *Result) Query(f func(string, ...any) (*sql.Rows, error)) (*sql.Rows, error)
- func (r *Result) QueryContext(ctx context.Context, ...) (*sql.Rows, error)
- func (r *Result) QueryRow(f func(string, ...any) *sql.Row) *sql.Row
- func (r *Result) QueryRowContext(ctx context.Context, f func(context.Context, string, ...any) *sql.Row) *sql.Row
- func (r *Result) QueryRowWith(ctx context.Context) *sql.Row
- func (r *Result) QueryWith(ctx context.Context) (*sql.Rows, error)
- func (r *Result) SQL() (query string, args any)
- type SelectStatement
- type Set
- type UnionStatement
- type UpdateStatement
- type Values
Constants ¶
This section is empty.
Variables ¶
View Source
var Default any = defaultValue{}
Default use for insert default value
Functions ¶
Types ¶
type Cond ¶
type Cond interface { Op(field, op string, value any) OpRaw(field, op string, rawValue any) Eq(field string, value any) EqRaw(field string, rawValue any) Ne(field string, value any) NeRaw(field string, rawValue any) Lt(field string, value any) LtRaw(field string, rawValue any) Le(field string, value any) LeRaw(field string, rawValue any) Gt(field string, value any) GtRaw(field string, rawValue any) Ge(field string, value any) GeRaw(field string, rawValue any) Like(field string, value any) LikeRaw(field string, rawValue any) ILike(field string, value any) ILikeRaw(field string, rawValue any) In(field string, value ...any) InRaw(field string, value ...any) InSelect(field string, f func(b SelectStatement)) NotIn(field string, value ...any) NotInRaw(field string, value ...any) IsNull(field string) IsNotNull(field string) Raw(sql string) And(f func(b Cond)) Or(f func(b Cond)) Mode() CondMode }
Cond is the condition builder
type DeleteStatement ¶
type InsertStatement ¶
type InsertStatement interface { Into(table string) Columns(col ...string) OverridingSystemValue() OverridingUserValue() DefaultValues() Value(value ...any) Values(values ...any) Select(f func(b SelectStatement)) OnConflict(target ...string) OnConflict OnConflictOnConstraint(constraintName string) OnConflict Returning(col ...string) }
InsertStatement is the insert statement builder
type OnConflict ¶
type OnConflict interface { DoNothing() DoUpdate(f func(b UpdateStatement)) }
type Result ¶
type Result struct {
// contains filtered or unexported fields
}
func Union ¶ added in v0.11.0
func Union(f func(b UnionStatement)) *Result
func (*Result) ExecContext ¶
func (*Result) QueryContext ¶
func (*Result) QueryRowContext ¶
type SelectStatement ¶
type SelectStatement interface { Distinct() Distinct Columns(col ...any) ColumnSelect(f func(b SelectStatement), as string) From(table ...string) FromSelect(f func(b SelectStatement), as string) FromValues(f func(b Values), as string) Join(table string) Join InnerJoin(table string) Join FullOuterJoin(table string) Join LeftJoin(table string) Join RightJoin(table string) Join JoinSelect(f func(b SelectStatement), as string) Join InnerJoinSelect(f func(b SelectStatement), as string) Join FullOuterJoinSelect(f func(b SelectStatement), as string) Join LeftJoinSelect(f func(b SelectStatement), as string) Join RightJoinSelect(f func(b SelectStatement), as string) Join JoinLateralSelect(f func(b SelectStatement), as string) Join InnerJoinLateralSelect(f func(b SelectStatement), as string) Join FullOuterJoinLateralSelect(f func(b SelectStatement), as string) Join LeftJoinLateralSelect(f func(b SelectStatement), as string) Join RightJoinLateralSelect(f func(b SelectStatement), as string) Join JoinUnion(f func(b UnionStatement), as string) Join InnerJoinUnion(f func(b UnionStatement), as string) Join FullOuterJoinUnion(f func(b UnionStatement), as string) Join LeftJoinUnion(f func(b UnionStatement), as string) Join RightJoinUnion(f func(b UnionStatement), as string) Join Where(f func(b Cond)) GroupBy(col ...string) Having(f func(b Cond)) OrderBy(col string) OrderBy Limit(n int64) Offset(n int64) }
SelectStatement is the select statement builder
type Set ¶
type Set interface { To(value ...any) ToRaw(rawValue ...any) Select(f func(b SelectStatement)) }
type UnionStatement ¶ added in v0.11.0
type UnionStatement interface { Select(f func(b SelectStatement)) AllSelect(f func(b SelectStatement)) Union(f func(b UnionStatement)) AllUnion(f func(b UnionStatement)) OrderBy(col string) OrderBy Limit(n int64) Offset(n int64) }
type UpdateStatement ¶
type UpdateStatement interface { Table(table string) Set(col ...string) Set From(table ...string) Join(table string) Join InnerJoin(table string) Join FullOuterJoin(table string) Join LeftJoin(table string) Join RightJoin(table string) Join Where(f func(b Cond)) WhereCurrentOf(cursor string) Returning(col ...string) }
Click to show internal directories.
Click to hide internal directories.