Documentation ¶
Index ¶
- type AddColumnQuery
- func (q *AddColumnQuery) AppendArg(fmter schema.Formatter, b []byte, name string) ([]byte, bool)
- func (q *AddColumnQuery) AppendQuery(fmter schema.Formatter, b []byte) (_ []byte, err error)
- func (q *AddColumnQuery) ColumnExpr(query string, args ...interface{}) *AddColumnQuery
- func (q *AddColumnQuery) Conn(db DBI) *AddColumnQuery
- func (q *AddColumnQuery) DB() *DB
- func (q *AddColumnQuery) Exec(ctx context.Context, dest ...interface{}) (res sql.Result, err error)
- func (q *AddColumnQuery) Model(model interface{}) *AddColumnQuery
- func (q *AddColumnQuery) ModelTableExpr(query string, args ...interface{}) *AddColumnQuery
- func (q *AddColumnQuery) Table(tables ...string) *AddColumnQuery
- func (q *AddColumnQuery) TableExpr(query string, args ...interface{}) *AddColumnQuery
- type AfterCreateTableQueryHook
- type AfterDeleteHook
- type AfterDropTableQueryHook
- type AfterInsertHook
- type AfterScanHook
- type AfterSelectHook
- type AfterUpdateHook
- type BaseModel
- type BeforeCreateTableQueryHook
- type BeforeDeleteHook
- type BeforeDropTableQueryHook
- type BeforeInsertHook
- type BeforeScanHook
- type BeforeUpdateHook
- type Conn
- func (c Conn) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
- func (c Conn) NewAddColumn() *AddColumnQuery
- func (c Conn) NewCreateIndex() *CreateIndexQuery
- func (c Conn) NewCreateTable() *CreateTableQuery
- func (c Conn) NewDelete() *DeleteQuery
- func (c Conn) NewDropColumn() *DropColumnQuery
- func (c Conn) NewDropIndex() *DropIndexQuery
- func (c Conn) NewDropTable() *DropTableQuery
- func (c Conn) NewInsert() *InsertQuery
- func (c Conn) NewSelect() *SelectQuery
- func (c Conn) NewTruncateTable() *TruncateTableQuery
- func (c Conn) NewUpdate() *UpdateQuery
- func (c Conn) NewValues(model interface{}) *ValuesQuery
- func (c Conn) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
- func (c Conn) QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row
- type CreateIndexQuery
- func (q *CreateIndexQuery) AppendQuery(fmter schema.Formatter, b []byte) (_ []byte, err error)
- func (q *CreateIndexQuery) Column(columns ...string) *CreateIndexQuery
- func (q *CreateIndexQuery) ColumnExpr(query string, args ...interface{}) *CreateIndexQuery
- func (q *CreateIndexQuery) Concurrently() *CreateIndexQuery
- func (q *CreateIndexQuery) Conn(db DBI) *CreateIndexQuery
- func (q *CreateIndexQuery) ExcludeColumn(columns ...string) *CreateIndexQuery
- func (q *CreateIndexQuery) Exec(ctx context.Context, dest ...interface{}) (res sql.Result, err error)
- func (q *CreateIndexQuery) IfNotExists() *CreateIndexQuery
- func (q *CreateIndexQuery) Include(columns ...string) *CreateIndexQuery
- func (q *CreateIndexQuery) IncludeExpr(query string, args ...interface{}) *CreateIndexQuery
- func (q *CreateIndexQuery) Index(query string) *CreateIndexQuery
- func (q *CreateIndexQuery) IndexExpr(query string, args ...interface{}) *CreateIndexQuery
- func (q *CreateIndexQuery) Model(model interface{}) *CreateIndexQuery
- func (q *CreateIndexQuery) ModelTableExpr(query string, args ...interface{}) *CreateIndexQuery
- func (q *CreateIndexQuery) Table(tables ...string) *CreateIndexQuery
- func (q *CreateIndexQuery) TableExpr(query string, args ...interface{}) *CreateIndexQuery
- func (q *CreateIndexQuery) Unique() *CreateIndexQuery
- func (q *CreateIndexQuery) Using(query string, args ...interface{}) *CreateIndexQuery
- func (q *CreateIndexQuery) Where(query string, args ...interface{}) *CreateIndexQuery
- func (q *CreateIndexQuery) WhereGroup(sep string, fn func(*WhereQuery)) *CreateIndexQuery
- func (q *CreateIndexQuery) WhereOr(query string, args ...interface{}) *CreateIndexQuery
- type CreateTableQuery
- func (q *CreateTableQuery) AppendArg(fmter schema.Formatter, b []byte, name string) ([]byte, bool)
- func (q *CreateTableQuery) AppendQuery(fmter schema.Formatter, b []byte) (_ []byte, err error)
- func (q *CreateTableQuery) Conn(db DBI) *CreateTableQuery
- func (q *CreateTableQuery) DB() *DB
- func (q *CreateTableQuery) Exec(ctx context.Context, dest ...interface{}) (res sql.Result, _ error)
- func (q *CreateTableQuery) ForeignKey(query string, args ...interface{}) *CreateTableQuery
- func (q *CreateTableQuery) IfNotExists() *CreateTableQuery
- func (q *CreateTableQuery) Model(model interface{}) *CreateTableQuery
- func (q *CreateTableQuery) ModelTableExpr(query string, args ...interface{}) *CreateTableQuery
- func (q *CreateTableQuery) Table(tables ...string) *CreateTableQuery
- func (q *CreateTableQuery) TableExpr(query string, args ...interface{}) *CreateTableQuery
- func (q *CreateTableQuery) Temp() *CreateTableQuery
- func (q *CreateTableQuery) Varchar(n int) *CreateTableQuery
- type DB
- func (db *DB) AddQueryHook(hook QueryHook)
- func (db *DB) Begin() (Tx, error)
- func (db *DB) BeginTx(ctx context.Context, opts *sql.TxOptions) (Tx, error)
- func (db *DB) Conn(ctx context.Context) (Conn, error)
- func (db *DB) DBStats() DBStats
- func (db *DB) Dialect() schema.Dialect
- func (db *DB) Exec(query string, args ...interface{}) (sql.Result, error)
- func (db *DB) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
- func (db *DB) Formatter() schema.Formatter
- func (db *DB) NamedArg(name string) interface{}
- func (db *DB) NewAddColumn() *AddColumnQuery
- func (db *DB) NewCreateIndex() *CreateIndexQuery
- func (db *DB) NewCreateTable() *CreateTableQuery
- func (db *DB) NewDelete() *DeleteQuery
- func (db *DB) NewDropColumn() *DropColumnQuery
- func (db *DB) NewDropIndex() *DropIndexQuery
- func (db *DB) NewDropTable() *DropTableQuery
- func (db *DB) NewInsert() *InsertQuery
- func (db *DB) NewSelect() *SelectQuery
- func (db *DB) NewTruncateTable() *TruncateTableQuery
- func (db *DB) NewUpdate() *UpdateQuery
- func (db *DB) NewValues(model interface{}) *ValuesQuery
- func (db *DB) Prepare(query string) (Stmt, error)
- func (db *DB) PrepareContext(ctx context.Context, query string) (Stmt, error)
- func (db *DB) Query(query string, args ...interface{}) (*sql.Rows, error)
- func (db *DB) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
- func (db *DB) QueryRow(query string, args ...interface{}) *sql.Row
- func (db *DB) QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row
- func (db *DB) RegisterModel(models ...interface{})
- func (db *DB) ResetModel(ctx context.Context, models ...interface{}) error
- func (db *DB) ScanRow(ctx context.Context, rows *sql.Rows, dest ...interface{}) error
- func (db *DB) ScanRows(ctx context.Context, rows *sql.Rows, dest ...interface{}) error
- func (db *DB) Table(typ reflect.Type) *schema.Table
- func (db *DB) WithNamedArg(name string, value interface{}) *DB
- type DBI
- type DBOption
- type DBStats
- type DeleteQuery
- func (q *DeleteQuery) AppendQuery(fmter schema.Formatter, b []byte) (_ []byte, err error)
- func (q *DeleteQuery) Apply(fn func(*DeleteQuery) *DeleteQuery) *DeleteQuery
- func (q *DeleteQuery) Conn(db DBI) *DeleteQuery
- func (q *DeleteQuery) Exec(ctx context.Context, dest ...interface{}) (res sql.Result, _ error)
- func (q *DeleteQuery) ForceDelete(ctx context.Context, dest ...interface{}) (sql.Result, error)
- func (q *DeleteQuery) Model(model interface{}) *DeleteQuery
- func (q *DeleteQuery) ModelTableExpr(query string, args ...interface{}) *DeleteQuery
- func (q *DeleteQuery) Returning(query string, args ...interface{}) *DeleteQuery
- func (q *DeleteQuery) Table(tables ...string) *DeleteQuery
- func (q *DeleteQuery) TableExpr(query string, args ...interface{}) *DeleteQuery
- func (q *DeleteQuery) Where(query string, args ...interface{}) *DeleteQuery
- func (q *DeleteQuery) WhereAllWithDeleted() *DeleteQuery
- func (q *DeleteQuery) WhereDeleted() *DeleteQuery
- func (q *DeleteQuery) WhereGroup(sep string, fn func(*WhereQuery)) *DeleteQuery
- func (q *DeleteQuery) WhereOr(query string, args ...interface{}) *DeleteQuery
- func (q *DeleteQuery) WherePK() *DeleteQuery
- func (q *DeleteQuery) With(name string, query schema.QueryAppender) *DeleteQuery
- type DropColumnQuery
- func (q *DropColumnQuery) AppendArg(fmter schema.Formatter, b []byte, name string) ([]byte, bool)
- func (q *DropColumnQuery) AppendQuery(fmter schema.Formatter, b []byte) (_ []byte, err error)
- func (q *DropColumnQuery) Column(columns ...string) *DropColumnQuery
- func (q *DropColumnQuery) ColumnExpr(query string, args ...interface{}) *DropColumnQuery
- func (q *DropColumnQuery) Conn(db DBI) *DropColumnQuery
- func (q *DropColumnQuery) DB() *DB
- func (q *DropColumnQuery) Exec(ctx context.Context, dest ...interface{}) (res sql.Result, err error)
- func (q *DropColumnQuery) Model(model interface{}) *DropColumnQuery
- func (q *DropColumnQuery) ModelTableExpr(query string, args ...interface{}) *DropColumnQuery
- func (q *DropColumnQuery) Table(tables ...string) *DropColumnQuery
- func (q *DropColumnQuery) TableExpr(query string, args ...interface{}) *DropColumnQuery
- type DropIndexQuery
- func (q *DropIndexQuery) AppendArg(fmter schema.Formatter, b []byte, name string) ([]byte, bool)
- func (q *DropIndexQuery) AppendQuery(fmter schema.Formatter, b []byte) (_ []byte, err error)
- func (q *DropIndexQuery) Concurrently() *DropIndexQuery
- func (q *DropIndexQuery) Conn(db DBI) *DropIndexQuery
- func (q *DropIndexQuery) DB() *DB
- func (q *DropIndexQuery) Exec(ctx context.Context, dest ...interface{}) (res sql.Result, err error)
- func (q *DropIndexQuery) IfExists() *DropIndexQuery
- func (q *DropIndexQuery) Index(query string, args ...interface{}) *DropIndexQuery
- func (q *DropIndexQuery) Model(model interface{}) *DropIndexQuery
- func (q *DropIndexQuery) Restrict() *DropIndexQuery
- type DropTableQuery
- func (q *DropTableQuery) AppendArg(fmter schema.Formatter, b []byte, name string) ([]byte, bool)
- func (q *DropTableQuery) AppendQuery(fmter schema.Formatter, b []byte) (_ []byte, err error)
- func (q *DropTableQuery) Conn(db DBI) *DropTableQuery
- func (q *DropTableQuery) DB() *DB
- func (q *DropTableQuery) Exec(ctx context.Context, dest ...interface{}) (res sql.Result, _ error)
- func (q *DropTableQuery) IfExists() *DropTableQuery
- func (q *DropTableQuery) Model(model interface{}) *DropTableQuery
- func (q *DropTableQuery) Restrict() *DropTableQuery
- func (q *DropTableQuery) Table(tables ...string) *DropTableQuery
- func (q *DropTableQuery) TableExpr(query string, args ...interface{}) *DropTableQuery
- type Ident
- type InValues
- type InsertQuery
- func (q *InsertQuery) AppendQuery(fmter schema.Formatter, b []byte) (_ []byte, err error)
- func (q *InsertQuery) Apply(fn func(*InsertQuery) *InsertQuery) *InsertQuery
- func (q *InsertQuery) Column(columns ...string) *InsertQuery
- func (q *InsertQuery) Conn(db DBI) *InsertQuery
- func (q *InsertQuery) Exec(ctx context.Context, dest ...interface{}) (sql.Result, error)
- func (q *InsertQuery) Ignore() *InsertQuery
- func (q *InsertQuery) Model(model interface{}) *InsertQuery
- func (q *InsertQuery) ModelTableExpr(query string, args ...interface{}) *InsertQuery
- func (q *InsertQuery) On(s string, args ...interface{}) *InsertQuery
- func (q *InsertQuery) Replace() *InsertQuery
- func (q *InsertQuery) Returning(query string, args ...interface{}) *InsertQuery
- func (q *InsertQuery) Set(query string, args ...interface{}) *InsertQuery
- func (q *InsertQuery) Table(tables ...string) *InsertQuery
- func (q *InsertQuery) TableExpr(query string, args ...interface{}) *InsertQuery
- func (q *InsertQuery) Value(column string, value string, args ...interface{}) *InsertQuery
- func (q *InsertQuery) Where(query string, args ...interface{}) *InsertQuery
- func (q *InsertQuery) WhereOr(query string, args ...interface{}) *InsertQuery
- func (q *InsertQuery) With(name string, query schema.QueryAppender) *InsertQuery
- type NullTime
- type QueryEvent
- type QueryHook
- type Safe
- type SelectQuery
- func (q *SelectQuery) AppendQuery(fmter schema.Formatter, b []byte) (_ []byte, err error)
- func (q *SelectQuery) Apply(fn func(*SelectQuery) *SelectQuery) *SelectQuery
- func (q *SelectQuery) Column(columns ...string) *SelectQuery
- func (q *SelectQuery) ColumnExpr(query string, args ...interface{}) *SelectQuery
- func (q *SelectQuery) Conn(db DBI) *SelectQuery
- func (q *SelectQuery) Count(ctx context.Context) (int, error)
- func (q *SelectQuery) Distinct() *SelectQuery
- func (q *SelectQuery) DistinctOn(query string, args ...interface{}) *SelectQuery
- func (q *SelectQuery) Except(other *SelectQuery) *SelectQuery
- func (q *SelectQuery) ExceptAll(other *SelectQuery) *SelectQuery
- func (q *SelectQuery) ExcludeColumn(columns ...string) *SelectQuery
- func (q *SelectQuery) Exec(ctx context.Context, dest ...interface{}) (res sql.Result, err error)
- func (q *SelectQuery) For(s string, args ...interface{}) *SelectQuery
- func (q *SelectQuery) Group(columns ...string) *SelectQuery
- func (q *SelectQuery) GroupExpr(group string, args ...interface{}) *SelectQuery
- func (q *SelectQuery) Having(having string, args ...interface{}) *SelectQuery
- func (q *SelectQuery) Intersect(other *SelectQuery) *SelectQuery
- func (q *SelectQuery) IntersectAll(other *SelectQuery) *SelectQuery
- func (q *SelectQuery) Join(join string, args ...interface{}) *SelectQuery
- func (q *SelectQuery) JoinOn(cond string, args ...interface{}) *SelectQuery
- func (q *SelectQuery) JoinOnOr(cond string, args ...interface{}) *SelectQuery
- func (q *SelectQuery) Limit(n int) *SelectQuery
- func (q *SelectQuery) Model(model interface{}) *SelectQuery
- func (q *SelectQuery) ModelTableExpr(query string, args ...interface{}) *SelectQuery
- func (q *SelectQuery) Offset(n int) *SelectQuery
- func (q *SelectQuery) Order(orders ...string) *SelectQuery
- func (q *SelectQuery) OrderExpr(query string, args ...interface{}) *SelectQuery
- func (q *SelectQuery) Relation(name string, apply ...func(*SelectQuery) *SelectQuery) *SelectQuery
- func (q *SelectQuery) Rows(ctx context.Context) (*sql.Rows, error)
- func (q *SelectQuery) Scan(ctx context.Context, dest ...interface{}) error
- func (q *SelectQuery) ScanAndCount(ctx context.Context, dest ...interface{}) (int, error)
- func (q *SelectQuery) Table(tables ...string) *SelectQuery
- func (q *SelectQuery) TableExpr(query string, args ...interface{}) *SelectQuery
- func (q *SelectQuery) Union(other *SelectQuery) *SelectQuery
- func (q *SelectQuery) UnionAll(other *SelectQuery) *SelectQuery
- func (q *SelectQuery) Where(query string, args ...interface{}) *SelectQuery
- func (q *SelectQuery) WhereAllWithDeleted() *SelectQuery
- func (q *SelectQuery) WhereDeleted() *SelectQuery
- func (q *SelectQuery) WhereGroup(sep string, fn func(*WhereQuery)) *SelectQuery
- func (q *SelectQuery) WhereOr(query string, args ...interface{}) *SelectQuery
- func (q *SelectQuery) WherePK() *SelectQuery
- func (q *SelectQuery) With(name string, query schema.QueryAppender) *SelectQuery
- type Stmt
- type TruncateTableQuery
- func (q *TruncateTableQuery) AppendArg(fmter schema.Formatter, b []byte, name string) ([]byte, bool)
- func (q *TruncateTableQuery) AppendQuery(fmter schema.Formatter, b []byte) (_ []byte, err error)
- func (q *TruncateTableQuery) Conn(db DBI) *TruncateTableQuery
- func (q *TruncateTableQuery) ContinueIdentity() *TruncateTableQuery
- func (q *TruncateTableQuery) DB() *DB
- func (q *TruncateTableQuery) Exec(ctx context.Context, dest ...interface{}) (res sql.Result, _ error)
- func (q *TruncateTableQuery) Model(model interface{}) *TruncateTableQuery
- func (q *TruncateTableQuery) Restrict() *TruncateTableQuery
- func (q *TruncateTableQuery) Table(tables ...string) *TruncateTableQuery
- func (q *TruncateTableQuery) TableExpr(query string, args ...interface{}) *TruncateTableQuery
- type Tx
- func (tx Tx) Exec(query string, args ...interface{}) (sql.Result, error)
- func (tx Tx) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
- func (tx Tx) NewAddColumn() *AddColumnQuery
- func (tx Tx) NewCreateIndex() *CreateIndexQuery
- func (tx Tx) NewCreateTable() *CreateTableQuery
- func (tx Tx) NewDelete() *DeleteQuery
- func (tx Tx) NewDropColumn() *DropColumnQuery
- func (tx Tx) NewDropIndex() *DropIndexQuery
- func (tx Tx) NewDropTable() *DropTableQuery
- func (tx Tx) NewInsert() *InsertQuery
- func (tx Tx) NewSelect() *SelectQuery
- func (tx Tx) NewTruncateTable() *TruncateTableQuery
- func (tx Tx) NewUpdate() *UpdateQuery
- func (tx Tx) NewValues(model interface{}) *ValuesQuery
- func (tx Tx) Query(query string, args ...interface{}) (*sql.Rows, error)
- func (tx Tx) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
- func (tx Tx) QueryRow(query string, args ...interface{}) *sql.Row
- func (tx Tx) QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row
- type UpdateQuery
- func (q *UpdateQuery) AppendQuery(fmter schema.Formatter, b []byte) (_ []byte, err error)
- func (q *UpdateQuery) Apply(fn func(*UpdateQuery) *UpdateQuery) *UpdateQuery
- func (q *UpdateQuery) Column(columns ...string) *UpdateQuery
- func (q *UpdateQuery) Conn(db DBI) *UpdateQuery
- func (q *UpdateQuery) Exec(ctx context.Context, dest ...interface{}) (sql.Result, error)
- func (q *UpdateQuery) FQN(name string) Ident
- func (q *UpdateQuery) Model(model interface{}) *UpdateQuery
- func (q *UpdateQuery) ModelTableExpr(query string, args ...interface{}) *UpdateQuery
- func (q *UpdateQuery) Returning(query string, args ...interface{}) *UpdateQuery
- func (q *UpdateQuery) Set(query string, args ...interface{}) *UpdateQuery
- func (q *UpdateQuery) Table(tables ...string) *UpdateQuery
- func (q *UpdateQuery) TableExpr(query string, args ...interface{}) *UpdateQuery
- func (q *UpdateQuery) Value(column string, value string, args ...interface{}) *UpdateQuery
- func (q *UpdateQuery) Where(query string, args ...interface{}) *UpdateQuery
- func (q *UpdateQuery) WhereAllWithDeleted() *UpdateQuery
- func (q *UpdateQuery) WhereDeleted() *UpdateQuery
- func (q *UpdateQuery) WhereGroup(sep string, fn func(*WhereQuery)) *UpdateQuery
- func (q *UpdateQuery) WhereOr(query string, args ...interface{}) *UpdateQuery
- func (q *UpdateQuery) WherePK() *UpdateQuery
- func (q *UpdateQuery) With(name string, query schema.QueryAppender) *UpdateQuery
- type ValuesQuery
- func (q *ValuesQuery) AppendArg(fmter schema.Formatter, b []byte, name string) ([]byte, bool)
- func (q *ValuesQuery) AppendColumns(fmter schema.Formatter, b []byte) (_ []byte, err error)
- func (q *ValuesQuery) AppendQuery(fmter schema.Formatter, b []byte) (_ []byte, err error)
- func (q *ValuesQuery) Conn(db DBI) *ValuesQuery
- func (q *ValuesQuery) DB() *DB
- func (q *ValuesQuery) WithOrder() *ValuesQuery
- type WhereQuery
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddColumnQuery ¶
type AddColumnQuery struct {
// contains filtered or unexported fields
}
func NewAddColumnQuery ¶
func NewAddColumnQuery(db *DB) *AddColumnQuery
func (*AddColumnQuery) AppendQuery ¶
func (*AddColumnQuery) ColumnExpr ¶
func (q *AddColumnQuery) ColumnExpr(query string, args ...interface{}) *AddColumnQuery
func (*AddColumnQuery) Conn ¶ added in v0.1.14
func (q *AddColumnQuery) Conn(db DBI) *AddColumnQuery
func (*AddColumnQuery) Model ¶
func (q *AddColumnQuery) Model(model interface{}) *AddColumnQuery
func (*AddColumnQuery) ModelTableExpr ¶
func (q *AddColumnQuery) ModelTableExpr(query string, args ...interface{}) *AddColumnQuery
func (*AddColumnQuery) Table ¶
func (q *AddColumnQuery) Table(tables ...string) *AddColumnQuery
func (*AddColumnQuery) TableExpr ¶
func (q *AddColumnQuery) TableExpr(query string, args ...interface{}) *AddColumnQuery
type AfterCreateTableQueryHook ¶
type AfterCreateTableQueryHook interface {
AfterCreateTableQuery(ctx context.Context, query *CreateTableQuery) error
}
type AfterDeleteHook ¶
type AfterDeleteHook = schema.AfterDeleteHook
type AfterDropTableQueryHook ¶
type AfterDropTableQueryHook interface {
AfterDropTableQuery(ctx context.Context, query *DropTableQuery) error
}
type AfterInsertHook ¶
type AfterInsertHook = schema.AfterInsertHook
type AfterScanHook ¶
type AfterScanHook = schema.AfterScanHook
type AfterSelectHook ¶
type AfterSelectHook = schema.AfterSelectHook
type AfterUpdateHook ¶
type AfterUpdateHook = schema.AfterUpdateHook
type BeforeCreateTableQueryHook ¶
type BeforeCreateTableQueryHook interface {
BeforeCreateTableQuery(ctx context.Context, query *CreateTableQuery) error
}
type BeforeDeleteHook ¶
type BeforeDeleteHook = schema.BeforeDeleteHook
type BeforeDropTableQueryHook ¶
type BeforeDropTableQueryHook interface {
BeforeDropTableQuery(ctx context.Context, query *DropTableQuery) error
}
type BeforeInsertHook ¶
type BeforeInsertHook = schema.BeforeInsertHook
type BeforeScanHook ¶
type BeforeScanHook = schema.BeforeScanHook
type BeforeUpdateHook ¶
type BeforeUpdateHook = schema.BeforeUpdateHook
type Conn ¶
func (Conn) ExecContext ¶
func (Conn) NewAddColumn ¶ added in v0.1.12
func (c Conn) NewAddColumn() *AddColumnQuery
func (Conn) NewCreateIndex ¶ added in v0.1.12
func (c Conn) NewCreateIndex() *CreateIndexQuery
func (Conn) NewCreateTable ¶ added in v0.1.12
func (c Conn) NewCreateTable() *CreateTableQuery
func (Conn) NewDelete ¶ added in v0.1.12
func (c Conn) NewDelete() *DeleteQuery
func (Conn) NewDropColumn ¶ added in v0.1.12
func (c Conn) NewDropColumn() *DropColumnQuery
func (Conn) NewDropIndex ¶ added in v0.1.12
func (c Conn) NewDropIndex() *DropIndexQuery
func (Conn) NewDropTable ¶ added in v0.1.12
func (c Conn) NewDropTable() *DropTableQuery
func (Conn) NewInsert ¶ added in v0.1.12
func (c Conn) NewInsert() *InsertQuery
func (Conn) NewSelect ¶ added in v0.1.12
func (c Conn) NewSelect() *SelectQuery
func (Conn) NewTruncateTable ¶ added in v0.1.12
func (c Conn) NewTruncateTable() *TruncateTableQuery
func (Conn) NewUpdate ¶ added in v0.1.12
func (c Conn) NewUpdate() *UpdateQuery
func (Conn) NewValues ¶ added in v0.1.12
func (c Conn) NewValues(model interface{}) *ValuesQuery
func (Conn) QueryContext ¶
type CreateIndexQuery ¶
type CreateIndexQuery struct {
// contains filtered or unexported fields
}
func NewCreateIndexQuery ¶
func NewCreateIndexQuery(db *DB) *CreateIndexQuery
func (*CreateIndexQuery) AppendQuery ¶
func (*CreateIndexQuery) Column ¶
func (q *CreateIndexQuery) Column(columns ...string) *CreateIndexQuery
func (*CreateIndexQuery) ColumnExpr ¶
func (q *CreateIndexQuery) ColumnExpr(query string, args ...interface{}) *CreateIndexQuery
func (*CreateIndexQuery) Concurrently ¶
func (q *CreateIndexQuery) Concurrently() *CreateIndexQuery
func (*CreateIndexQuery) Conn ¶ added in v0.1.14
func (q *CreateIndexQuery) Conn(db DBI) *CreateIndexQuery
func (*CreateIndexQuery) ExcludeColumn ¶
func (q *CreateIndexQuery) ExcludeColumn(columns ...string) *CreateIndexQuery
func (*CreateIndexQuery) IfNotExists ¶
func (q *CreateIndexQuery) IfNotExists() *CreateIndexQuery
func (*CreateIndexQuery) Include ¶
func (q *CreateIndexQuery) Include(columns ...string) *CreateIndexQuery
func (*CreateIndexQuery) IncludeExpr ¶
func (q *CreateIndexQuery) IncludeExpr(query string, args ...interface{}) *CreateIndexQuery
func (*CreateIndexQuery) Index ¶
func (q *CreateIndexQuery) Index(query string) *CreateIndexQuery
func (*CreateIndexQuery) IndexExpr ¶
func (q *CreateIndexQuery) IndexExpr(query string, args ...interface{}) *CreateIndexQuery
func (*CreateIndexQuery) Model ¶
func (q *CreateIndexQuery) Model(model interface{}) *CreateIndexQuery
func (*CreateIndexQuery) ModelTableExpr ¶
func (q *CreateIndexQuery) ModelTableExpr(query string, args ...interface{}) *CreateIndexQuery
func (*CreateIndexQuery) Table ¶
func (q *CreateIndexQuery) Table(tables ...string) *CreateIndexQuery
func (*CreateIndexQuery) TableExpr ¶
func (q *CreateIndexQuery) TableExpr(query string, args ...interface{}) *CreateIndexQuery
func (*CreateIndexQuery) Unique ¶
func (q *CreateIndexQuery) Unique() *CreateIndexQuery
func (*CreateIndexQuery) Using ¶
func (q *CreateIndexQuery) Using(query string, args ...interface{}) *CreateIndexQuery
func (*CreateIndexQuery) Where ¶
func (q *CreateIndexQuery) Where(query string, args ...interface{}) *CreateIndexQuery
func (*CreateIndexQuery) WhereGroup ¶
func (q *CreateIndexQuery) WhereGroup(sep string, fn func(*WhereQuery)) *CreateIndexQuery
func (*CreateIndexQuery) WhereOr ¶
func (q *CreateIndexQuery) WhereOr(query string, args ...interface{}) *CreateIndexQuery
type CreateTableQuery ¶
type CreateTableQuery struct {
// contains filtered or unexported fields
}
func NewCreateTableQuery ¶
func NewCreateTableQuery(db *DB) *CreateTableQuery
func (*CreateTableQuery) AppendQuery ¶
func (*CreateTableQuery) Conn ¶ added in v0.1.14
func (q *CreateTableQuery) Conn(db DBI) *CreateTableQuery
func (*CreateTableQuery) ForeignKey ¶ added in v0.1.13
func (q *CreateTableQuery) ForeignKey(query string, args ...interface{}) *CreateTableQuery
func (*CreateTableQuery) IfNotExists ¶
func (q *CreateTableQuery) IfNotExists() *CreateTableQuery
func (*CreateTableQuery) Model ¶
func (q *CreateTableQuery) Model(model interface{}) *CreateTableQuery
func (*CreateTableQuery) ModelTableExpr ¶
func (q *CreateTableQuery) ModelTableExpr(query string, args ...interface{}) *CreateTableQuery
func (*CreateTableQuery) Table ¶
func (q *CreateTableQuery) Table(tables ...string) *CreateTableQuery
func (*CreateTableQuery) TableExpr ¶
func (q *CreateTableQuery) TableExpr(query string, args ...interface{}) *CreateTableQuery
func (*CreateTableQuery) Temp ¶
func (q *CreateTableQuery) Temp() *CreateTableQuery
func (*CreateTableQuery) Varchar ¶
func (q *CreateTableQuery) Varchar(n int) *CreateTableQuery
type DB ¶
func (*DB) AddQueryHook ¶
func (*DB) ExecContext ¶
func (*DB) NewAddColumn ¶
func (db *DB) NewAddColumn() *AddColumnQuery
func (*DB) NewCreateIndex ¶
func (db *DB) NewCreateIndex() *CreateIndexQuery
func (*DB) NewCreateTable ¶
func (db *DB) NewCreateTable() *CreateTableQuery
func (*DB) NewDelete ¶
func (db *DB) NewDelete() *DeleteQuery
func (*DB) NewDropColumn ¶
func (db *DB) NewDropColumn() *DropColumnQuery
func (*DB) NewDropIndex ¶
func (db *DB) NewDropIndex() *DropIndexQuery
func (*DB) NewDropTable ¶
func (db *DB) NewDropTable() *DropTableQuery
func (*DB) NewInsert ¶
func (db *DB) NewInsert() *InsertQuery
func (*DB) NewSelect ¶
func (db *DB) NewSelect() *SelectQuery
func (*DB) NewTruncateTable ¶
func (db *DB) NewTruncateTable() *TruncateTableQuery
func (*DB) NewUpdate ¶
func (db *DB) NewUpdate() *UpdateQuery
func (*DB) NewValues ¶
func (db *DB) NewValues(model interface{}) *ValuesQuery
func (*DB) PrepareContext ¶
func (*DB) QueryContext ¶
func (*DB) QueryRowContext ¶
func (*DB) RegisterModel ¶
func (db *DB) RegisterModel(models ...interface{})
func (*DB) ResetModel ¶ added in v0.1.6
func (*DB) WithNamedArg ¶
type DBOption ¶
type DBOption func(db *DB)
func WithDiscardUnknownColumns ¶ added in v0.1.3
func WithDiscardUnknownColumns() DBOption
type DeleteQuery ¶
type DeleteQuery struct {
// contains filtered or unexported fields
}
func NewDeleteQuery ¶
func NewDeleteQuery(db *DB) *DeleteQuery
func (*DeleteQuery) AppendQuery ¶
func (*DeleteQuery) Apply ¶
func (q *DeleteQuery) Apply(fn func(*DeleteQuery) *DeleteQuery) *DeleteQuery
Apply calls the fn passing the DeleteQuery as an argument.
func (*DeleteQuery) Conn ¶ added in v0.1.14
func (q *DeleteQuery) Conn(db DBI) *DeleteQuery
func (*DeleteQuery) ForceDelete ¶
func (*DeleteQuery) Model ¶
func (q *DeleteQuery) Model(model interface{}) *DeleteQuery
func (*DeleteQuery) ModelTableExpr ¶
func (q *DeleteQuery) ModelTableExpr(query string, args ...interface{}) *DeleteQuery
func (*DeleteQuery) Returning ¶
func (q *DeleteQuery) Returning(query string, args ...interface{}) *DeleteQuery
Returning adds a RETURNING clause to the query.
To suppress the auto-generated RETURNING clause, use `Returning("NULL")`.
func (*DeleteQuery) Table ¶
func (q *DeleteQuery) Table(tables ...string) *DeleteQuery
func (*DeleteQuery) TableExpr ¶
func (q *DeleteQuery) TableExpr(query string, args ...interface{}) *DeleteQuery
func (*DeleteQuery) Where ¶
func (q *DeleteQuery) Where(query string, args ...interface{}) *DeleteQuery
func (*DeleteQuery) WhereAllWithDeleted ¶
func (q *DeleteQuery) WhereAllWithDeleted() *DeleteQuery
func (*DeleteQuery) WhereDeleted ¶
func (q *DeleteQuery) WhereDeleted() *DeleteQuery
func (*DeleteQuery) WhereGroup ¶
func (q *DeleteQuery) WhereGroup(sep string, fn func(*WhereQuery)) *DeleteQuery
func (*DeleteQuery) WhereOr ¶
func (q *DeleteQuery) WhereOr(query string, args ...interface{}) *DeleteQuery
func (*DeleteQuery) WherePK ¶
func (q *DeleteQuery) WherePK() *DeleteQuery
WherePK adds conditions based on the model primary keys. Usually it is the same as:
Where("id = ?id")
func (*DeleteQuery) With ¶
func (q *DeleteQuery) With(name string, query schema.QueryAppender) *DeleteQuery
type DropColumnQuery ¶
type DropColumnQuery struct {
// contains filtered or unexported fields
}
func NewDropColumnQuery ¶
func NewDropColumnQuery(db *DB) *DropColumnQuery
func (*DropColumnQuery) AppendQuery ¶
func (*DropColumnQuery) Column ¶
func (q *DropColumnQuery) Column(columns ...string) *DropColumnQuery
func (*DropColumnQuery) ColumnExpr ¶
func (q *DropColumnQuery) ColumnExpr(query string, args ...interface{}) *DropColumnQuery
func (*DropColumnQuery) Conn ¶ added in v0.1.14
func (q *DropColumnQuery) Conn(db DBI) *DropColumnQuery
func (*DropColumnQuery) Model ¶
func (q *DropColumnQuery) Model(model interface{}) *DropColumnQuery
func (*DropColumnQuery) ModelTableExpr ¶
func (q *DropColumnQuery) ModelTableExpr(query string, args ...interface{}) *DropColumnQuery
func (*DropColumnQuery) Table ¶
func (q *DropColumnQuery) Table(tables ...string) *DropColumnQuery
func (*DropColumnQuery) TableExpr ¶
func (q *DropColumnQuery) TableExpr(query string, args ...interface{}) *DropColumnQuery
type DropIndexQuery ¶
type DropIndexQuery struct {
// contains filtered or unexported fields
}
func NewDropIndexQuery ¶
func NewDropIndexQuery(db *DB) *DropIndexQuery
func (*DropIndexQuery) AppendQuery ¶
func (*DropIndexQuery) Concurrently ¶
func (q *DropIndexQuery) Concurrently() *DropIndexQuery
func (*DropIndexQuery) Conn ¶ added in v0.1.14
func (q *DropIndexQuery) Conn(db DBI) *DropIndexQuery
func (*DropIndexQuery) IfExists ¶
func (q *DropIndexQuery) IfExists() *DropIndexQuery
func (*DropIndexQuery) Index ¶
func (q *DropIndexQuery) Index(query string, args ...interface{}) *DropIndexQuery
func (*DropIndexQuery) Model ¶
func (q *DropIndexQuery) Model(model interface{}) *DropIndexQuery
func (*DropIndexQuery) Restrict ¶
func (q *DropIndexQuery) Restrict() *DropIndexQuery
type DropTableQuery ¶
type DropTableQuery struct {
// contains filtered or unexported fields
}
func NewDropTableQuery ¶
func NewDropTableQuery(db *DB) *DropTableQuery
func (*DropTableQuery) AppendQuery ¶
func (*DropTableQuery) Conn ¶ added in v0.1.14
func (q *DropTableQuery) Conn(db DBI) *DropTableQuery
func (*DropTableQuery) IfExists ¶
func (q *DropTableQuery) IfExists() *DropTableQuery
func (*DropTableQuery) Model ¶
func (q *DropTableQuery) Model(model interface{}) *DropTableQuery
func (*DropTableQuery) Restrict ¶
func (q *DropTableQuery) Restrict() *DropTableQuery
func (*DropTableQuery) Table ¶
func (q *DropTableQuery) Table(tables ...string) *DropTableQuery
func (*DropTableQuery) TableExpr ¶
func (q *DropTableQuery) TableExpr(query string, args ...interface{}) *DropTableQuery
type InsertQuery ¶
type InsertQuery struct {
// contains filtered or unexported fields
}
func NewInsertQuery ¶
func NewInsertQuery(db *DB) *InsertQuery
func (*InsertQuery) AppendQuery ¶
func (*InsertQuery) Apply ¶
func (q *InsertQuery) Apply(fn func(*InsertQuery) *InsertQuery) *InsertQuery
Apply calls the fn passing the SelectQuery as an argument.
func (*InsertQuery) Column ¶
func (q *InsertQuery) Column(columns ...string) *InsertQuery
func (*InsertQuery) Conn ¶ added in v0.1.14
func (q *InsertQuery) Conn(db DBI) *InsertQuery
func (*InsertQuery) Ignore ¶ added in v0.1.9
func (q *InsertQuery) Ignore() *InsertQuery
Ignore generates an `INSERT IGNORE INTO` query (MySQL).
func (*InsertQuery) Model ¶
func (q *InsertQuery) Model(model interface{}) *InsertQuery
func (*InsertQuery) ModelTableExpr ¶
func (q *InsertQuery) ModelTableExpr(query string, args ...interface{}) *InsertQuery
func (*InsertQuery) On ¶ added in v0.1.9
func (q *InsertQuery) On(s string, args ...interface{}) *InsertQuery
func (*InsertQuery) Replace ¶ added in v0.1.9
func (q *InsertQuery) Replace() *InsertQuery
Replaces generates a `REPLACE INTO` query (MySQL).
func (*InsertQuery) Returning ¶
func (q *InsertQuery) Returning(query string, args ...interface{}) *InsertQuery
Returning adds a RETURNING clause to the query.
To suppress the auto-generated RETURNING clause, use `Returning("NULL")`.
func (*InsertQuery) Set ¶
func (q *InsertQuery) Set(query string, args ...interface{}) *InsertQuery
func (*InsertQuery) Table ¶
func (q *InsertQuery) Table(tables ...string) *InsertQuery
func (*InsertQuery) TableExpr ¶
func (q *InsertQuery) TableExpr(query string, args ...interface{}) *InsertQuery
func (*InsertQuery) Value ¶
func (q *InsertQuery) Value(column string, value string, args ...interface{}) *InsertQuery
Value overwrites model value for the column in INSERT and UPDATE queries.
func (*InsertQuery) Where ¶
func (q *InsertQuery) Where(query string, args ...interface{}) *InsertQuery
func (*InsertQuery) WhereOr ¶
func (q *InsertQuery) WhereOr(query string, args ...interface{}) *InsertQuery
func (*InsertQuery) With ¶
func (q *InsertQuery) With(name string, query schema.QueryAppender) *InsertQuery
type NullTime ¶
NullTime is a time.Time wrapper that marshals zero time as JSON null and SQL NULL.
func (NullTime) AppendQuery ¶
func (NullTime) MarshalJSON ¶
func (*NullTime) UnmarshalJSON ¶
type QueryEvent ¶
type QueryHook ¶
type QueryHook interface { BeforeQuery(context.Context, *QueryEvent) context.Context AfterQuery(context.Context, *QueryEvent) }
type SelectQuery ¶
type SelectQuery struct {
// contains filtered or unexported fields
}
func NewSelectQuery ¶
func NewSelectQuery(db *DB) *SelectQuery
func (*SelectQuery) AppendQuery ¶
func (*SelectQuery) Apply ¶
func (q *SelectQuery) Apply(fn func(*SelectQuery) *SelectQuery) *SelectQuery
Apply calls the fn passing the SelectQuery as an argument.
func (*SelectQuery) Column ¶
func (q *SelectQuery) Column(columns ...string) *SelectQuery
func (*SelectQuery) ColumnExpr ¶
func (q *SelectQuery) ColumnExpr(query string, args ...interface{}) *SelectQuery
func (*SelectQuery) Conn ¶ added in v0.1.14
func (q *SelectQuery) Conn(db DBI) *SelectQuery
func (*SelectQuery) Distinct ¶
func (q *SelectQuery) Distinct() *SelectQuery
func (*SelectQuery) DistinctOn ¶
func (q *SelectQuery) DistinctOn(query string, args ...interface{}) *SelectQuery
func (*SelectQuery) Except ¶
func (q *SelectQuery) Except(other *SelectQuery) *SelectQuery
func (*SelectQuery) ExceptAll ¶
func (q *SelectQuery) ExceptAll(other *SelectQuery) *SelectQuery
func (*SelectQuery) ExcludeColumn ¶
func (q *SelectQuery) ExcludeColumn(columns ...string) *SelectQuery
func (*SelectQuery) For ¶
func (q *SelectQuery) For(s string, args ...interface{}) *SelectQuery
func (*SelectQuery) Group ¶
func (q *SelectQuery) Group(columns ...string) *SelectQuery
func (*SelectQuery) GroupExpr ¶
func (q *SelectQuery) GroupExpr(group string, args ...interface{}) *SelectQuery
func (*SelectQuery) Having ¶
func (q *SelectQuery) Having(having string, args ...interface{}) *SelectQuery
func (*SelectQuery) Intersect ¶
func (q *SelectQuery) Intersect(other *SelectQuery) *SelectQuery
func (*SelectQuery) IntersectAll ¶
func (q *SelectQuery) IntersectAll(other *SelectQuery) *SelectQuery
func (*SelectQuery) Join ¶
func (q *SelectQuery) Join(join string, args ...interface{}) *SelectQuery
func (*SelectQuery) JoinOn ¶
func (q *SelectQuery) JoinOn(cond string, args ...interface{}) *SelectQuery
func (*SelectQuery) JoinOnOr ¶
func (q *SelectQuery) JoinOnOr(cond string, args ...interface{}) *SelectQuery
func (*SelectQuery) Limit ¶
func (q *SelectQuery) Limit(n int) *SelectQuery
func (*SelectQuery) Model ¶
func (q *SelectQuery) Model(model interface{}) *SelectQuery
func (*SelectQuery) ModelTableExpr ¶
func (q *SelectQuery) ModelTableExpr(query string, args ...interface{}) *SelectQuery
func (*SelectQuery) Offset ¶
func (q *SelectQuery) Offset(n int) *SelectQuery
func (*SelectQuery) Order ¶
func (q *SelectQuery) Order(orders ...string) *SelectQuery
func (*SelectQuery) OrderExpr ¶
func (q *SelectQuery) OrderExpr(query string, args ...interface{}) *SelectQuery
func (*SelectQuery) Relation ¶
func (q *SelectQuery) Relation(name string, apply ...func(*SelectQuery) *SelectQuery) *SelectQuery
Relation adds a relation to the query. Relation name can be:
- RelationName to select all columns,
- RelationName.column_name,
- RelationName._ to join relation without selecting relation columns.
func (*SelectQuery) Scan ¶
func (q *SelectQuery) Scan(ctx context.Context, dest ...interface{}) error
func (*SelectQuery) ScanAndCount ¶
func (q *SelectQuery) ScanAndCount(ctx context.Context, dest ...interface{}) (int, error)
func (*SelectQuery) Table ¶
func (q *SelectQuery) Table(tables ...string) *SelectQuery
func (*SelectQuery) TableExpr ¶
func (q *SelectQuery) TableExpr(query string, args ...interface{}) *SelectQuery
func (*SelectQuery) Union ¶
func (q *SelectQuery) Union(other *SelectQuery) *SelectQuery
func (*SelectQuery) UnionAll ¶
func (q *SelectQuery) UnionAll(other *SelectQuery) *SelectQuery
func (*SelectQuery) Where ¶
func (q *SelectQuery) Where(query string, args ...interface{}) *SelectQuery
func (*SelectQuery) WhereAllWithDeleted ¶
func (q *SelectQuery) WhereAllWithDeleted() *SelectQuery
func (*SelectQuery) WhereDeleted ¶
func (q *SelectQuery) WhereDeleted() *SelectQuery
func (*SelectQuery) WhereGroup ¶
func (q *SelectQuery) WhereGroup(sep string, fn func(*WhereQuery)) *SelectQuery
func (*SelectQuery) WhereOr ¶
func (q *SelectQuery) WhereOr(query string, args ...interface{}) *SelectQuery
func (*SelectQuery) WherePK ¶
func (q *SelectQuery) WherePK() *SelectQuery
WherePK adds conditions based on the model primary keys. Usually it is the same as:
Where("id = ?id")
func (*SelectQuery) With ¶
func (q *SelectQuery) With(name string, query schema.QueryAppender) *SelectQuery
type TruncateTableQuery ¶
type TruncateTableQuery struct {
// contains filtered or unexported fields
}
func NewTruncateTableQuery ¶
func NewTruncateTableQuery(db *DB) *TruncateTableQuery
func (*TruncateTableQuery) AppendQuery ¶
func (*TruncateTableQuery) Conn ¶ added in v0.1.14
func (q *TruncateTableQuery) Conn(db DBI) *TruncateTableQuery
func (*TruncateTableQuery) ContinueIdentity ¶
func (q *TruncateTableQuery) ContinueIdentity() *TruncateTableQuery
func (*TruncateTableQuery) Model ¶
func (q *TruncateTableQuery) Model(model interface{}) *TruncateTableQuery
func (*TruncateTableQuery) Restrict ¶
func (q *TruncateTableQuery) Restrict() *TruncateTableQuery
func (*TruncateTableQuery) Table ¶
func (q *TruncateTableQuery) Table(tables ...string) *TruncateTableQuery
func (*TruncateTableQuery) TableExpr ¶
func (q *TruncateTableQuery) TableExpr(query string, args ...interface{}) *TruncateTableQuery
type Tx ¶
func (Tx) ExecContext ¶ added in v0.1.3
func (Tx) NewAddColumn ¶ added in v0.1.12
func (tx Tx) NewAddColumn() *AddColumnQuery
func (Tx) NewCreateIndex ¶ added in v0.1.12
func (tx Tx) NewCreateIndex() *CreateIndexQuery
func (Tx) NewCreateTable ¶ added in v0.1.12
func (tx Tx) NewCreateTable() *CreateTableQuery
func (Tx) NewDelete ¶ added in v0.1.12
func (tx Tx) NewDelete() *DeleteQuery
func (Tx) NewDropColumn ¶ added in v0.1.12
func (tx Tx) NewDropColumn() *DropColumnQuery
func (Tx) NewDropIndex ¶ added in v0.1.12
func (tx Tx) NewDropIndex() *DropIndexQuery
func (Tx) NewDropTable ¶ added in v0.1.12
func (tx Tx) NewDropTable() *DropTableQuery
func (Tx) NewInsert ¶ added in v0.1.12
func (tx Tx) NewInsert() *InsertQuery
func (Tx) NewSelect ¶ added in v0.1.12
func (tx Tx) NewSelect() *SelectQuery
func (Tx) NewTruncateTable ¶ added in v0.1.12
func (tx Tx) NewTruncateTable() *TruncateTableQuery
func (Tx) NewUpdate ¶ added in v0.1.12
func (tx Tx) NewUpdate() *UpdateQuery
func (Tx) NewValues ¶ added in v0.1.12
func (tx Tx) NewValues(model interface{}) *ValuesQuery
func (Tx) QueryContext ¶ added in v0.1.3
type UpdateQuery ¶
type UpdateQuery struct {
// contains filtered or unexported fields
}
func NewUpdateQuery ¶
func NewUpdateQuery(db *DB) *UpdateQuery
func (*UpdateQuery) AppendQuery ¶
func (*UpdateQuery) Apply ¶
func (q *UpdateQuery) Apply(fn func(*UpdateQuery) *UpdateQuery) *UpdateQuery
Apply calls the fn passing the SelectQuery as an argument.
func (*UpdateQuery) Column ¶
func (q *UpdateQuery) Column(columns ...string) *UpdateQuery
func (*UpdateQuery) Conn ¶ added in v0.1.14
func (q *UpdateQuery) Conn(db DBI) *UpdateQuery
func (*UpdateQuery) FQN ¶ added in v0.1.3
func (q *UpdateQuery) FQN(name string) Ident
FQN returns a fully qualified column name. For MySQL, it returns the column name with the table alias. For other RDBMS, it returns just the column name.
func (*UpdateQuery) Model ¶
func (q *UpdateQuery) Model(model interface{}) *UpdateQuery
func (*UpdateQuery) ModelTableExpr ¶
func (q *UpdateQuery) ModelTableExpr(query string, args ...interface{}) *UpdateQuery
func (*UpdateQuery) Returning ¶
func (q *UpdateQuery) Returning(query string, args ...interface{}) *UpdateQuery
Returning adds a RETURNING clause to the query.
To suppress the auto-generated RETURNING clause, use `Returning("NULL")`.
func (*UpdateQuery) Set ¶
func (q *UpdateQuery) Set(query string, args ...interface{}) *UpdateQuery
func (*UpdateQuery) Table ¶
func (q *UpdateQuery) Table(tables ...string) *UpdateQuery
func (*UpdateQuery) TableExpr ¶
func (q *UpdateQuery) TableExpr(query string, args ...interface{}) *UpdateQuery
func (*UpdateQuery) Value ¶
func (q *UpdateQuery) Value(column string, value string, args ...interface{}) *UpdateQuery
Value overwrites model value for the column in INSERT and UPDATE queries.
func (*UpdateQuery) Where ¶
func (q *UpdateQuery) Where(query string, args ...interface{}) *UpdateQuery
func (*UpdateQuery) WhereAllWithDeleted ¶
func (q *UpdateQuery) WhereAllWithDeleted() *UpdateQuery
func (*UpdateQuery) WhereDeleted ¶
func (q *UpdateQuery) WhereDeleted() *UpdateQuery
func (*UpdateQuery) WhereGroup ¶
func (q *UpdateQuery) WhereGroup(sep string, fn func(*WhereQuery)) *UpdateQuery
func (*UpdateQuery) WhereOr ¶
func (q *UpdateQuery) WhereOr(query string, args ...interface{}) *UpdateQuery
func (*UpdateQuery) WherePK ¶
func (q *UpdateQuery) WherePK() *UpdateQuery
WherePK adds conditions based on the model primary keys. Usually it is the same as:
Where("id = ?id")
func (*UpdateQuery) With ¶
func (q *UpdateQuery) With(name string, query schema.QueryAppender) *UpdateQuery
type ValuesQuery ¶
type ValuesQuery struct {
// contains filtered or unexported fields
}
func NewValuesQuery ¶
func NewValuesQuery(db *DB, model interface{}) *ValuesQuery
func (*ValuesQuery) AppendColumns ¶
AppendColumns appends the table columns. It is used by CTE.
func (*ValuesQuery) AppendQuery ¶
func (*ValuesQuery) Conn ¶ added in v0.1.14
func (q *ValuesQuery) Conn(db DBI) *ValuesQuery
func (*ValuesQuery) WithOrder ¶
func (q *ValuesQuery) WithOrder() *ValuesQuery
type WhereQuery ¶
type WhereQuery struct {
// contains filtered or unexported fields
}
func (*WhereQuery) Where ¶
func (q *WhereQuery) Where(query string, args ...interface{}) *WhereQuery
func (*WhereQuery) WhereGroup ¶
func (q *WhereQuery) WhereGroup(sep string, fn func(*WhereQuery))
func (*WhereQuery) WhereOr ¶
func (q *WhereQuery) WhereOr(query string, args ...interface{}) *WhereQuery
Source Files ¶
- bun.go
- db.go
- hook.go
- join.go
- model.go
- model_map.go
- model_map_slice.go
- model_scan.go
- model_slice.go
- model_table_has_many.go
- model_table_m2m.go
- model_table_slice.go
- model_table_struct.go
- query_base.go
- query_column_add.go
- query_column_drop.go
- query_delete.go
- query_index_create.go
- query_index_drop.go
- query_insert.go
- query_select.go
- query_table_create.go
- query_table_drop.go
- query_table_truncate.go
- query_update.go
- query_values.go
- util.go
Directories ¶
Path | Synopsis |
---|---|
dbfixture
module
|
|
mssqldialect
Module
|
|
mysqldialect
Module
|
|
oracledialect
Module
|
|
pgdialect
Module
|
|
sqlitedialect
Module
|
|
driver
|
|
pgdriver
Module
|
|
sqliteshim
Module
|
|
example
|
|
basic
Module
|
|
belongs-to
Module
|
|
create-table-index
Module
|
|
cursor-pagination
Module
|
|
custom-type
Module
|
|
fixture
Module
|
|
get-where-fields
Module
|
|
has-many
Module
|
|
has-one
Module
|
|
migrate
Module
|
|
model-hooks
Module
|
|
multi-tenant
Module
|
|
opentelemetry
Module
|
|
pg-faceted-search
Module
|
|
pg-listen
Module
|
|
placeholders
Module
|
|
rel-belongs-to
Module
|
|
rel-has-many
Module
|
|
rel-has-many-polymorphic
Module
|
|
rel-has-one
Module
|
|
rel-join-condition
Module
|
|
rel-many-to-many
Module
|
|
rel-many-to-many-self
Module
|
|
string-representation
Module
|
|
trivial
Module
|
|
tx-composition
Module
|
|
extra
|
|
bunbig
Module
|
|
bundebug
Module
|
|
bunotel
Module
|
|
bunrelic
Module
|
|
bunslog
Module
|
|
fixture
module
|
|
dbtest
Module
|
|
testfixture
module
|