Documentation
¶
Index ¶
- Variables
- func BulkInsert(db *gorm.DB, table string, fields []string, params []map[string]interface{}) error
- func BulkSave(db *gorm.DB, table string, fields []string, params []map[string]interface{}) error
- func GetMysql(ctx context.Context, dbName string) *gorm.DB
- func Transaction(ctx context.Context, f func(context.Context) error) (err error)
- func Validate(data, model interface{}) bool
- type Client
- type DefaultClient
- type GetMysqlDB
- type Map
- type MysqlClient
- type Option
- type TransactionKeyType
Constants ¶
This section is empty.
Variables ¶
View Source
var (
FieldsError = fmt.Errorf("fileds length is 0")
)
View Source
var MysqlMap sync.Map
Functions ¶
func BulkInsert ¶
@desc @auth liuguoqiang 2020-11-27 @param @return
func Transaction ¶ added in v1.1.10
注意:该事务不是并发安全的
Types ¶
type DefaultClient ¶
type DefaultClient struct {
Client
}
type MysqlClient ¶
func NewMysqlClient ¶
func NewMysqlClient(config *emysql_config.Config, options ...Option) (*MysqlClient, error)
NewMysqlClient ...
func (*MysqlClient) WithContext ¶
func (m *MysqlClient) WithContext(ctx context.Context) *MysqlClient
WithContext ...
type Option ¶
type Option func(c *emysql_config.Config)
Option 可选项
func WithInterceptor ¶
func WithInterceptor(is ...emysql_config.Interceptor) Option
WithInterceptor 设置自定义拦截器
type TransactionKeyType ¶ added in v1.1.10
type TransactionKeyType string
const TxDBMap TransactionKeyType = "TxDBMap"
const TxOpen TransactionKeyType = "TxOpen"
Source Files
¶
Click to show internal directories.
Click to hide internal directories.