Documentation ¶
Index ¶
- func In(slice interface{}) schema.QueryAppender
- func NullZero(value interface{}) schema.QueryAppender
- func SafeQuery(query string, args ...interface{}) schema.QueryWithArgs
- func SetLogger(logger internal.Logging)
- func Version() string
- type AddColumnQuery
- func (q *AddColumnQuery) AppendNamedArg(fmter schema.Formatter, b []byte, name string) ([]byte, bool)
- func (q *AddColumnQuery) AppendQuery(fmter schema.Formatter, b []byte) (_ []byte, err error)
- func (q *AddColumnQuery) Apply(fn func(*AddColumnQuery) *AddColumnQuery) *AddColumnQuery
- func (q *AddColumnQuery) ColumnExpr(query string, args ...interface{}) *AddColumnQuery
- func (q *AddColumnQuery) Conn(db IConn) *AddColumnQuery
- func (q *AddColumnQuery) DB() *DB
- func (q *AddColumnQuery) Dialect() schema.Dialect
- func (q *AddColumnQuery) Err(err error) *AddColumnQuery
- func (q *AddColumnQuery) Exec(ctx context.Context, dest ...interface{}) (sql.Result, error)
- func (q *AddColumnQuery) GetConn() IConn
- func (q *AddColumnQuery) GetModel() Model
- func (q *AddColumnQuery) GetTableName() string
- func (q *AddColumnQuery) IfNotExists() *AddColumnQuery
- func (q *AddColumnQuery) Model(model interface{}) *AddColumnQuery
- func (q *AddColumnQuery) ModelTableExpr(query string, args ...interface{}) *AddColumnQuery
- func (q *AddColumnQuery) NewAddColumn() *AddColumnQuery
- func (q *AddColumnQuery) NewCreateIndex() *CreateIndexQuery
- func (q *AddColumnQuery) NewCreateTable() *CreateTableQuery
- func (q *AddColumnQuery) NewDelete() *DeleteQuery
- func (q *AddColumnQuery) NewDropColumn() *DropColumnQuery
- func (q *AddColumnQuery) NewDropIndex() *DropIndexQuery
- func (q *AddColumnQuery) NewDropTable() *DropTableQuery
- func (q *AddColumnQuery) NewInsert() *InsertQuery
- func (q *AddColumnQuery) NewRaw(query string, args ...interface{}) *RawQuery
- func (q *AddColumnQuery) NewSelect() *SelectQuery
- func (q *AddColumnQuery) NewTruncateTable() *TruncateTableQuery
- func (q *AddColumnQuery) NewUpdate() *UpdateQuery
- func (q *AddColumnQuery) NewValues(model interface{}) *ValuesQuery
- func (q *AddColumnQuery) Operation() string
- func (q *AddColumnQuery) Table(tables ...string) *AddColumnQuery
- func (q *AddColumnQuery) TableExpr(query string, args ...interface{}) *AddColumnQuery
- type AfterCreateTableHook
- type AfterDeleteHook
- type AfterDropTableHook
- type AfterInsertHook
- type AfterScanRowHook
- type AfterSelectHook
- type AfterUpdateHook
- type BaseModel
- type BeforeAppendModelHook
- type BeforeCreateTableHook
- type BeforeDeleteHook
- type BeforeDropTableHook
- type BeforeInsertHook
- type BeforeScanRowHook
- type BeforeSelectHook
- type BeforeUpdateHook
- type Conn
- func (c Conn) BeginTx(ctx context.Context, opts *sql.TxOptions) (Tx, error)
- func (c Conn) Dialect() schema.Dialect
- 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) NewMerge() *MergeQuery
- func (c Conn) NewRaw(query string, args ...interface{}) *RawQuery
- 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
- func (c Conn) RunInTx(ctx context.Context, opts *sql.TxOptions, ...) error
- 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 IConn) *CreateIndexQuery
- func (q *CreateIndexQuery) Err(err error) *CreateIndexQuery
- func (q *CreateIndexQuery) ExcludeColumn(columns ...string) *CreateIndexQuery
- func (q *CreateIndexQuery) Exec(ctx context.Context, dest ...interface{}) (sql.Result, 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) Operation() string
- 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) WhereOr(query string, args ...interface{}) *CreateIndexQuery
- type CreateTableQuery
- func (q *CreateTableQuery) AppendNamedArg(fmter schema.Formatter, b []byte, name string) ([]byte, bool)
- func (q *CreateTableQuery) AppendQuery(fmter schema.Formatter, b []byte) (_ []byte, err error)
- func (q *CreateTableQuery) ColumnExpr(query string, args ...interface{}) *CreateTableQuery
- func (q *CreateTableQuery) Conn(db IConn) *CreateTableQuery
- func (q *CreateTableQuery) DB() *DB
- func (q *CreateTableQuery) Dialect() schema.Dialect
- func (q *CreateTableQuery) Err(err error) *CreateTableQuery
- func (q *CreateTableQuery) Exec(ctx context.Context, dest ...interface{}) (sql.Result, error)
- func (q *CreateTableQuery) ForeignKey(query string, args ...interface{}) *CreateTableQuery
- func (q *CreateTableQuery) GetConn() IConn
- func (q *CreateTableQuery) GetModel() Model
- func (q *CreateTableQuery) GetTableName() string
- func (q *CreateTableQuery) IfNotExists() *CreateTableQuery
- func (q *CreateTableQuery) Model(model interface{}) *CreateTableQuery
- func (q *CreateTableQuery) ModelTableExpr(query string, args ...interface{}) *CreateTableQuery
- func (q *CreateTableQuery) NewAddColumn() *AddColumnQuery
- func (q *CreateTableQuery) NewCreateIndex() *CreateIndexQuery
- func (q *CreateTableQuery) NewCreateTable() *CreateTableQuery
- func (q *CreateTableQuery) NewDelete() *DeleteQuery
- func (q *CreateTableQuery) NewDropColumn() *DropColumnQuery
- func (q *CreateTableQuery) NewDropIndex() *DropIndexQuery
- func (q *CreateTableQuery) NewDropTable() *DropTableQuery
- func (q *CreateTableQuery) NewInsert() *InsertQuery
- func (q *CreateTableQuery) NewRaw(query string, args ...interface{}) *RawQuery
- func (q *CreateTableQuery) NewSelect() *SelectQuery
- func (q *CreateTableQuery) NewTruncateTable() *TruncateTableQuery
- func (q *CreateTableQuery) NewUpdate() *UpdateQuery
- func (q *CreateTableQuery) NewValues(model interface{}) *ValuesQuery
- func (q *CreateTableQuery) Operation() string
- func (q *CreateTableQuery) PartitionBy(query string, args ...interface{}) *CreateTableQuery
- func (q *CreateTableQuery) String() string
- func (q *CreateTableQuery) Table(tables ...string) *CreateTableQuery
- func (q *CreateTableQuery) TableExpr(query string, args ...interface{}) *CreateTableQuery
- func (q *CreateTableQuery) TableSpace(tablespace string) *CreateTableQuery
- func (q *CreateTableQuery) Temp() *CreateTableQuery
- func (q *CreateTableQuery) Varchar(n int) *CreateTableQuery
- func (q *CreateTableQuery) WithForeignKeys() *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) HasFeature(feat feature.Feature) bool
- 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) NewMerge() *MergeQuery
- func (db *DB) NewRaw(query string, args ...interface{}) *RawQuery
- 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) Raw(query string, args ...interface{}) *RawQuerydeprecated
- func (db *DB) RegisterModel(models ...interface{})
- func (db *DB) ResetModel(ctx context.Context, models ...interface{}) error
- func (db *DB) RunInTx(ctx context.Context, opts *sql.TxOptions, ...) 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) String() string
- func (db *DB) Table(typ reflect.Type) *schema.Table
- func (db *DB) UpdateFQN(alias, column string) Ident
- func (db *DB) WithNamedArg(name string, value interface{}) *DB
- 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) ApplyQueryBuilder(fn func(QueryBuilder) QueryBuilder) *DeleteQuery
- func (q *DeleteQuery) Conn(db IConn) *DeleteQuery
- func (q *DeleteQuery) Err(err error) *DeleteQuery
- func (q *DeleteQuery) Exec(ctx context.Context, dest ...interface{}) (sql.Result, error)
- func (q *DeleteQuery) ForceDelete() *DeleteQuery
- func (q *DeleteQuery) Model(model interface{}) *DeleteQuery
- func (q *DeleteQuery) ModelTableExpr(query string, args ...interface{}) *DeleteQuery
- func (q *DeleteQuery) Operation() string
- func (q *DeleteQuery) QueryBuilder() QueryBuilder
- func (q *DeleteQuery) Returning(query string, args ...interface{}) *DeleteQuery
- func (q *DeleteQuery) Scan(ctx context.Context, dest ...interface{}) error
- func (q *DeleteQuery) String() string
- 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(*DeleteQuery) *DeleteQuery) *DeleteQuery
- func (q *DeleteQuery) WhereOr(query string, args ...interface{}) *DeleteQuery
- func (q *DeleteQuery) WherePK(cols ...string) *DeleteQuery
- func (q *DeleteQuery) With(name string, query schema.QueryAppender) *DeleteQuery
- func (q *DeleteQuery) WithRecursive(name string, query schema.QueryAppender) *DeleteQuery
- type DropColumnQuery
- func (q *DropColumnQuery) AppendNamedArg(fmter schema.Formatter, b []byte, name string) ([]byte, bool)
- func (q *DropColumnQuery) AppendQuery(fmter schema.Formatter, b []byte) (_ []byte, err error)
- func (q *DropColumnQuery) Apply(fn func(*DropColumnQuery) *DropColumnQuery) *DropColumnQuery
- func (q *DropColumnQuery) Column(columns ...string) *DropColumnQuery
- func (q *DropColumnQuery) ColumnExpr(query string, args ...interface{}) *DropColumnQuery
- func (q *DropColumnQuery) Conn(db IConn) *DropColumnQuery
- func (q *DropColumnQuery) DB() *DB
- func (q *DropColumnQuery) Dialect() schema.Dialect
- func (q *DropColumnQuery) Err(err error) *DropColumnQuery
- func (q *DropColumnQuery) Exec(ctx context.Context, dest ...interface{}) (sql.Result, error)
- func (q *DropColumnQuery) GetConn() IConn
- func (q *DropColumnQuery) GetModel() Model
- func (q *DropColumnQuery) GetTableName() string
- func (q *DropColumnQuery) Model(model interface{}) *DropColumnQuery
- func (q *DropColumnQuery) ModelTableExpr(query string, args ...interface{}) *DropColumnQuery
- func (q *DropColumnQuery) NewAddColumn() *AddColumnQuery
- func (q *DropColumnQuery) NewCreateIndex() *CreateIndexQuery
- func (q *DropColumnQuery) NewCreateTable() *CreateTableQuery
- func (q *DropColumnQuery) NewDelete() *DeleteQuery
- func (q *DropColumnQuery) NewDropColumn() *DropColumnQuery
- func (q *DropColumnQuery) NewDropIndex() *DropIndexQuery
- func (q *DropColumnQuery) NewDropTable() *DropTableQuery
- func (q *DropColumnQuery) NewInsert() *InsertQuery
- func (q *DropColumnQuery) NewRaw(query string, args ...interface{}) *RawQuery
- func (q *DropColumnQuery) NewSelect() *SelectQuery
- func (q *DropColumnQuery) NewTruncateTable() *TruncateTableQuery
- func (q *DropColumnQuery) NewUpdate() *UpdateQuery
- func (q *DropColumnQuery) NewValues(model interface{}) *ValuesQuery
- func (q *DropColumnQuery) Operation() string
- func (q *DropColumnQuery) Table(tables ...string) *DropColumnQuery
- func (q *DropColumnQuery) TableExpr(query string, args ...interface{}) *DropColumnQuery
- type DropIndexQuery
- func (q *DropIndexQuery) AppendNamedArg(fmter schema.Formatter, b []byte, name string) ([]byte, bool)
- func (q *DropIndexQuery) AppendQuery(fmter schema.Formatter, b []byte) (_ []byte, err error)
- func (q *DropIndexQuery) Cascade() *DropIndexQuery
- func (q *DropIndexQuery) Concurrently() *DropIndexQuery
- func (q *DropIndexQuery) Conn(db IConn) *DropIndexQuery
- func (q *DropIndexQuery) DB() *DB
- func (q *DropIndexQuery) Dialect() schema.Dialect
- func (q *DropIndexQuery) Err(err error) *DropIndexQuery
- func (q *DropIndexQuery) Exec(ctx context.Context, dest ...interface{}) (sql.Result, error)
- func (q *DropIndexQuery) GetConn() IConn
- func (q *DropIndexQuery) GetModel() Model
- func (q *DropIndexQuery) GetTableName() string
- func (q *DropIndexQuery) IfExists() *DropIndexQuery
- func (q *DropIndexQuery) Index(query string, args ...interface{}) *DropIndexQuery
- func (q *DropIndexQuery) Model(model interface{}) *DropIndexQuery
- func (q *DropIndexQuery) NewAddColumn() *AddColumnQuery
- func (q *DropIndexQuery) NewCreateIndex() *CreateIndexQuery
- func (q *DropIndexQuery) NewCreateTable() *CreateTableQuery
- func (q *DropIndexQuery) NewDelete() *DeleteQuery
- func (q *DropIndexQuery) NewDropColumn() *DropColumnQuery
- func (q *DropIndexQuery) NewDropIndex() *DropIndexQuery
- func (q *DropIndexQuery) NewDropTable() *DropTableQuery
- func (q *DropIndexQuery) NewInsert() *InsertQuery
- func (q *DropIndexQuery) NewRaw(query string, args ...interface{}) *RawQuery
- func (q *DropIndexQuery) NewSelect() *SelectQuery
- func (q *DropIndexQuery) NewTruncateTable() *TruncateTableQuery
- func (q *DropIndexQuery) NewUpdate() *UpdateQuery
- func (q *DropIndexQuery) NewValues(model interface{}) *ValuesQuery
- func (q *DropIndexQuery) Operation() string
- func (q *DropIndexQuery) Restrict() *DropIndexQuery
- type DropTableQuery
- func (q *DropTableQuery) AppendNamedArg(fmter schema.Formatter, b []byte, name string) ([]byte, bool)
- func (q *DropTableQuery) AppendQuery(fmter schema.Formatter, b []byte) (_ []byte, err error)
- func (q *DropTableQuery) Cascade() *DropTableQuery
- func (q *DropTableQuery) Conn(db IConn) *DropTableQuery
- func (q *DropTableQuery) DB() *DB
- func (q *DropTableQuery) Dialect() schema.Dialect
- func (q *DropTableQuery) Err(err error) *DropTableQuery
- func (q *DropTableQuery) Exec(ctx context.Context, dest ...interface{}) (sql.Result, error)
- func (q *DropTableQuery) GetConn() IConn
- func (q *DropTableQuery) GetModel() Model
- func (q *DropTableQuery) GetTableName() string
- func (q *DropTableQuery) IfExists() *DropTableQuery
- func (q *DropTableQuery) Model(model interface{}) *DropTableQuery
- func (q *DropTableQuery) ModelTableExpr(query string, args ...interface{}) *DropTableQuery
- func (q *DropTableQuery) NewAddColumn() *AddColumnQuery
- func (q *DropTableQuery) NewCreateIndex() *CreateIndexQuery
- func (q *DropTableQuery) NewCreateTable() *CreateTableQuery
- func (q *DropTableQuery) NewDelete() *DeleteQuery
- func (q *DropTableQuery) NewDropColumn() *DropColumnQuery
- func (q *DropTableQuery) NewDropIndex() *DropIndexQuery
- func (q *DropTableQuery) NewDropTable() *DropTableQuery
- func (q *DropTableQuery) NewInsert() *InsertQuery
- func (q *DropTableQuery) NewRaw(query string, args ...interface{}) *RawQuery
- func (q *DropTableQuery) NewSelect() *SelectQuery
- func (q *DropTableQuery) NewTruncateTable() *TruncateTableQuery
- func (q *DropTableQuery) NewUpdate() *UpdateQuery
- func (q *DropTableQuery) NewValues(model interface{}) *ValuesQuery
- func (q *DropTableQuery) Operation() string
- func (q *DropTableQuery) Restrict() *DropTableQuery
- func (q *DropTableQuery) Table(tables ...string) *DropTableQuery
- func (q *DropTableQuery) TableExpr(query string, args ...interface{}) *DropTableQuery
- type IConn
- type IDB
- type Ident
- 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) ColumnExpr(query string, args ...interface{}) *InsertQuery
- func (q *InsertQuery) Conn(db IConn) *InsertQuery
- func (q *InsertQuery) Err(err error) *InsertQuery
- func (q *InsertQuery) ExcludeColumn(columns ...string) *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) Operation() string
- func (q *InsertQuery) Replace() *InsertQuery
- func (q *InsertQuery) Returning(query string, args ...interface{}) *InsertQuery
- func (q *InsertQuery) Scan(ctx context.Context, dest ...interface{}) error
- func (q *InsertQuery) Set(query string, args ...interface{}) *InsertQuery
- func (q *InsertQuery) String() string
- func (q *InsertQuery) Table(tables ...string) *InsertQuery
- func (q *InsertQuery) TableExpr(query string, args ...interface{}) *InsertQuery
- func (q *InsertQuery) Value(column string, expr 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
- func (q *InsertQuery) WithRecursive(name string, query schema.QueryAppender) *InsertQuery
- type MergeQuery
- func (q *MergeQuery) AppendNamedArg(fmter schema.Formatter, b []byte, name string) ([]byte, bool)
- func (q *MergeQuery) AppendQuery(fmter schema.Formatter, b []byte) (_ []byte, err error)
- func (q *MergeQuery) Apply(fn func(*MergeQuery) *MergeQuery) *MergeQuery
- func (q *MergeQuery) Conn(db IConn) *MergeQuery
- func (q *MergeQuery) DB() *DB
- func (q *MergeQuery) Dialect() schema.Dialect
- func (q *MergeQuery) Err(err error) *MergeQuery
- func (q *MergeQuery) Exec(ctx context.Context, dest ...interface{}) (sql.Result, error)
- func (q *MergeQuery) GetConn() IConn
- func (q *MergeQuery) GetModel() Model
- func (q *MergeQuery) GetTableName() string
- func (q *MergeQuery) Model(model interface{}) *MergeQuery
- func (q *MergeQuery) ModelTableExpr(query string, args ...interface{}) *MergeQuery
- func (q *MergeQuery) NewAddColumn() *AddColumnQuery
- func (q *MergeQuery) NewCreateIndex() *CreateIndexQuery
- func (q *MergeQuery) NewCreateTable() *CreateTableQuery
- func (q *MergeQuery) NewDelete() *DeleteQuery
- func (q *MergeQuery) NewDropColumn() *DropColumnQuery
- func (q *MergeQuery) NewDropIndex() *DropIndexQuery
- func (q *MergeQuery) NewDropTable() *DropTableQuery
- func (q *MergeQuery) NewInsert() *InsertQuery
- func (q *MergeQuery) NewRaw(query string, args ...interface{}) *RawQuery
- func (q *MergeQuery) NewSelect() *SelectQuery
- func (q *MergeQuery) NewTruncateTable() *TruncateTableQuery
- func (q *MergeQuery) NewUpdate() *UpdateQuery
- func (q *MergeQuery) NewValues(model interface{}) *ValuesQuery
- func (q *MergeQuery) On(s string, args ...interface{}) *MergeQuery
- func (q *MergeQuery) Operation() string
- func (q *MergeQuery) Returning(query string, args ...interface{}) *MergeQuery
- func (q *MergeQuery) Scan(ctx context.Context, dest ...interface{}) error
- func (q *MergeQuery) String() string
- func (q *MergeQuery) Table(tables ...string) *MergeQuery
- func (q *MergeQuery) TableExpr(query string, args ...interface{}) *MergeQuery
- func (q *MergeQuery) Using(s string, args ...interface{}) *MergeQuery
- func (q *MergeQuery) When(expr string, args ...interface{}) *MergeQuery
- func (q *MergeQuery) WhenDelete(expr string) *MergeQuery
- func (q *MergeQuery) WhenInsert(expr string, fn func(q *InsertQuery) *InsertQuery) *MergeQuery
- func (q *MergeQuery) WhenUpdate(expr string, fn func(q *UpdateQuery) *UpdateQuery) *MergeQuery
- func (q *MergeQuery) With(name string, query schema.QueryAppender) *MergeQuery
- func (q *MergeQuery) WithRecursive(name string, query schema.QueryAppender) *MergeQuery
- type Model
- type Name
- type NullTime
- type Query
- type QueryBuilder
- type QueryEvent
- type QueryHook
- type RawQuery
- func (q *RawQuery) AppendNamedArg(fmter schema.Formatter, b []byte, name string) ([]byte, bool)
- func (q *RawQuery) AppendQuery(fmter schema.Formatter, b []byte) ([]byte, error)
- func (q *RawQuery) Conn(db IConn) *RawQuery
- func (q *RawQuery) DB() *DB
- func (q *RawQuery) Dialect() schema.Dialect
- func (q *RawQuery) Err(err error) *RawQuery
- func (q *RawQuery) Exec(ctx context.Context, dest ...interface{}) (sql.Result, error)
- func (q *RawQuery) GetConn() IConn
- func (q *RawQuery) GetModel() Model
- func (q *RawQuery) GetTableName() string
- func (q *RawQuery) NewAddColumn() *AddColumnQuery
- func (q *RawQuery) NewCreateIndex() *CreateIndexQuery
- func (q *RawQuery) NewCreateTable() *CreateTableQuery
- func (q *RawQuery) NewDelete() *DeleteQuery
- func (q *RawQuery) NewDropColumn() *DropColumnQuery
- func (q *RawQuery) NewDropIndex() *DropIndexQuery
- func (q *RawQuery) NewDropTable() *DropTableQuery
- func (q *RawQuery) NewInsert() *InsertQuery
- func (q *RawQuery) NewRaw(query string, args ...interface{}) *RawQuery
- func (q *RawQuery) NewSelect() *SelectQuery
- func (q *RawQuery) NewTruncateTable() *TruncateTableQuery
- func (q *RawQuery) NewUpdate() *UpdateQuery
- func (q *RawQuery) NewValues(model interface{}) *ValuesQuery
- func (q *RawQuery) Operation() string
- func (q *RawQuery) Scan(ctx context.Context, dest ...interface{}) error
- 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) ApplyQueryBuilder(fn func(QueryBuilder) QueryBuilder) *SelectQuery
- func (q *SelectQuery) Column(columns ...string) *SelectQuery
- func (q *SelectQuery) ColumnExpr(query string, args ...interface{}) *SelectQuery
- func (q *SelectQuery) Conn(db IConn) *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) Err(err error) *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) Exists(ctx context.Context) (bool, error)
- func (q *SelectQuery) For(s string, args ...interface{}) *SelectQuery
- func (q *SelectQuery) ForceIndex(indexes ...string) *SelectQuery
- func (q *SelectQuery) ForceIndexForGroupBy(indexes ...string) *SelectQuery
- func (q *SelectQuery) ForceIndexForJoin(indexes ...string) *SelectQuery
- func (q *SelectQuery) ForceIndexForOrderBy(indexes ...string) *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) IgnoreIndex(indexes ...string) *SelectQuery
- func (q *SelectQuery) IgnoreIndexForGroupBy(indexes ...string) *SelectQuery
- func (q *SelectQuery) IgnoreIndexForJoin(indexes ...string) *SelectQuery
- func (q *SelectQuery) IgnoreIndexForOrderBy(indexes ...string) *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) Operation() string
- func (q *SelectQuery) Order(orders ...string) *SelectQuery
- func (q *SelectQuery) OrderExpr(query string, args ...interface{}) *SelectQuery
- func (q *SelectQuery) QueryBuilder() QueryBuilder
- 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) String() string
- 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) UseIndex(indexes ...string) *SelectQuery
- func (q *SelectQuery) UseIndexForGroupBy(indexes ...string) *SelectQuery
- func (q *SelectQuery) UseIndexForJoin(indexes ...string) *SelectQuery
- func (q *SelectQuery) UseIndexForOrderBy(indexes ...string) *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(*SelectQuery) *SelectQuery) *SelectQuery
- func (q *SelectQuery) WhereOr(query string, args ...interface{}) *SelectQuery
- func (q *SelectQuery) WherePK(cols ...string) *SelectQuery
- func (q *SelectQuery) With(name string, query schema.QueryAppender) *SelectQuery
- func (q *SelectQuery) WithRecursive(name string, query schema.QueryAppender) *SelectQuery
- type Stmt
- type TableModel
- type TruncateTableQuery
- func (q *TruncateTableQuery) AppendNamedArg(fmter schema.Formatter, b []byte, name string) ([]byte, bool)
- func (q *TruncateTableQuery) AppendQuery(fmter schema.Formatter, b []byte) (_ []byte, err error)
- func (q *TruncateTableQuery) Cascade() *TruncateTableQuery
- func (q *TruncateTableQuery) Conn(db IConn) *TruncateTableQuery
- func (q *TruncateTableQuery) ContinueIdentity() *TruncateTableQuery
- func (q *TruncateTableQuery) DB() *DB
- func (q *TruncateTableQuery) Dialect() schema.Dialect
- func (q *TruncateTableQuery) Err(err error) *TruncateTableQuery
- func (q *TruncateTableQuery) Exec(ctx context.Context, dest ...interface{}) (sql.Result, error)
- func (q *TruncateTableQuery) GetConn() IConn
- func (q *TruncateTableQuery) GetModel() Model
- func (q *TruncateTableQuery) GetTableName() string
- func (q *TruncateTableQuery) Model(model interface{}) *TruncateTableQuery
- func (q *TruncateTableQuery) ModelTableExpr(query string, args ...interface{}) *TruncateTableQuery
- func (q *TruncateTableQuery) NewAddColumn() *AddColumnQuery
- func (q *TruncateTableQuery) NewCreateIndex() *CreateIndexQuery
- func (q *TruncateTableQuery) NewCreateTable() *CreateTableQuery
- func (q *TruncateTableQuery) NewDelete() *DeleteQuery
- func (q *TruncateTableQuery) NewDropColumn() *DropColumnQuery
- func (q *TruncateTableQuery) NewDropIndex() *DropIndexQuery
- func (q *TruncateTableQuery) NewDropTable() *DropTableQuery
- func (q *TruncateTableQuery) NewInsert() *InsertQuery
- func (q *TruncateTableQuery) NewRaw(query string, args ...interface{}) *RawQuery
- func (q *TruncateTableQuery) NewSelect() *SelectQuery
- func (q *TruncateTableQuery) NewTruncateTable() *TruncateTableQuery
- func (q *TruncateTableQuery) NewUpdate() *UpdateQuery
- func (q *TruncateTableQuery) NewValues(model interface{}) *ValuesQuery
- func (q *TruncateTableQuery) Operation() string
- 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) Begin() (Tx, error)
- func (tx Tx) BeginTx(ctx context.Context, _ *sql.TxOptions) (Tx, error)
- func (tx Tx) Commit() error
- func (tx Tx) Dialect() schema.Dialect
- 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) NewMerge() *MergeQuery
- func (tx Tx) NewRaw(query string, args ...interface{}) *RawQuery
- 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
- func (tx Tx) Rollback() error
- func (tx Tx) RunInTx(ctx context.Context, _ *sql.TxOptions, ...) error
- 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) ApplyQueryBuilder(fn func(QueryBuilder) QueryBuilder) *UpdateQuery
- func (q *UpdateQuery) Bulk() *UpdateQuery
- func (q *UpdateQuery) Column(columns ...string) *UpdateQuery
- func (q *UpdateQuery) Conn(db IConn) *UpdateQuery
- func (q *UpdateQuery) Err(err error) *UpdateQuery
- func (q *UpdateQuery) ExcludeColumn(columns ...string) *UpdateQuery
- func (q *UpdateQuery) Exec(ctx context.Context, dest ...interface{}) (sql.Result, error)
- func (q *UpdateQuery) FQN(column string) Ident
- func (q *UpdateQuery) ForceIndex(indexes ...string) *UpdateQuery
- func (q *UpdateQuery) IgnoreIndex(indexes ...string) *UpdateQuery
- func (q *UpdateQuery) Join(join string, args ...interface{}) *UpdateQuery
- func (q *UpdateQuery) JoinOn(cond string, args ...interface{}) *UpdateQuery
- func (q *UpdateQuery) JoinOnOr(cond string, args ...interface{}) *UpdateQuery
- func (q *UpdateQuery) Model(model interface{}) *UpdateQuery
- func (q *UpdateQuery) ModelTableExpr(query string, args ...interface{}) *UpdateQuery
- func (q *UpdateQuery) OmitZero() *UpdateQuery
- func (q *UpdateQuery) Operation() string
- func (q *UpdateQuery) QueryBuilder() QueryBuilder
- func (q *UpdateQuery) Returning(query string, args ...interface{}) *UpdateQuery
- func (q *UpdateQuery) Scan(ctx context.Context, dest ...interface{}) error
- func (q *UpdateQuery) Set(query string, args ...interface{}) *UpdateQuery
- func (q *UpdateQuery) SetColumn(column string, query string, args ...interface{}) *UpdateQuery
- func (q *UpdateQuery) String() string
- func (q *UpdateQuery) Table(tables ...string) *UpdateQuery
- func (q *UpdateQuery) TableExpr(query string, args ...interface{}) *UpdateQuery
- func (q *UpdateQuery) UseIndex(indexes ...string) *UpdateQuery
- func (q *UpdateQuery) Value(column string, query 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(*UpdateQuery) *UpdateQuery) *UpdateQuery
- func (q *UpdateQuery) WhereOr(query string, args ...interface{}) *UpdateQuery
- func (q *UpdateQuery) WherePK(cols ...string) *UpdateQuery
- func (q *UpdateQuery) With(name string, query schema.QueryAppender) *UpdateQuery
- func (q *UpdateQuery) WithRecursive(name string, query schema.QueryAppender) *UpdateQuery
- type ValuesQuery
- func (q *ValuesQuery) AppendColumns(fmter schema.Formatter, b []byte) (_ []byte, err error)
- func (q *ValuesQuery) AppendNamedArg(fmter schema.Formatter, b []byte, name string) ([]byte, bool)
- func (q *ValuesQuery) AppendQuery(fmter schema.Formatter, b []byte) (_ []byte, err error)
- func (q *ValuesQuery) Column(columns ...string) *ValuesQuery
- func (q *ValuesQuery) Conn(db IConn) *ValuesQuery
- func (q *ValuesQuery) DB() *DB
- func (q *ValuesQuery) Dialect() schema.Dialect
- func (q *ValuesQuery) Err(err error) *ValuesQuery
- func (q *ValuesQuery) GetConn() IConn
- func (q *ValuesQuery) GetModel() Model
- func (q *ValuesQuery) GetTableName() string
- func (q *ValuesQuery) NewAddColumn() *AddColumnQuery
- func (q *ValuesQuery) NewCreateIndex() *CreateIndexQuery
- func (q *ValuesQuery) NewCreateTable() *CreateTableQuery
- func (q *ValuesQuery) NewDelete() *DeleteQuery
- func (q *ValuesQuery) NewDropColumn() *DropColumnQuery
- func (q *ValuesQuery) NewDropIndex() *DropIndexQuery
- func (q *ValuesQuery) NewDropTable() *DropTableQuery
- func (q *ValuesQuery) NewInsert() *InsertQuery
- func (q *ValuesQuery) NewRaw(query string, args ...interface{}) *RawQuery
- func (q *ValuesQuery) NewSelect() *SelectQuery
- func (q *ValuesQuery) NewTruncateTable() *TruncateTableQuery
- func (q *ValuesQuery) NewUpdate() *UpdateQuery
- func (q *ValuesQuery) NewValues(model interface{}) *ValuesQuery
- func (q *ValuesQuery) Operation() string
- func (q *ValuesQuery) Value(column string, expr string, args ...interface{}) *ValuesQuery
- func (q *ValuesQuery) WithOrder() *ValuesQuery
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func In ¶
func In(slice interface{}) schema.QueryAppender
func NullZero ¶
func NullZero(value interface{}) schema.QueryAppender
func SafeQuery ¶
func SafeQuery(query string, args ...interface{}) schema.QueryWithArgs
Types ¶
type AddColumnQuery ¶
type AddColumnQuery struct {
// contains filtered or unexported fields
}
func NewAddColumnQuery ¶
func NewAddColumnQuery(db *DB) *AddColumnQuery
func (*AddColumnQuery) AppendNamedArg ¶
func (*AddColumnQuery) AppendQuery ¶
func (*AddColumnQuery) Apply ¶
func (q *AddColumnQuery) Apply(fn func(*AddColumnQuery) *AddColumnQuery) *AddColumnQuery
func (*AddColumnQuery) ColumnExpr ¶
func (q *AddColumnQuery) ColumnExpr(query string, args ...interface{}) *AddColumnQuery
func (*AddColumnQuery) Conn ¶
func (q *AddColumnQuery) Conn(db IConn) *AddColumnQuery
func (*AddColumnQuery) Err ¶
func (q *AddColumnQuery) Err(err error) *AddColumnQuery
func (*AddColumnQuery) GetTableName ¶
func (q *AddColumnQuery) GetTableName() string
func (*AddColumnQuery) IfNotExists ¶
func (q *AddColumnQuery) IfNotExists() *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) NewAddColumn ¶
func (q *AddColumnQuery) NewAddColumn() *AddColumnQuery
func (*AddColumnQuery) NewCreateIndex ¶
func (q *AddColumnQuery) NewCreateIndex() *CreateIndexQuery
func (*AddColumnQuery) NewCreateTable ¶
func (q *AddColumnQuery) NewCreateTable() *CreateTableQuery
func (*AddColumnQuery) NewDelete ¶
func (q *AddColumnQuery) NewDelete() *DeleteQuery
func (*AddColumnQuery) NewDropColumn ¶
func (q *AddColumnQuery) NewDropColumn() *DropColumnQuery
func (*AddColumnQuery) NewDropIndex ¶
func (q *AddColumnQuery) NewDropIndex() *DropIndexQuery
func (*AddColumnQuery) NewDropTable ¶
func (q *AddColumnQuery) NewDropTable() *DropTableQuery
func (*AddColumnQuery) NewInsert ¶
func (q *AddColumnQuery) NewInsert() *InsertQuery
func (*AddColumnQuery) NewSelect ¶
func (q *AddColumnQuery) NewSelect() *SelectQuery
func (*AddColumnQuery) NewTruncateTable ¶
func (q *AddColumnQuery) NewTruncateTable() *TruncateTableQuery
func (*AddColumnQuery) NewUpdate ¶
func (q *AddColumnQuery) NewUpdate() *UpdateQuery
func (*AddColumnQuery) NewValues ¶
func (q *AddColumnQuery) NewValues(model interface{}) *ValuesQuery
func (*AddColumnQuery) Operation ¶
func (q *AddColumnQuery) Operation() string
func (*AddColumnQuery) Table ¶
func (q *AddColumnQuery) Table(tables ...string) *AddColumnQuery
func (*AddColumnQuery) TableExpr ¶
func (q *AddColumnQuery) TableExpr(query string, args ...interface{}) *AddColumnQuery
type AfterCreateTableHook ¶
type AfterCreateTableHook interface {
AfterCreateTable(ctx context.Context, query *CreateTableQuery) error
}
type AfterDeleteHook ¶
type AfterDeleteHook interface {
AfterDelete(ctx context.Context, query *DeleteQuery) error
}
type AfterDropTableHook ¶
type AfterDropTableHook interface {
AfterDropTable(ctx context.Context, query *DropTableQuery) error
}
type AfterInsertHook ¶
type AfterInsertHook interface {
AfterInsert(ctx context.Context, query *InsertQuery) error
}
type AfterScanRowHook ¶
type AfterScanRowHook = schema.AfterScanRowHook
type AfterSelectHook ¶
type AfterSelectHook interface {
AfterSelect(ctx context.Context, query *SelectQuery) error
}
type AfterUpdateHook ¶
type AfterUpdateHook interface {
AfterUpdate(ctx context.Context, query *UpdateQuery) error
}
type BeforeAppendModelHook ¶
type BeforeAppendModelHook = schema.BeforeAppendModelHook
type BeforeCreateTableHook ¶
type BeforeCreateTableHook interface {
BeforeCreateTable(ctx context.Context, query *CreateTableQuery) error
}
type BeforeDeleteHook ¶
type BeforeDeleteHook interface {
BeforeDelete(ctx context.Context, query *DeleteQuery) error
}
type BeforeDropTableHook ¶
type BeforeDropTableHook interface {
BeforeDropTable(ctx context.Context, query *DropTableQuery) error
}
type BeforeInsertHook ¶
type BeforeInsertHook interface {
BeforeInsert(ctx context.Context, query *InsertQuery) error
}
type BeforeScanRowHook ¶
type BeforeScanRowHook = schema.BeforeScanRowHook
type BeforeSelectHook ¶
type BeforeSelectHook interface {
BeforeSelect(ctx context.Context, query *SelectQuery) error
}
type BeforeUpdateHook ¶
type BeforeUpdateHook interface {
BeforeUpdate(ctx context.Context, query *UpdateQuery) error
}
type Conn ¶
func (Conn) ExecContext ¶
func (Conn) NewAddColumn ¶
func (c Conn) NewAddColumn() *AddColumnQuery
func (Conn) NewCreateIndex ¶
func (c Conn) NewCreateIndex() *CreateIndexQuery
func (Conn) NewCreateTable ¶
func (c Conn) NewCreateTable() *CreateTableQuery
func (Conn) NewDelete ¶
func (c Conn) NewDelete() *DeleteQuery
func (Conn) NewDropColumn ¶
func (c Conn) NewDropColumn() *DropColumnQuery
func (Conn) NewDropIndex ¶
func (c Conn) NewDropIndex() *DropIndexQuery
func (Conn) NewDropTable ¶
func (c Conn) NewDropTable() *DropTableQuery
func (Conn) NewInsert ¶
func (c Conn) NewInsert() *InsertQuery
func (Conn) NewMerge ¶
func (c Conn) NewMerge() *MergeQuery
func (Conn) NewSelect ¶
func (c Conn) NewSelect() *SelectQuery
func (Conn) NewTruncateTable ¶
func (c Conn) NewTruncateTable() *TruncateTableQuery
func (Conn) NewUpdate ¶
func (c Conn) NewUpdate() *UpdateQuery
func (Conn) NewValues ¶
func (c Conn) NewValues(model interface{}) *ValuesQuery
func (Conn) QueryContext ¶
func (Conn) QueryRowContext ¶
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 ¶
func (q *CreateIndexQuery) Conn(db IConn) *CreateIndexQuery
func (*CreateIndexQuery) Err ¶
func (q *CreateIndexQuery) Err(err error) *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) Operation ¶
func (q *CreateIndexQuery) Operation() string
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) 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) AppendNamedArg ¶
func (*CreateTableQuery) AppendQuery ¶
func (*CreateTableQuery) ColumnExpr ¶
func (q *CreateTableQuery) ColumnExpr(query string, args ...interface{}) *CreateTableQuery
func (*CreateTableQuery) Conn ¶
func (q *CreateTableQuery) Conn(db IConn) *CreateTableQuery
func (*CreateTableQuery) Err ¶
func (q *CreateTableQuery) Err(err error) *CreateTableQuery
func (*CreateTableQuery) ForeignKey ¶
func (q *CreateTableQuery) ForeignKey(query string, args ...interface{}) *CreateTableQuery
func (*CreateTableQuery) GetTableName ¶
func (q *CreateTableQuery) GetTableName() string
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) NewAddColumn ¶
func (q *CreateTableQuery) NewAddColumn() *AddColumnQuery
func (*CreateTableQuery) NewCreateIndex ¶
func (q *CreateTableQuery) NewCreateIndex() *CreateIndexQuery
func (*CreateTableQuery) NewCreateTable ¶
func (q *CreateTableQuery) NewCreateTable() *CreateTableQuery
func (*CreateTableQuery) NewDelete ¶
func (q *CreateTableQuery) NewDelete() *DeleteQuery
func (*CreateTableQuery) NewDropColumn ¶
func (q *CreateTableQuery) NewDropColumn() *DropColumnQuery
func (*CreateTableQuery) NewDropIndex ¶
func (q *CreateTableQuery) NewDropIndex() *DropIndexQuery
func (*CreateTableQuery) NewDropTable ¶
func (q *CreateTableQuery) NewDropTable() *DropTableQuery
func (*CreateTableQuery) NewInsert ¶
func (q *CreateTableQuery) NewInsert() *InsertQuery
func (*CreateTableQuery) NewSelect ¶
func (q *CreateTableQuery) NewSelect() *SelectQuery
func (*CreateTableQuery) NewTruncateTable ¶
func (q *CreateTableQuery) NewTruncateTable() *TruncateTableQuery
func (*CreateTableQuery) NewUpdate ¶
func (q *CreateTableQuery) NewUpdate() *UpdateQuery
func (*CreateTableQuery) NewValues ¶
func (q *CreateTableQuery) NewValues(model interface{}) *ValuesQuery
func (*CreateTableQuery) Operation ¶
func (q *CreateTableQuery) Operation() string
func (*CreateTableQuery) PartitionBy ¶
func (q *CreateTableQuery) PartitionBy(query string, args ...interface{}) *CreateTableQuery
func (*CreateTableQuery) String ¶
func (q *CreateTableQuery) String() string
func (*CreateTableQuery) Table ¶
func (q *CreateTableQuery) Table(tables ...string) *CreateTableQuery
func (*CreateTableQuery) TableExpr ¶
func (q *CreateTableQuery) TableExpr(query string, args ...interface{}) *CreateTableQuery
func (*CreateTableQuery) TableSpace ¶
func (q *CreateTableQuery) TableSpace(tablespace string) *CreateTableQuery
func (*CreateTableQuery) Temp ¶
func (q *CreateTableQuery) Temp() *CreateTableQuery
func (*CreateTableQuery) Varchar ¶
func (q *CreateTableQuery) Varchar(n int) *CreateTableQuery
Varchar sets default length for VARCHAR columns.
func (*CreateTableQuery) WithForeignKeys ¶
func (q *CreateTableQuery) WithForeignKeys() *CreateTableQuery
WithForeignKeys adds a FOREIGN KEY clause for each of the model's existing relations.
type DB ¶
func (*DB) AddQueryHook ¶
func (*DB) ExecContext ¶
func (*DB) HasFeature ¶
HasFeature uses feature package to report whether the underlying DBMS supports this feature.
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) NewMerge ¶
func (db *DB) NewMerge() *MergeQuery
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{})
RegisterModel registers models by name so they can be referenced in table relations and fixtures.
func (*DB) RunInTx ¶
func (db *DB) RunInTx( ctx context.Context, opts *sql.TxOptions, fn func(ctx context.Context, tx Tx) error, ) error
RunInTx runs the function in a transaction. If the function returns an error, the transaction is rolled back. Otherwise, the transaction is committed.
func (*DB) UpdateFQN ¶
UpdateFQN 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 (*DB) WithNamedArg ¶
type DBOption ¶
type DBOption func(db *DB)
func WithDiscardUnknownColumns ¶
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) ApplyQueryBuilder ¶
func (q *DeleteQuery) ApplyQueryBuilder(fn func(QueryBuilder) QueryBuilder) *DeleteQuery
func (*DeleteQuery) Conn ¶
func (q *DeleteQuery) Conn(db IConn) *DeleteQuery
func (*DeleteQuery) Err ¶
func (q *DeleteQuery) Err(err error) *DeleteQuery
func (*DeleteQuery) ForceDelete ¶
func (q *DeleteQuery) ForceDelete() *DeleteQuery
func (*DeleteQuery) Model ¶
func (q *DeleteQuery) Model(model interface{}) *DeleteQuery
func (*DeleteQuery) ModelTableExpr ¶
func (q *DeleteQuery) ModelTableExpr(query string, args ...interface{}) *DeleteQuery
func (*DeleteQuery) Operation ¶
func (q *DeleteQuery) Operation() string
func (*DeleteQuery) QueryBuilder ¶
func (q *DeleteQuery) QueryBuilder() QueryBuilder
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) Scan ¶
func (q *DeleteQuery) Scan(ctx context.Context, dest ...interface{}) error
func (*DeleteQuery) String ¶
func (q *DeleteQuery) String() string
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(*DeleteQuery) *DeleteQuery) *DeleteQuery
func (*DeleteQuery) WhereOr ¶
func (q *DeleteQuery) WhereOr(query string, args ...interface{}) *DeleteQuery
func (*DeleteQuery) WherePK ¶
func (q *DeleteQuery) WherePK(cols ...string) *DeleteQuery
func (*DeleteQuery) With ¶
func (q *DeleteQuery) With(name string, query schema.QueryAppender) *DeleteQuery
func (*DeleteQuery) WithRecursive ¶
func (q *DeleteQuery) WithRecursive(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) AppendNamedArg ¶
func (*DropColumnQuery) AppendQuery ¶
func (*DropColumnQuery) Apply ¶
func (q *DropColumnQuery) Apply(fn func(*DropColumnQuery) *DropColumnQuery) *DropColumnQuery
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 ¶
func (q *DropColumnQuery) Conn(db IConn) *DropColumnQuery
func (*DropColumnQuery) Err ¶
func (q *DropColumnQuery) Err(err error) *DropColumnQuery
func (*DropColumnQuery) GetTableName ¶
func (q *DropColumnQuery) GetTableName() string
func (*DropColumnQuery) Model ¶
func (q *DropColumnQuery) Model(model interface{}) *DropColumnQuery
func (*DropColumnQuery) ModelTableExpr ¶
func (q *DropColumnQuery) ModelTableExpr(query string, args ...interface{}) *DropColumnQuery
func (*DropColumnQuery) NewAddColumn ¶
func (q *DropColumnQuery) NewAddColumn() *AddColumnQuery
func (*DropColumnQuery) NewCreateIndex ¶
func (q *DropColumnQuery) NewCreateIndex() *CreateIndexQuery
func (*DropColumnQuery) NewCreateTable ¶
func (q *DropColumnQuery) NewCreateTable() *CreateTableQuery
func (*DropColumnQuery) NewDelete ¶
func (q *DropColumnQuery) NewDelete() *DeleteQuery
func (*DropColumnQuery) NewDropColumn ¶
func (q *DropColumnQuery) NewDropColumn() *DropColumnQuery
func (*DropColumnQuery) NewDropIndex ¶
func (q *DropColumnQuery) NewDropIndex() *DropIndexQuery
func (*DropColumnQuery) NewDropTable ¶
func (q *DropColumnQuery) NewDropTable() *DropTableQuery
func (*DropColumnQuery) NewInsert ¶
func (q *DropColumnQuery) NewInsert() *InsertQuery
func (*DropColumnQuery) NewSelect ¶
func (q *DropColumnQuery) NewSelect() *SelectQuery
func (*DropColumnQuery) NewTruncateTable ¶
func (q *DropColumnQuery) NewTruncateTable() *TruncateTableQuery
func (*DropColumnQuery) NewUpdate ¶
func (q *DropColumnQuery) NewUpdate() *UpdateQuery
func (*DropColumnQuery) NewValues ¶
func (q *DropColumnQuery) NewValues(model interface{}) *ValuesQuery
func (*DropColumnQuery) Operation ¶
func (q *DropColumnQuery) Operation() string
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) AppendNamedArg ¶
func (*DropIndexQuery) AppendQuery ¶
func (*DropIndexQuery) Cascade ¶
func (q *DropIndexQuery) Cascade() *DropIndexQuery
func (*DropIndexQuery) Concurrently ¶
func (q *DropIndexQuery) Concurrently() *DropIndexQuery
func (*DropIndexQuery) Conn ¶
func (q *DropIndexQuery) Conn(db IConn) *DropIndexQuery
func (*DropIndexQuery) Err ¶
func (q *DropIndexQuery) Err(err error) *DropIndexQuery
func (*DropIndexQuery) GetTableName ¶
func (q *DropIndexQuery) GetTableName() string
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) NewAddColumn ¶
func (q *DropIndexQuery) NewAddColumn() *AddColumnQuery
func (*DropIndexQuery) NewCreateIndex ¶
func (q *DropIndexQuery) NewCreateIndex() *CreateIndexQuery
func (*DropIndexQuery) NewCreateTable ¶
func (q *DropIndexQuery) NewCreateTable() *CreateTableQuery
func (*DropIndexQuery) NewDelete ¶
func (q *DropIndexQuery) NewDelete() *DeleteQuery
func (*DropIndexQuery) NewDropColumn ¶
func (q *DropIndexQuery) NewDropColumn() *DropColumnQuery
func (*DropIndexQuery) NewDropIndex ¶
func (q *DropIndexQuery) NewDropIndex() *DropIndexQuery
func (*DropIndexQuery) NewDropTable ¶
func (q *DropIndexQuery) NewDropTable() *DropTableQuery
func (*DropIndexQuery) NewInsert ¶
func (q *DropIndexQuery) NewInsert() *InsertQuery
func (*DropIndexQuery) NewSelect ¶
func (q *DropIndexQuery) NewSelect() *SelectQuery
func (*DropIndexQuery) NewTruncateTable ¶
func (q *DropIndexQuery) NewTruncateTable() *TruncateTableQuery
func (*DropIndexQuery) NewUpdate ¶
func (q *DropIndexQuery) NewUpdate() *UpdateQuery
func (*DropIndexQuery) NewValues ¶
func (q *DropIndexQuery) NewValues(model interface{}) *ValuesQuery
func (*DropIndexQuery) Operation ¶
func (q *DropIndexQuery) Operation() string
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) AppendNamedArg ¶
func (*DropTableQuery) AppendQuery ¶
func (*DropTableQuery) Cascade ¶
func (q *DropTableQuery) Cascade() *DropTableQuery
func (*DropTableQuery) Conn ¶
func (q *DropTableQuery) Conn(db IConn) *DropTableQuery
func (*DropTableQuery) Err ¶
func (q *DropTableQuery) Err(err error) *DropTableQuery
func (*DropTableQuery) GetTableName ¶
func (q *DropTableQuery) GetTableName() string
func (*DropTableQuery) IfExists ¶
func (q *DropTableQuery) IfExists() *DropTableQuery
func (*DropTableQuery) Model ¶
func (q *DropTableQuery) Model(model interface{}) *DropTableQuery
func (*DropTableQuery) ModelTableExpr ¶
func (q *DropTableQuery) ModelTableExpr(query string, args ...interface{}) *DropTableQuery
func (*DropTableQuery) NewAddColumn ¶
func (q *DropTableQuery) NewAddColumn() *AddColumnQuery
func (*DropTableQuery) NewCreateIndex ¶
func (q *DropTableQuery) NewCreateIndex() *CreateIndexQuery
func (*DropTableQuery) NewCreateTable ¶
func (q *DropTableQuery) NewCreateTable() *CreateTableQuery
func (*DropTableQuery) NewDelete ¶
func (q *DropTableQuery) NewDelete() *DeleteQuery
func (*DropTableQuery) NewDropColumn ¶
func (q *DropTableQuery) NewDropColumn() *DropColumnQuery
func (*DropTableQuery) NewDropIndex ¶
func (q *DropTableQuery) NewDropIndex() *DropIndexQuery
func (*DropTableQuery) NewDropTable ¶
func (q *DropTableQuery) NewDropTable() *DropTableQuery
func (*DropTableQuery) NewInsert ¶
func (q *DropTableQuery) NewInsert() *InsertQuery
func (*DropTableQuery) NewSelect ¶
func (q *DropTableQuery) NewSelect() *SelectQuery
func (*DropTableQuery) NewTruncateTable ¶
func (q *DropTableQuery) NewTruncateTable() *TruncateTableQuery
func (*DropTableQuery) NewUpdate ¶
func (q *DropTableQuery) NewUpdate() *UpdateQuery
func (*DropTableQuery) NewValues ¶
func (q *DropTableQuery) NewValues(model interface{}) *ValuesQuery
func (*DropTableQuery) Operation ¶
func (q *DropTableQuery) Operation() string
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 IConn ¶
type IConn interface { QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error) QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row }
IConn is a common interface for *sql.DB, *sql.Conn, and *sql.Tx.
type IDB ¶
type IDB interface { IConn Dialect() schema.Dialect NewValues(model interface{}) *ValuesQuery NewSelect() *SelectQuery NewInsert() *InsertQuery NewUpdate() *UpdateQuery NewDelete() *DeleteQuery NewMerge() *MergeQuery NewRaw(query string, args ...interface{}) *RawQuery NewCreateTable() *CreateTableQuery NewDropTable() *DropTableQuery NewCreateIndex() *CreateIndexQuery NewDropIndex() *DropIndexQuery NewTruncateTable() *TruncateTableQuery NewAddColumn() *AddColumnQuery NewDropColumn() *DropColumnQuery BeginTx(ctx context.Context, opts *sql.TxOptions) (Tx, error) RunInTx(ctx context.Context, opts *sql.TxOptions, f func(ctx context.Context, tx Tx) error) error }
IDB is a common interface for *bun.DB, bun.Conn, and bun.Tx.
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) ColumnExpr ¶
func (q *InsertQuery) ColumnExpr(query string, args ...interface{}) *InsertQuery
func (*InsertQuery) Conn ¶
func (q *InsertQuery) Conn(db IConn) *InsertQuery
func (*InsertQuery) Err ¶
func (q *InsertQuery) Err(err error) *InsertQuery
func (*InsertQuery) ExcludeColumn ¶
func (q *InsertQuery) ExcludeColumn(columns ...string) *InsertQuery
func (*InsertQuery) Ignore ¶
func (q *InsertQuery) Ignore() *InsertQuery
Ignore generates different queries depending on the DBMS:
- On MySQL, it generates `INSERT IGNORE INTO`.
- On PostgreSQL, it generates `ON CONFLICT DO NOTHING`.
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 ¶
func (q *InsertQuery) On(s string, args ...interface{}) *InsertQuery
func (*InsertQuery) Operation ¶
func (q *InsertQuery) Operation() string
func (*InsertQuery) Replace ¶
func (q *InsertQuery) Replace() *InsertQuery
Replaces generates a `REPLACE INTO` query (MySQL and MariaDB).
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("")`.
func (*InsertQuery) Scan ¶
func (q *InsertQuery) Scan(ctx context.Context, dest ...interface{}) error
func (*InsertQuery) Set ¶
func (q *InsertQuery) Set(query string, args ...interface{}) *InsertQuery
func (*InsertQuery) String ¶
func (q *InsertQuery) String() string
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, expr string, args ...interface{}) *InsertQuery
Value overwrites model value for the column.
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
func (*InsertQuery) WithRecursive ¶
func (q *InsertQuery) WithRecursive(name string, query schema.QueryAppender) *InsertQuery
type MergeQuery ¶
type MergeQuery struct {
// contains filtered or unexported fields
}
func NewMergeQuery ¶
func NewMergeQuery(db *DB) *MergeQuery
func (*MergeQuery) AppendNamedArg ¶
func (*MergeQuery) AppendQuery ¶
func (*MergeQuery) Apply ¶
func (q *MergeQuery) Apply(fn func(*MergeQuery) *MergeQuery) *MergeQuery
Apply calls the fn passing the MergeQuery as an argument.
func (*MergeQuery) Conn ¶
func (q *MergeQuery) Conn(db IConn) *MergeQuery
func (*MergeQuery) Err ¶
func (q *MergeQuery) Err(err error) *MergeQuery
func (*MergeQuery) GetTableName ¶
func (q *MergeQuery) GetTableName() string
func (*MergeQuery) Model ¶
func (q *MergeQuery) Model(model interface{}) *MergeQuery
func (*MergeQuery) ModelTableExpr ¶
func (q *MergeQuery) ModelTableExpr(query string, args ...interface{}) *MergeQuery
func (*MergeQuery) NewAddColumn ¶
func (q *MergeQuery) NewAddColumn() *AddColumnQuery
func (*MergeQuery) NewCreateIndex ¶
func (q *MergeQuery) NewCreateIndex() *CreateIndexQuery
func (*MergeQuery) NewCreateTable ¶
func (q *MergeQuery) NewCreateTable() *CreateTableQuery
func (*MergeQuery) NewDelete ¶
func (q *MergeQuery) NewDelete() *DeleteQuery
func (*MergeQuery) NewDropColumn ¶
func (q *MergeQuery) NewDropColumn() *DropColumnQuery
func (*MergeQuery) NewDropIndex ¶
func (q *MergeQuery) NewDropIndex() *DropIndexQuery
func (*MergeQuery) NewDropTable ¶
func (q *MergeQuery) NewDropTable() *DropTableQuery
func (*MergeQuery) NewInsert ¶
func (q *MergeQuery) NewInsert() *InsertQuery
func (*MergeQuery) NewSelect ¶
func (q *MergeQuery) NewSelect() *SelectQuery
func (*MergeQuery) NewTruncateTable ¶
func (q *MergeQuery) NewTruncateTable() *TruncateTableQuery
func (*MergeQuery) NewUpdate ¶
func (q *MergeQuery) NewUpdate() *UpdateQuery
func (*MergeQuery) NewValues ¶
func (q *MergeQuery) NewValues(model interface{}) *ValuesQuery
func (*MergeQuery) On ¶
func (q *MergeQuery) On(s string, args ...interface{}) *MergeQuery
func (*MergeQuery) Operation ¶
func (q *MergeQuery) Operation() string
func (*MergeQuery) Returning ¶
func (q *MergeQuery) Returning(query string, args ...interface{}) *MergeQuery
Returning adds a RETURNING clause to the query.
To suppress the auto-generated RETURNING clause, use `Returning("NULL")`. Only for mssql output, postgres not supported returning in merge query
func (*MergeQuery) String ¶
func (q *MergeQuery) String() string
func (*MergeQuery) Table ¶
func (q *MergeQuery) Table(tables ...string) *MergeQuery
func (*MergeQuery) TableExpr ¶
func (q *MergeQuery) TableExpr(query string, args ...interface{}) *MergeQuery
func (*MergeQuery) Using ¶
func (q *MergeQuery) Using(s string, args ...interface{}) *MergeQuery
func (*MergeQuery) When ¶
func (q *MergeQuery) When(expr string, args ...interface{}) *MergeQuery
When for raw expression clause.
func (*MergeQuery) WhenDelete ¶
func (q *MergeQuery) WhenDelete(expr string) *MergeQuery
WhenDelete for when delete clause.
func (*MergeQuery) WhenInsert ¶
func (q *MergeQuery) WhenInsert(expr string, fn func(q *InsertQuery) *InsertQuery) *MergeQuery
WhenInsert for when insert clause.
func (*MergeQuery) WhenUpdate ¶
func (q *MergeQuery) WhenUpdate(expr string, fn func(q *UpdateQuery) *UpdateQuery) *MergeQuery
WhenUpdate for when update clause.
func (*MergeQuery) With ¶
func (q *MergeQuery) With(name string, query schema.QueryAppender) *MergeQuery
func (*MergeQuery) WithRecursive ¶
func (q *MergeQuery) WithRecursive(name string, query schema.QueryAppender) *MergeQuery
type QueryBuilder ¶
type QueryBuilder interface { Query Where(query string, args ...interface{}) QueryBuilder WhereGroup(sep string, fn func(QueryBuilder) QueryBuilder) QueryBuilder WhereOr(query string, args ...interface{}) QueryBuilder WhereDeleted() QueryBuilder WhereAllWithDeleted() QueryBuilder WherePK(cols ...string) QueryBuilder Unwrap() interface{} }
QueryBuilder is used for common query methods
type QueryEvent ¶
type QueryEvent struct { DB *DB QueryAppender schema.QueryAppender // DEPRECATED: use IQuery instead IQuery Query Query string QueryTemplate string QueryArgs []interface{} Model Model StartTime time.Time Result sql.Result Err error Stash map[interface{}]interface{} }
func (*QueryEvent) Operation ¶
func (e *QueryEvent) Operation() string
type QueryHook ¶
type QueryHook interface { BeforeQuery(context.Context, *QueryEvent) context.Context AfterQuery(context.Context, *QueryEvent) }
type RawQuery ¶
type RawQuery struct {
// contains filtered or unexported fields
}
func NewRawQuery ¶
func (*RawQuery) AppendNamedArg ¶
func (*RawQuery) AppendQuery ¶
func (*RawQuery) GetTableName ¶
func (q *RawQuery) GetTableName() string
func (*RawQuery) NewAddColumn ¶
func (q *RawQuery) NewAddColumn() *AddColumnQuery
func (*RawQuery) NewCreateIndex ¶
func (q *RawQuery) NewCreateIndex() *CreateIndexQuery
func (*RawQuery) NewCreateTable ¶
func (q *RawQuery) NewCreateTable() *CreateTableQuery
func (*RawQuery) NewDelete ¶
func (q *RawQuery) NewDelete() *DeleteQuery
func (*RawQuery) NewDropColumn ¶
func (q *RawQuery) NewDropColumn() *DropColumnQuery
func (*RawQuery) NewDropIndex ¶
func (q *RawQuery) NewDropIndex() *DropIndexQuery
func (*RawQuery) NewDropTable ¶
func (q *RawQuery) NewDropTable() *DropTableQuery
func (*RawQuery) NewInsert ¶
func (q *RawQuery) NewInsert() *InsertQuery
func (*RawQuery) NewSelect ¶
func (q *RawQuery) NewSelect() *SelectQuery
func (*RawQuery) NewTruncateTable ¶
func (q *RawQuery) NewTruncateTable() *TruncateTableQuery
func (*RawQuery) NewUpdate ¶
func (q *RawQuery) NewUpdate() *UpdateQuery
func (*RawQuery) NewValues ¶
func (q *RawQuery) NewValues(model interface{}) *ValuesQuery
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) ApplyQueryBuilder ¶
func (q *SelectQuery) ApplyQueryBuilder(fn func(QueryBuilder) QueryBuilder) *SelectQuery
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 ¶
func (q *SelectQuery) Conn(db IConn) *SelectQuery
func (*SelectQuery) Distinct ¶
func (q *SelectQuery) Distinct() *SelectQuery
func (*SelectQuery) DistinctOn ¶
func (q *SelectQuery) DistinctOn(query string, args ...interface{}) *SelectQuery
func (*SelectQuery) Err ¶
func (q *SelectQuery) Err(err error) *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) ForceIndex ¶
func (q *SelectQuery) ForceIndex(indexes ...string) *SelectQuery
func (*SelectQuery) ForceIndexForGroupBy ¶
func (q *SelectQuery) ForceIndexForGroupBy(indexes ...string) *SelectQuery
func (*SelectQuery) ForceIndexForJoin ¶
func (q *SelectQuery) ForceIndexForJoin(indexes ...string) *SelectQuery
func (*SelectQuery) ForceIndexForOrderBy ¶
func (q *SelectQuery) ForceIndexForOrderBy(indexes ...string) *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) IgnoreIndex ¶
func (q *SelectQuery) IgnoreIndex(indexes ...string) *SelectQuery
func (*SelectQuery) IgnoreIndexForGroupBy ¶
func (q *SelectQuery) IgnoreIndexForGroupBy(indexes ...string) *SelectQuery
func (*SelectQuery) IgnoreIndexForJoin ¶
func (q *SelectQuery) IgnoreIndexForJoin(indexes ...string) *SelectQuery
func (*SelectQuery) IgnoreIndexForOrderBy ¶
func (q *SelectQuery) IgnoreIndexForOrderBy(indexes ...string) *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) Operation ¶
func (q *SelectQuery) Operation() string
func (*SelectQuery) Order ¶
func (q *SelectQuery) Order(orders ...string) *SelectQuery
func (*SelectQuery) OrderExpr ¶
func (q *SelectQuery) OrderExpr(query string, args ...interface{}) *SelectQuery
func (*SelectQuery) QueryBuilder ¶
func (q *SelectQuery) QueryBuilder() QueryBuilder
func (*SelectQuery) Relation ¶
func (q *SelectQuery) Relation(name string, apply ...func(*SelectQuery) *SelectQuery) *SelectQuery
Relation adds a relation to the query.
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) String ¶
func (q *SelectQuery) String() string
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) UseIndex ¶
func (q *SelectQuery) UseIndex(indexes ...string) *SelectQuery
func (*SelectQuery) UseIndexForGroupBy ¶
func (q *SelectQuery) UseIndexForGroupBy(indexes ...string) *SelectQuery
func (*SelectQuery) UseIndexForJoin ¶
func (q *SelectQuery) UseIndexForJoin(indexes ...string) *SelectQuery
func (*SelectQuery) UseIndexForOrderBy ¶
func (q *SelectQuery) UseIndexForOrderBy(indexes ...string) *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(*SelectQuery) *SelectQuery) *SelectQuery
func (*SelectQuery) WhereOr ¶
func (q *SelectQuery) WhereOr(query string, args ...interface{}) *SelectQuery
func (*SelectQuery) WherePK ¶
func (q *SelectQuery) WherePK(cols ...string) *SelectQuery
func (*SelectQuery) With ¶
func (q *SelectQuery) With(name string, query schema.QueryAppender) *SelectQuery
func (*SelectQuery) WithRecursive ¶
func (q *SelectQuery) WithRecursive(name string, query schema.QueryAppender) *SelectQuery
type TableModel ¶
type TableModel interface { Model schema.BeforeAppendModelHook schema.BeforeScanRowHook schema.AfterScanRowHook ScanColumn(column string, src interface{}) error Table() *schema.Table Relation() *schema.Relation // contains filtered or unexported methods }
type TruncateTableQuery ¶
type TruncateTableQuery struct {
// contains filtered or unexported fields
}
func NewTruncateTableQuery ¶
func NewTruncateTableQuery(db *DB) *TruncateTableQuery
func (*TruncateTableQuery) AppendNamedArg ¶
func (*TruncateTableQuery) AppendQuery ¶
func (*TruncateTableQuery) Cascade ¶
func (q *TruncateTableQuery) Cascade() *TruncateTableQuery
func (*TruncateTableQuery) Conn ¶
func (q *TruncateTableQuery) Conn(db IConn) *TruncateTableQuery
func (*TruncateTableQuery) ContinueIdentity ¶
func (q *TruncateTableQuery) ContinueIdentity() *TruncateTableQuery
func (*TruncateTableQuery) Err ¶
func (q *TruncateTableQuery) Err(err error) *TruncateTableQuery
func (*TruncateTableQuery) GetTableName ¶
func (q *TruncateTableQuery) GetTableName() string
func (*TruncateTableQuery) Model ¶
func (q *TruncateTableQuery) Model(model interface{}) *TruncateTableQuery
func (*TruncateTableQuery) ModelTableExpr ¶
func (q *TruncateTableQuery) ModelTableExpr(query string, args ...interface{}) *TruncateTableQuery
func (*TruncateTableQuery) NewAddColumn ¶
func (q *TruncateTableQuery) NewAddColumn() *AddColumnQuery
func (*TruncateTableQuery) NewCreateIndex ¶
func (q *TruncateTableQuery) NewCreateIndex() *CreateIndexQuery
func (*TruncateTableQuery) NewCreateTable ¶
func (q *TruncateTableQuery) NewCreateTable() *CreateTableQuery
func (*TruncateTableQuery) NewDelete ¶
func (q *TruncateTableQuery) NewDelete() *DeleteQuery
func (*TruncateTableQuery) NewDropColumn ¶
func (q *TruncateTableQuery) NewDropColumn() *DropColumnQuery
func (*TruncateTableQuery) NewDropIndex ¶
func (q *TruncateTableQuery) NewDropIndex() *DropIndexQuery
func (*TruncateTableQuery) NewDropTable ¶
func (q *TruncateTableQuery) NewDropTable() *DropTableQuery
func (*TruncateTableQuery) NewInsert ¶
func (q *TruncateTableQuery) NewInsert() *InsertQuery
func (*TruncateTableQuery) NewSelect ¶
func (q *TruncateTableQuery) NewSelect() *SelectQuery
func (*TruncateTableQuery) NewTruncateTable ¶
func (q *TruncateTableQuery) NewTruncateTable() *TruncateTableQuery
func (*TruncateTableQuery) NewUpdate ¶
func (q *TruncateTableQuery) NewUpdate() *UpdateQuery
func (*TruncateTableQuery) NewValues ¶
func (q *TruncateTableQuery) NewValues(model interface{}) *ValuesQuery
func (*TruncateTableQuery) Operation ¶
func (q *TruncateTableQuery) Operation() string
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 ¶
func (Tx) NewAddColumn ¶
func (tx Tx) NewAddColumn() *AddColumnQuery
func (Tx) NewCreateIndex ¶
func (tx Tx) NewCreateIndex() *CreateIndexQuery
func (Tx) NewCreateTable ¶
func (tx Tx) NewCreateTable() *CreateTableQuery
func (Tx) NewDelete ¶
func (tx Tx) NewDelete() *DeleteQuery
func (Tx) NewDropColumn ¶
func (tx Tx) NewDropColumn() *DropColumnQuery
func (Tx) NewDropIndex ¶
func (tx Tx) NewDropIndex() *DropIndexQuery
func (Tx) NewDropTable ¶
func (tx Tx) NewDropTable() *DropTableQuery
func (Tx) NewInsert ¶
func (tx Tx) NewInsert() *InsertQuery
func (Tx) NewMerge ¶
func (tx Tx) NewMerge() *MergeQuery
func (Tx) NewSelect ¶
func (tx Tx) NewSelect() *SelectQuery
func (Tx) NewTruncateTable ¶
func (tx Tx) NewTruncateTable() *TruncateTableQuery
func (Tx) NewUpdate ¶
func (tx Tx) NewUpdate() *UpdateQuery
func (Tx) NewValues ¶
func (tx Tx) NewValues(model interface{}) *ValuesQuery
func (Tx) QueryContext ¶
func (Tx) QueryRowContext ¶
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) ApplyQueryBuilder ¶
func (q *UpdateQuery) ApplyQueryBuilder(fn func(QueryBuilder) QueryBuilder) *UpdateQuery
func (*UpdateQuery) Bulk ¶
func (q *UpdateQuery) Bulk() *UpdateQuery
func (*UpdateQuery) Column ¶
func (q *UpdateQuery) Column(columns ...string) *UpdateQuery
func (*UpdateQuery) Conn ¶
func (q *UpdateQuery) Conn(db IConn) *UpdateQuery
func (*UpdateQuery) Err ¶
func (q *UpdateQuery) Err(err error) *UpdateQuery
func (*UpdateQuery) ExcludeColumn ¶
func (q *UpdateQuery) ExcludeColumn(columns ...string) *UpdateQuery
func (*UpdateQuery) FQN ¶
func (q *UpdateQuery) FQN(column string) Ident
FQN returns a fully qualified column name, for example, table_name.column_name or table_alias.column_alias.
func (*UpdateQuery) ForceIndex ¶
func (q *UpdateQuery) ForceIndex(indexes ...string) *UpdateQuery
func (*UpdateQuery) IgnoreIndex ¶
func (q *UpdateQuery) IgnoreIndex(indexes ...string) *UpdateQuery
func (*UpdateQuery) Join ¶
func (q *UpdateQuery) Join(join string, args ...interface{}) *UpdateQuery
func (*UpdateQuery) JoinOn ¶
func (q *UpdateQuery) JoinOn(cond string, args ...interface{}) *UpdateQuery
func (*UpdateQuery) JoinOnOr ¶
func (q *UpdateQuery) JoinOnOr(cond string, args ...interface{}) *UpdateQuery
func (*UpdateQuery) Model ¶
func (q *UpdateQuery) Model(model interface{}) *UpdateQuery
func (*UpdateQuery) ModelTableExpr ¶
func (q *UpdateQuery) ModelTableExpr(query string, args ...interface{}) *UpdateQuery
func (*UpdateQuery) OmitZero ¶
func (q *UpdateQuery) OmitZero() *UpdateQuery
func (*UpdateQuery) Operation ¶
func (q *UpdateQuery) Operation() string
func (*UpdateQuery) QueryBuilder ¶
func (q *UpdateQuery) QueryBuilder() QueryBuilder
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) Scan ¶
func (q *UpdateQuery) Scan(ctx context.Context, dest ...interface{}) error
func (*UpdateQuery) Set ¶
func (q *UpdateQuery) Set(query string, args ...interface{}) *UpdateQuery
func (*UpdateQuery) SetColumn ¶
func (q *UpdateQuery) SetColumn(column string, query string, args ...interface{}) *UpdateQuery
func (*UpdateQuery) String ¶
func (q *UpdateQuery) String() string
func (*UpdateQuery) Table ¶
func (q *UpdateQuery) Table(tables ...string) *UpdateQuery
func (*UpdateQuery) TableExpr ¶
func (q *UpdateQuery) TableExpr(query string, args ...interface{}) *UpdateQuery
func (*UpdateQuery) UseIndex ¶
func (q *UpdateQuery) UseIndex(indexes ...string) *UpdateQuery
func (*UpdateQuery) Value ¶
func (q *UpdateQuery) Value(column string, query string, args ...interface{}) *UpdateQuery
Value overwrites model value for the column.
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(*UpdateQuery) *UpdateQuery) *UpdateQuery
func (*UpdateQuery) WhereOr ¶
func (q *UpdateQuery) WhereOr(query string, args ...interface{}) *UpdateQuery
func (*UpdateQuery) WherePK ¶
func (q *UpdateQuery) WherePK(cols ...string) *UpdateQuery
func (*UpdateQuery) With ¶
func (q *UpdateQuery) With(name string, query schema.QueryAppender) *UpdateQuery
func (*UpdateQuery) WithRecursive ¶
func (q *UpdateQuery) WithRecursive(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) AppendNamedArg ¶
func (*ValuesQuery) AppendQuery ¶
func (*ValuesQuery) Column ¶
func (q *ValuesQuery) Column(columns ...string) *ValuesQuery
func (*ValuesQuery) Conn ¶
func (q *ValuesQuery) Conn(db IConn) *ValuesQuery
func (*ValuesQuery) Err ¶
func (q *ValuesQuery) Err(err error) *ValuesQuery
func (*ValuesQuery) GetTableName ¶
func (q *ValuesQuery) GetTableName() string
func (*ValuesQuery) NewAddColumn ¶
func (q *ValuesQuery) NewAddColumn() *AddColumnQuery
func (*ValuesQuery) NewCreateIndex ¶
func (q *ValuesQuery) NewCreateIndex() *CreateIndexQuery
func (*ValuesQuery) NewCreateTable ¶
func (q *ValuesQuery) NewCreateTable() *CreateTableQuery
func (*ValuesQuery) NewDelete ¶
func (q *ValuesQuery) NewDelete() *DeleteQuery
func (*ValuesQuery) NewDropColumn ¶
func (q *ValuesQuery) NewDropColumn() *DropColumnQuery
func (*ValuesQuery) NewDropIndex ¶
func (q *ValuesQuery) NewDropIndex() *DropIndexQuery
func (*ValuesQuery) NewDropTable ¶
func (q *ValuesQuery) NewDropTable() *DropTableQuery
func (*ValuesQuery) NewInsert ¶
func (q *ValuesQuery) NewInsert() *InsertQuery
func (*ValuesQuery) NewSelect ¶
func (q *ValuesQuery) NewSelect() *SelectQuery
func (*ValuesQuery) NewTruncateTable ¶
func (q *ValuesQuery) NewTruncateTable() *TruncateTableQuery
func (*ValuesQuery) NewUpdate ¶
func (q *ValuesQuery) NewUpdate() *UpdateQuery
func (*ValuesQuery) NewValues ¶
func (q *ValuesQuery) NewValues(model interface{}) *ValuesQuery
func (*ValuesQuery) Operation ¶
func (q *ValuesQuery) Operation() string
func (*ValuesQuery) Value ¶
func (q *ValuesQuery) Value(column string, expr string, args ...interface{}) *ValuesQuery
Value overwrites model value for the column.
func (*ValuesQuery) WithOrder ¶
func (q *ValuesQuery) WithOrder() *ValuesQuery
Source Files ¶
- bun.go
- db.go
- hook.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_merge.go
- query_raw.go
- query_select.go
- query_table_create.go
- query_table_drop.go
- query_table_truncate.go
- query_update.go
- query_values.go
- relation_join.go
- util.go
- version.go