Versions in this module Expand all Collapse all v0 v0.0.1 Dec 7, 2022 Changes in this version + var ErrNoRows = errs.ErrNoRows + func Columns(cs ...string) columns + type Aggregate struct + func Avg(c string) Aggregate + func Count(c string) Aggregate + func Max(c string) Aggregate + func Min(c string) Aggregate + func Sum(c string) Aggregate + func (a Aggregate) As(alias string) Selectable + func (a Aggregate) EQ(val interface{}) Predicate + func (a Aggregate) GT(val interface{}) Predicate + func (a Aggregate) GTEQ(val interface{}) Predicate + func (a Aggregate) LT(val interface{}) Predicate + func (a Aggregate) LTEQ(val interface{}) Predicate + func (a Aggregate) NEQ(val interface{}) Predicate + type Assignable interface + func AssignColumns(entity interface{}, ...) []Assignable + func AssignNotNilColumns(entity interface{}) []Assignable + func AssignNotZeroColumns(entity interface{}) []Assignable + type Assignment binaryExpr + func Assign(column string, value interface{}) Assignment + type Column struct + func C(c string) Column + func (c Column) Add(val interface{}) MathExpr + func (c Column) As(alias string) Selectable + func (c Column) EQ(val interface{}) Predicate + func (c Column) GT(val interface{}) Predicate + func (c Column) GTEQ(val interface{}) Predicate + func (c Column) In(data ...any) Predicate + func (c Column) LT(val interface{}) Predicate + func (c Column) LTEQ(val interface{}) Predicate + func (c Column) Like(val interface{}) Predicate + func (c Column) Multi(val interface{}) MathExpr + func (c Column) NEQ(val interface{}) Predicate + func (c Column) NotIn(data ...any) Predicate + func (c Column) NotLike(val interface{}) Predicate + type DB struct + func Open(driver string, dsn string, opts ...DBOption) (*DB, error) + func (db *DB) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error) + func (db *DB) Close() error + func (db *DB) Wait() error + type DBOption func(db *DB) + func UseReflection() DBOption + type Deleter struct + func NewDeleter(sess session) *Deleter[T] + func (d *Deleter[T]) Build() (*Query, error) + func (d *Deleter[T]) Exec(ctx context.Context) Result + func (d *Deleter[T]) From(table interface{}) *Deleter[T] + func (d *Deleter[T]) Where(predicates ...Predicate) *Deleter[T] + type Executor interface + Exec func(ctx context.Context) Result + type Expr interface + type Inserter struct + func NewInserter(sess session) *Inserter[T] + func (i *Inserter[T]) Build() (*Query, error) + func (i *Inserter[T]) Columns(cs ...string) *Inserter[T] + func (i *Inserter[T]) Exec(ctx context.Context) Result + func (i *Inserter[T]) Values(values ...*T) *Inserter[T] + type MathExpr binaryExpr + func (m MathExpr) Add(val interface{}) Expr + func (m MathExpr) Multi(val interface{}) MathExpr + type OrderBy struct + func ASC(fields ...string) OrderBy + func DESC(fields ...string) OrderBy + type Predicate binaryExpr + func Not(p Predicate) Predicate + func (p Predicate) And(pred Predicate) Predicate + func (p Predicate) Or(pred Predicate) Predicate + type Querier struct + func RawQuery(sess session, sql string, args ...any) Querier[T] + func (q Querier[T]) Exec(ctx context.Context) Result + func (q Querier[T]) Get(ctx context.Context) (*T, error) + func (q Querier[T]) GetMulti(ctx context.Context) ([]*T, error) + type Query struct + Args []any + SQL string + type QueryBuilder interface + Build func() (*Query, error) + type RawExpr struct + func Raw(expr string, args ...interface{}) RawExpr + func (r RawExpr) AsPredicate() Predicate + type Result struct + func (r Result) Err() error + func (r Result) LastInsertId() (int64, error) + func (r Result) RowsAffected() (int64, error) + type Selectable interface + type Selector struct + func NewSelector(sess session) *Selector[T] + func (s *Selector[T]) Build() (*Query, error) + func (s *Selector[T]) Distinct() *Selector[T] + func (s *Selector[T]) From(table interface{}) *Selector[T] + func (s *Selector[T]) Get(ctx context.Context) (*T, error) + func (s *Selector[T]) GetMulti(ctx context.Context) ([]*T, error) + func (s *Selector[T]) GroupBy(columns ...string) *Selector[T] + func (s *Selector[T]) Having(predicates ...Predicate) *Selector[T] + func (s *Selector[T]) Limit(limit int) *Selector[T] + func (s *Selector[T]) Offset(offset int) *Selector[T] + func (s *Selector[T]) OrderBy(orderBys ...OrderBy) *Selector[T] + func (s *Selector[T]) Select(columns ...Selectable) *Selector[T] + func (s *Selector[T]) Where(predicates ...Predicate) *Selector[T] + type Tx struct + func (t *Tx) Commit() error + func (t *Tx) Rollback() error + type Updater struct + func NewUpdater(sess session) *Updater[T] + func (u *Updater[T]) Build() (*Query, error) + func (u *Updater[T]) Exec(ctx context.Context) Result + func (u *Updater[T]) Set(assigns ...Assignable) *Updater[T] + func (u *Updater[T]) Update(val *T) *Updater[T] + func (u *Updater[T]) Where(predicates ...Predicate) *Updater[T]