Versions in this module Expand all Collapse all v0 v0.6.1 Feb 16, 2021 Changes in this version + func As(ident string, as string) string + func Asc(column string) string + func Avg(ident string) string + func Count(ident string) string + func Desc(column string) string + func Distinct(idents ...string) string + func Lower(ident string) string + func Max(ident string) string + func Min(ident string) string + func ScanInt(rows ColumnScanner) (int, error) + func ScanInt64(rows ColumnScanner) (int64, error) + func ScanOne(rows ColumnScanner, v interface{}) error + func ScanSlice(rows ColumnScanner, v interface{}) error + func ScanString(rows ColumnScanner) (string, error) + func ScanValue(rows ColumnScanner) (driver.Value, error) + func Sum(ident string) string + type Builder struct + func (b *Builder) AddError(err error) *Builder + func (b *Builder) Arg(a interface{}) *Builder + func (b *Builder) Args(a ...interface{}) *Builder + func (b *Builder) Comma() *Builder + func (b *Builder) Err() error + func (b *Builder) Ident(s string) *Builder + func (b *Builder) IdentComma(s ...string) *Builder + func (b *Builder) Join(qs ...Querier) *Builder + func (b *Builder) JoinComma(qs ...Querier) *Builder + func (b *Builder) Nested(f func(*Builder)) *Builder + func (b *Builder) Pad() *Builder + func (b *Builder) Quote(ident string) string + func (b *Builder) SetDialect(dialect string) + func (b *Builder) SetTotal(total int) + func (b *Builder) WriteByte(c byte) *Builder + func (b *Builder) WriteOp(op Op) *Builder + func (b *Builder) WriteString(s string) *Builder + func (b Builder) Dialect() string + func (b Builder) Query() (string, []interface{}) + func (b Builder) Total() int + type ColumnBuilder struct + func Column(name string) *ColumnBuilder + func (c *ColumnBuilder) Attr(attr string) *ColumnBuilder + func (c *ColumnBuilder) Check(check func(*Builder)) *ColumnBuilder + func (c *ColumnBuilder) Constraint(fk *ForeignKeyBuilder) *ColumnBuilder + func (c *ColumnBuilder) Query() (string, []interface{}) + func (c *ColumnBuilder) Type(t string) *ColumnBuilder + type ColumnScanner interface + Columns func() ([]string, error) + Err func() error + Next func() bool + Scan func(...interface{}) error + type Conn struct + func (c Conn) Exec(ctx context.Context, query string, args, v interface{}) error + func (c Conn) Query(ctx context.Context, query string, args, v interface{}) error + type DeleteBuilder struct + func Delete(table string) *DeleteBuilder + func (d *DeleteBuilder) FromSelect(s *Selector) *DeleteBuilder + func (d *DeleteBuilder) Query() (string, []interface{}) + func (d *DeleteBuilder) Schema(name string) *DeleteBuilder + func (d *DeleteBuilder) Where(p *Predicate) *DeleteBuilder + type DescribeBuilder struct + func Describe(name string) *DescribeBuilder + func (t *DescribeBuilder) Query() (string, []interface{}) + type DialectBuilder struct + func Dialect(name string) *DialectBuilder + func (d *DialectBuilder) AlterIndex(name string) *IndexAlter + func (d *DialectBuilder) AlterTable(name string) *TableAlter + func (d *DialectBuilder) Column(name string) *ColumnBuilder + func (d *DialectBuilder) CreateIndex(name string) *IndexBuilder + func (d *DialectBuilder) CreateTable(name string) *TableBuilder + func (d *DialectBuilder) Delete(table string) *DeleteBuilder + func (d *DialectBuilder) Describe(name string) *DescribeBuilder + func (d *DialectBuilder) DropIndex(name string) *DropIndexBuilder + func (d *DialectBuilder) Insert(table string) *InsertBuilder + func (d *DialectBuilder) Select(columns ...string) *Selector + func (d *DialectBuilder) Table(name string) *SelectTable + func (d *DialectBuilder) Update(table string) *UpdateBuilder + func (d *DialectBuilder) With(name string) *WithBuilder + type Driver struct + func Open(driver, source string) (*Driver, error) + func OpenDB(driver string, db *sql.DB) *Driver + func (d *Driver) BeginTx(ctx context.Context, opts *TxOptions) (dialect.Tx, error) + func (d *Driver) Close() error + func (d *Driver) Tx(ctx context.Context) (dialect.Tx, error) + func (d Driver) DB() *sql.DB + func (d Driver) Dialect() string + type DropIndexBuilder struct + func DropIndex(name string) *DropIndexBuilder + func (d *DropIndexBuilder) Query() (string, []interface{}) + func (d *DropIndexBuilder) Table(table string) *DropIndexBuilder + type ExecQuerier interface + ExecContext func(ctx context.Context, query string, args ...interface{}) (sql.Result, error) + QueryContext func(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error) + type ForeignKeyBuilder struct + func ForeignKey(symbol ...string) *ForeignKeyBuilder + func (fk *ForeignKeyBuilder) Columns(s ...string) *ForeignKeyBuilder + func (fk *ForeignKeyBuilder) OnDelete(action string) *ForeignKeyBuilder + func (fk *ForeignKeyBuilder) OnUpdate(action string) *ForeignKeyBuilder + func (fk *ForeignKeyBuilder) Query() (string, []interface{}) + func (fk *ForeignKeyBuilder) Reference(r *ReferenceBuilder) *ForeignKeyBuilder + func (fk *ForeignKeyBuilder) Symbol(s string) *ForeignKeyBuilder + type Func struct + func (f *Func) Append(fn func(*Builder)) *Func + func (f *Func) Avg(ident string) + func (f *Func) Count(ident string) + func (f *Func) Lower(ident string) + func (f *Func) Max(ident string) + func (f *Func) Min(ident string) + func (f *Func) String() string + func (f *Func) Sum(ident string) + type IndexAlter struct + Queries []Querier + func AlterIndex(name string) *IndexAlter + func (i *IndexAlter) Query() (string, []interface{}) + func (i *IndexAlter) Rename(name string) *IndexAlter + type IndexBuilder struct + func CreateIndex(name string) *IndexBuilder + func (i *IndexBuilder) Column(column string) *IndexBuilder + func (i *IndexBuilder) Columns(columns ...string) *IndexBuilder + func (i *IndexBuilder) Query() (string, []interface{}) + func (i *IndexBuilder) Table(table string) *IndexBuilder + func (i *IndexBuilder) Unique() *IndexBuilder + type InsertBuilder struct + func Insert(table string) *InsertBuilder + func (i *InsertBuilder) Columns(columns ...string) *InsertBuilder + func (i *InsertBuilder) Default() *InsertBuilder + func (i *InsertBuilder) Query() (string, []interface{}) + func (i *InsertBuilder) Returning(columns ...string) *InsertBuilder + func (i *InsertBuilder) Schema(name string) *InsertBuilder + func (i *InsertBuilder) Set(column string, v interface{}) *InsertBuilder + func (i *InsertBuilder) Values(values ...interface{}) *InsertBuilder + type NullBool = sql.NullBool + type NullFloat64 = sql.NullFloat64 + type NullInt64 = sql.NullInt64 + type NullString = sql.NullString + type NullTime = sql.NullTime + type Op int + const OpEQ + const OpGT + const OpGTE + const OpIn + const OpIsNull + const OpLT + const OpLTE + const OpLike + const OpNEQ + const OpNotIn + const OpNotNull + type Predicate struct + func And(preds ...*Predicate) *Predicate + func CompositeGT(columns []string, args ...interface{}) *Predicate + func CompositeLT(columns []string, args ...interface{}) *Predicate + func Contains(col, sub string) *Predicate + func ContainsFold(col, sub string) *Predicate + func EQ(col string, value interface{}) *Predicate + func EqualFold(col, sub string) *Predicate + func False() *Predicate + func GT(col string, value interface{}) *Predicate + func GTE(col string, value interface{}) *Predicate + func HasPrefix(col, prefix string) *Predicate + func HasSuffix(col, suffix string) *Predicate + func In(col string, args ...interface{}) *Predicate + func InInts(col string, args ...int) *Predicate + func InValues(col string, args ...driver.Value) *Predicate + func IsNull(col string) *Predicate + func LT(col string, value interface{}) *Predicate + func LTE(col string, value interface{}) *Predicate + func Like(col, pattern string) *Predicate + func NEQ(col string, value interface{}) *Predicate + func Not(pred *Predicate) *Predicate + func NotIn(col string, args ...interface{}) *Predicate + func NotNull(col string) *Predicate + func Or(preds ...*Predicate) *Predicate + func P(fns ...func(*Builder)) *Predicate + func (p *Predicate) Append(f func(*Builder)) *Predicate + func (p *Predicate) CompositeGT(columns []string, args ...interface{}) *Predicate + func (p *Predicate) CompositeLT(columns []string, args ...interface{}) *Predicate + func (p *Predicate) Contains(col, sub string) *Predicate + func (p *Predicate) ContainsFold(col, sub string) *Predicate + func (p *Predicate) EQ(col string, arg interface{}) *Predicate + func (p *Predicate) EqualFold(col, sub string) *Predicate + func (p *Predicate) False() *Predicate + func (p *Predicate) GT(col string, arg interface{}) *Predicate + func (p *Predicate) GTE(col string, arg interface{}) *Predicate + func (p *Predicate) HasPrefix(col, prefix string) *Predicate + func (p *Predicate) HasSuffix(col, suffix string) *Predicate + func (p *Predicate) In(col string, args ...interface{}) *Predicate + func (p *Predicate) InInts(col string, args ...int) *Predicate + func (p *Predicate) InValues(col string, args ...driver.Value) *Predicate + func (p *Predicate) IsNull(col string) *Predicate + func (p *Predicate) LT(col string, arg interface{}) *Predicate + func (p *Predicate) LTE(col string, arg interface{}) *Predicate + func (p *Predicate) Like(col, pattern string) *Predicate + func (p *Predicate) NEQ(col string, arg interface{}) *Predicate + func (p *Predicate) Not() *Predicate + func (p *Predicate) NotIn(col string, args ...interface{}) *Predicate + func (p *Predicate) NotNull(col string) *Predicate + func (p *Predicate) Query() (string, []interface{}) + type Querier interface + Query func() (string, []interface{}) + func Expr(exr string, args ...interface{}) Querier + func Raw(s string) Querier + type Queries []Querier + func (n Queries) Query() (string, []interface{}) + type ReferenceBuilder struct + func Reference() *ReferenceBuilder + func (r *ReferenceBuilder) Columns(s ...string) *ReferenceBuilder + func (r *ReferenceBuilder) Query() (string, []interface{}) + func (r *ReferenceBuilder) Table(s string) *ReferenceBuilder + type Result = sql.Result + type Rows struct + type SelectTable struct + func Table(name string) *SelectTable + func (s *SelectTable) As(alias string) *SelectTable + func (s *SelectTable) C(column string) string + func (s *SelectTable) Columns(columns ...string) []string + func (s *SelectTable) Schema(name string) *SelectTable + func (s *SelectTable) Unquote() *SelectTable + type Selector struct + func Select(columns ...string) *Selector + func (s *Selector) As(alias string) *Selector + func (s *Selector) C(column string) string + func (s *Selector) Clone() *Selector + func (s *Selector) Columns(columns ...string) []string + func (s *Selector) Context() context.Context + func (s *Selector) Count(columns ...string) *Selector + func (s *Selector) Distinct() *Selector + func (s *Selector) From(t TableView) *Selector + func (s *Selector) FromSelect(s2 *Selector) *Selector + func (s *Selector) GroupBy(columns ...string) *Selector + func (s *Selector) Having(p *Predicate) *Selector + func (s *Selector) Join(t TableView) *Selector + func (s *Selector) LeftJoin(t TableView) *Selector + func (s *Selector) Limit(limit int) *Selector + func (s *Selector) Not() *Selector + func (s *Selector) Offset(offset int) *Selector + func (s *Selector) On(c1, c2 string) *Selector + func (s *Selector) OnP(p *Predicate) *Selector + func (s *Selector) Or() *Selector + func (s *Selector) OrderBy(columns ...string) *Selector + func (s *Selector) OrderExpr(exprs ...Querier) *Selector + func (s *Selector) P() *Predicate + func (s *Selector) Query() (string, []interface{}) + func (s *Selector) RightJoin(t TableView) *Selector + func (s *Selector) Select(columns ...string) *Selector + func (s *Selector) SetDistinct(v bool) *Selector + func (s *Selector) SetP(p *Predicate) *Selector + func (s *Selector) Table() *SelectTable + func (s *Selector) Where(p *Predicate) *Selector + func (s *Selector) WithContext(ctx context.Context) *Selector + type TableAlter struct + Queries []Querier + func AlterTable(name string) *TableAlter + func (t *TableAlter) AddColumn(c *ColumnBuilder) *TableAlter + func (t *TableAlter) AddForeignKey(fk *ForeignKeyBuilder) *TableAlter + func (t *TableAlter) AddIndex(idx *IndexBuilder) *TableAlter + func (t *TableAlter) ChangeColumn(name string, c *ColumnBuilder) *TableAlter + func (t *TableAlter) DropColumn(c *ColumnBuilder) *TableAlter + func (t *TableAlter) DropConstraint(ident string) *TableAlter + func (t *TableAlter) DropForeignKey(ident string) *TableAlter + func (t *TableAlter) DropIndex(name string) *TableAlter + func (t *TableAlter) ModifyColumn(c *ColumnBuilder) *TableAlter + func (t *TableAlter) ModifyColumns(cs ...*ColumnBuilder) *TableAlter + func (t *TableAlter) Query() (string, []interface{}) + func (t *TableAlter) RenameColumn(old, new string) *TableAlter + func (t *TableAlter) RenameIndex(curr, new string) *TableAlter + type TableBuilder struct + func CreateTable(name string) *TableBuilder + func (t *TableBuilder) Charset(s string) *TableBuilder + func (t *TableBuilder) Collate(s string) *TableBuilder + func (t *TableBuilder) Column(c *ColumnBuilder) *TableBuilder + func (t *TableBuilder) Columns(columns ...*ColumnBuilder) *TableBuilder + func (t *TableBuilder) Constraints(fks ...*ForeignKeyBuilder) *TableBuilder + func (t *TableBuilder) ForeignKeys(fks ...*ForeignKeyBuilder) *TableBuilder + func (t *TableBuilder) IfNotExists() *TableBuilder + func (t *TableBuilder) Options(s string) *TableBuilder + func (t *TableBuilder) PrimaryKey(column ...string) *TableBuilder + func (t *TableBuilder) Query() (string, []interface{}) + type TableView interface + type Tx struct + type TxOptions = sql.TxOptions + type UpdateBuilder struct + func Update(table string) *UpdateBuilder + func (u *UpdateBuilder) Add(column string, v interface{}) *UpdateBuilder + func (u *UpdateBuilder) Empty() bool + func (u *UpdateBuilder) FromSelect(s *Selector) *UpdateBuilder + func (u *UpdateBuilder) Query() (string, []interface{}) + func (u *UpdateBuilder) Schema(name string) *UpdateBuilder + func (u *UpdateBuilder) Set(column string, v interface{}) *UpdateBuilder + func (u *UpdateBuilder) SetNull(column string) *UpdateBuilder + func (u *UpdateBuilder) Where(p *Predicate) *UpdateBuilder + type WithBuilder struct + func With(name string) *WithBuilder + func (w *WithBuilder) As(s *Selector) *WithBuilder + func (w *WithBuilder) Name() string + func (w *WithBuilder) Query() (string, []interface{}) + type Wrapper struct + func (w *Wrapper) Dialect() string + func (w *Wrapper) Query() (string, []interface{}) + func (w *Wrapper) SetDialect(name string) + func (w *Wrapper) SetTotal(total int) + func (w *Wrapper) Total() int