本文整理匯總了Golang中github.com/cosiner/gomodel.Executor類的典型用法代碼示例。如果您正苦於以下問題:Golang Executor類的具體用法?Golang Executor怎麽用?Golang Executor使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了Executor類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: PrimaryKey
func PrimaryKey(exec gomodel.Executor) string {
return exec.Driver().PrimaryKey()
}
示例2: QueryOneResultById
func QueryOneResultById(exec gomodel.Executor, sqlid uint64, ptr interface{}, args ...interface{}) error {
sc := exec.QueryById(sqlid, args...)
defer sc.Close()
return sc.One(ptr)
}
示例3: DuplicatePrimaryKeyError
func DuplicatePrimaryKeyError(exec gomodel.Executor, err error, newErr error) error {
pk := exec.Driver().PrimaryKey()
return parseKeyError(err, pk, newErr, exec.Driver().DuplicateKey)
}
示例4: ForeignKeyError
func ForeignKeyError(exec gomodel.Executor, err error, key string, newErr error) error {
fk := exec.Driver().ForeignKey
return parseKeyError(err, key, newErr, fk)
}
示例5: ForeignKeyFunc
func ForeignKeyFunc(exec gomodel.Executor, err error, keyfunc func(key string) error) error {
fk := exec.Driver().ForeignKey
return parseKeyFunc(err, keyfunc, fk)
}
示例6: DuplicateKeyError
func DuplicateKeyError(exec gomodel.Executor, err error, key string, newErr error) error {
dk := exec.Driver().DuplicateKey
return parseKeyError(err, key, newErr, dk)
}
示例7: DuplicateKeyFunc
func DuplicateKeyFunc(exec gomodel.Executor, err error, keyfunc func(key string) error) error {
dk := exec.Driver().DuplicateKey
return parseKeyFunc(err, keyfunc, dk)
}