Documentation
¶
Index ¶
- type Db
- type DbConnection
- type DbQuery
- func (q *DbQuery) Alias(alias string) *DbQuery
- func (q *DbQuery) Builder(dbConnection *DbConnection)
- func (q *DbQuery) Count() int
- func (q *DbQuery) CreateDBTx() (context.Context, *sql.Tx, error)
- func (q *DbQuery) Del() (sql.Result, error)
- func (q *DbQuery) Exec(sql string, args ...interface{}) (sql.Result, error)
- func (q *DbQuery) Field(field string) *DbQuery
- func (q *DbQuery) Find() (map[string]interface{}, error)
- func (q *DbQuery) GetRow(query *sql.Rows) map[string]interface{}
- func (q *DbQuery) GetRows(query *sql.Rows) []map[string]interface{}
- func (q *DbQuery) Group(group string) *DbQuery
- func (q *DbQuery) Having(h string, v interface{}) *DbQuery
- func (q *DbQuery) In(in string, v []interface{}) *DbQuery
- func (q *DbQuery) Join(jType string, table string, on string) *DbQuery
- func (q *DbQuery) Limit(limit string) *DbQuery
- func (q *DbQuery) Or(or string, v ...interface{}) *DbQuery
- func (q *DbQuery) OrIn(in string, v []interface{}) *DbQuery
- func (q *DbQuery) Order(order string) *DbQuery
- func (q *DbQuery) Query(sql string, args ...interface{}) ([]map[string]interface{}, error)
- func (q *DbQuery) Save(save map[string]interface{}) (sql.Result, error)
- func (q *DbQuery) Select() ([]map[string]interface{}, error)
- func (q *DbQuery) SelectSql() string
- func (q *DbQuery) Size(page int, size int) *DbQuery
- func (q *DbQuery) Table(table string) *DbQuery
- func (q *DbQuery) TxSave(ctx context.Context, tx *sql.Tx, save map[string]interface{}) (sql.Result, error)
- func (q *DbQuery) TxUpdate(ctx context.Context, tx *sql.Tx, update map[string]interface{}, ...) (sql.Result, error)
- func (q *DbQuery) Update(update map[string]interface{}) (sql.Result, error)
- func (q *DbQuery) Where(wher string, v ...interface{}) *DbQuery
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Db ¶
type Db struct {
DbConn *DbConnection
// DbQuery DbQuery
Dbconfig *map[string]interface{}
}
type DbConnection ¶
创建连接器
type DbQuery ¶
type DbQuery struct {
Wher string
Joinn string
DB *sql.DB
Rows interface{}
Row interface{}
Prefix string
sync.RWMutex
// contains filtered or unexported fields
}
构建查询器
func (*DbQuery) Builder ¶
func (q *DbQuery) Builder(dbConnection *DbConnection)
func (*DbQuery) TxSave ¶
func (q *DbQuery) TxSave(ctx context.Context, tx *sql.Tx, save map[string]interface{}) (sql.Result, error)
事务写入
func (*DbQuery) TxUpdate ¶
func (q *DbQuery) TxUpdate(ctx context.Context, tx *sql.Tx, update map[string]interface{}, where ...interface{}) (sql.Result, error)
事务更新
Click to show internal directories.
Click to hide internal directories.