Documentation ¶
Index ¶
- Variables
- func ErrNoRowsFilter(err error) error
- func GetAddSQLFromObj(tableName string, o interface{}, addType string) string
- func GetColumnListExpressionFromObj(o interface{}) exp.ColumnListExpression
- func GetColumnsArrayFromObj(o interface{}) []string
- func GetColumnsArrayInterfaceFromObj(o interface{}) []interface{}
- func GetColumnsFromObj(o interface{}) string
- func GetInsertSQLFromObj(tableName string, o interface{}) string
- func GetReplaceInsertSQLFromObj(tableName string, o interface{}) string
- func GetSqlSelect(o interface{}, table string) string
- func HasOptLockUpdateSuccess(result sql.Result, err error) error
- func MysqlDialect() *goqu.DialectWrapper
- type Repository
- func (r *Repository) Close()
- func (r *Repository) Exec(sqlStr string, args ...interface{}) (sql.Result, error)
- func (r *Repository) ExecNamed(sqlStr string, args interface{}) (sql.Result, error)
- func (r *Repository) Get(sqlStr string, obj interface{}, args ...interface{}) error
- func (r *Repository) Select(sqlStr string, obj interface{}, args ...interface{}) error
- type StmtDB
- func (r *StmtDB) Close()
- func (r *StmtDB) DB() *sqlx.DB
- func (r *StmtDB) Exec(sqlStr string, args []interface{}) (sql.Result, error)
- func (r *StmtDB) ExecNamed(sqlStr string, args interface{}) (sql.Result, error)
- func (r *StmtDB) Get(sqlStr string, obj interface{}, args []interface{}) error
- func (r *StmtDB) GetNamedStmt(sqlPrepared string) (*sqlx.NamedStmt, error)
- func (r *StmtDB) GetStmt(sqlPrepared string) (*sqlx.Stmt, error)
- func (r *StmtDB) Select(sqlStr string, obj interface{}, args []interface{}) error
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrCanNotPrepared = errors.New("can't prepare in condition")
)
Functions ¶
func GetAddSQLFromObj ¶
func GetColumnListExpressionFromObj ¶
func GetColumnListExpressionFromObj(o interface{}) exp.ColumnListExpression
GetColumnListExpressionFromObj 根据对象获取goqu的字段表达式
func GetColumnsArrayFromObj ¶
func GetColumnsArrayFromObj(o interface{}) []string
GetColumnsFromObj2 获取所有字段数组
func GetColumnsArrayInterfaceFromObj ¶
func GetColumnsArrayInterfaceFromObj(o interface{}) []interface{}
GetColumnsFromObj2 获取所有字段数组
func GetInsertSQLFromObj ¶
GetInsertSQLFromObj 获取插入语句
func HasOptLockUpdateSuccess ¶
判断乐观锁是否更新成功
func MysqlDialect ¶
func MysqlDialect() *goqu.DialectWrapper
Types ¶
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
func NewRepository ¶
func NewRepository(db *sqlx.DB) *Repository
func (*Repository) Close ¶ added in v1.4.2
func (r *Repository) Close()
func (*Repository) Exec ¶
func (r *Repository) Exec(sqlStr string, args ...interface{}) (sql.Result, error)
func (*Repository) ExecNamed ¶
func (r *Repository) ExecNamed(sqlStr string, args interface{}) (sql.Result, error)
func (*Repository) Get ¶
func (r *Repository) Get(sqlStr string, obj interface{}, args ...interface{}) error
func (*Repository) Select ¶
func (r *Repository) Select(sqlStr string, obj interface{}, args ...interface{}) error
Click to show internal directories.
Click to hide internal directories.