Documentation ¶
Index ¶
- type Db
- type DbConnection
- type DbQuery
- type ExQuery
- func (q *ExQuery) Alias(alias string) *ExQuery
- func (sqlstruct *ExQuery) Clearquery()
- func (q *ExQuery) Count() (int, error)
- func (q *ExQuery) CreateDBTx() (*ExQuery, error)
- func (q *ExQuery) Del() (sql.Result, error)
- func (q *ExQuery) Exec(sql string, args ...interface{}) (sql.Result, error)
- func (q *ExQuery) Field(field string) *ExQuery
- func (q *ExQuery) Find() (map[string]interface{}, error)
- func (q *ExQuery) Fun(f func(query *ExQuery) *ExQuery) *ExQuery
- func (q *ExQuery) GetRow(query *sql.Rows) map[string]interface{}
- func (q *ExQuery) GetRows(query *sql.Rows) []map[string]interface{}
- func (q *ExQuery) Group(group string) *ExQuery
- func (q *ExQuery) Having(h string, v interface{}) *ExQuery
- func (q *ExQuery) In(in string, v []interface{}) *ExQuery
- func (q *ExQuery) Join(jType string, table string, on string) *ExQuery
- func (q *ExQuery) Limit(limit string) *ExQuery
- func (q *ExQuery) Or(or string, v ...interface{}) *ExQuery
- func (q *ExQuery) OrIn(in string, v []interface{}) *ExQuery
- func (q *ExQuery) Order(order string) *ExQuery
- func (q *ExQuery) Query(sql string, args ...interface{}) ([]map[string]interface{}, error)
- func (q *ExQuery) Save(save map[string]interface{}) (sql.Result, error)
- func (q *ExQuery) Select() ([]map[string]interface{}, error)
- func (q *ExQuery) SelectSql() string
- func (q *ExQuery) Size(page int, size int) *ExQuery
- func (q *ExQuery) Table(table string) *ExQuery
- func (q *ExQuery) TxCommit() error
- func (q *ExQuery) TxRollback() error
- func (q *ExQuery) TxSave(save map[string]interface{}) (sql.Result, error)
- func (q *ExQuery) TxUpdate(update map[string]interface{}, where ...interface{}) (sql.Result, error)
- func (q *ExQuery) Update(update map[string]interface{}) (sql.Result, error)
- func (q *ExQuery) Value(key string) (interface{}, error)
- func (q *ExQuery) Where(wher string, v ...interface{}) *ExQuery
- func (q *ExQuery) WhereOr(f func(query *ExQuery) *ExQuery) *ExQuery
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 ¶
构建查询器
func (*DbQuery) Builder ¶
func (q *DbQuery) Builder(dbConnection *DbConnection)
dbConnection.DB.PingContext(ctx) 防止ping阻塞
type ExQuery ¶ added in v1.0.11
type ExQuery struct { Wher string Joinn string Rows interface{} Row interface{} Prefix string DB *sql.DB Ctx context.Context Tx *sql.Tx sync.RWMutex // contains filtered or unexported fields }
执行器
func (*ExQuery) Clearquery ¶ added in v1.0.11
func (sqlstruct *ExQuery) Clearquery()
func (*ExQuery) CreateDBTx ¶ added in v1.0.11
创建事务 注意,不能用q.DB.Conn(ctx) 否则会创建 新的连接并不会释放
Click to show internal directories.
Click to hide internal directories.