Documentation ¶
Index ¶
- type DB
- func (db *DB) BeginTxx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)
- func (db *DB) Beginx() (*Tx, error)
- func (db *DB) GetMapper() *reflectx.Mapper
- func (db *DB) Insert(m Modeler) (sql.Result, error)
- func (db *DB) InsertContext(ctx context.Context, m Modeler) (sql.Result, error)
- func (db *DB) MustBegin() *Tx
- func (db *DB) Update(m Modeler) (sql.Result, error)
- func (db *DB) UpdateContext(ctx context.Context, m Modeler) (sql.Result, error)
- type Modeler
- type Tx
- func (tx *Tx) GetMapper() *reflectx.Mapper
- func (tx *Tx) Insert(m Modeler) (sql.Result, error)
- func (tx *Tx) InsertContext(ctx context.Context, m Modeler) (sql.Result, error)
- func (tx *Tx) Update(m Modeler) (sql.Result, error)
- func (tx *Tx) UpdateContext(ctx context.Context, m Modeler) (sql.Result, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
DB 扩展 sqlx.DB
func (*DB) InsertContext ¶
InsertContext 生成并执行 insert 语句
type Modeler ¶
type Modeler interface { // TableName 返回表名 TableName() string // TableName 返回主键字段名 KeyName() string }
Modeler 接口提供查询模型的表结构信息 所有模型都需要实现本接口
Click to show internal directories.
Click to hide internal directories.