Documentation ¶
Overview ¶
package gosql mysql工具包..引用"github.com/go-sql-driver/mysql"
Index ¶
- Constants
- Variables
- func Connect(host, username, password, db string, other ...string) (db.SQL, error)
- func ExecResultHasError(execresult db.ExecResult, reportZeroChange bool, param ...map[string]string) error
- func GetDuplicateField(errmsg string) string
- func SelectSQL(obj interface{}, tablename ...string) *bytes.Buffer
- func SetSQL(obj interface{}) (string, []interface{})
- func Update(table string, obj interface{}) (string, []interface{}, error)
- func WhereIN(field string, values string, args []interface{}, bs *bytes.Buffer, ...) (*bytes.Buffer, []interface{})
Constants ¶
View Source
const ( DuplicateErrorCode = 1062 //字段重复 PRIMARY = "primary" )
Variables ¶
View Source
var DuplicateField = errors.New("字段重复")
View Source
var SQLEmptyChange = errors.New("数据无变化")
Functions ¶
func ExecResultHasError ¶
func ExecResultHasError(execresult db.ExecResult, reportZeroChange bool, param ...map[string]string) error
执行结果是否有错误
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.