Documentation ¶
Index ¶
- Variables
- func AddDatabaseType(databaseType *DatabaseType) (err error)
- func Convert(src string) (string, error)
- func DoQueryPageStructs(db *sql.DB, dia dialect.Dialect, sqlInfo string, args []interface{}, ...) (err error)
- func DoQueryStruct(db *sql.DB, sqlInfo string, args []interface{}, str interface{}) (find bool, err error)
- func DoQueryStructs(db *sql.DB, sqlInfo string, args []interface{}, list interface{}) (err error)
- func EndTxContext(ctx context.Context, rollback bool) (err error)
- func GetListStructType(list interface{}) reflect.Type
- func NewServiceScript(config interface{}) (res map[string]interface{}, err error)
- func OpenTxContext(ctx context.Context) (res context.Context, err error)
- func RowsToListMap(rows *sql.Rows, selectDataMax int) (dataSize int, columnList []map[string]interface{}, ...)
- func SetStructColumnValues(columnValueMap map[string]interface{}, strValue reflect.Value)
- func ToColumnModel(data interface{}) (res *dialect.ColumnModel)
- func ToIndexModel(data interface{}) (res *dialect.IndexModel)
- func ToOwnerModel(data interface{}) (res *dialect.OwnerModel)
- func ToPage(data interface{}) (res *worker.Page)
- func ToPrimaryKeyModel(data interface{}) (res *dialect.PrimaryKeyModel)
- func ToTableModel(data interface{}) (res *dialect.TableModel)
- func ToTaskExportParam(data interface{}) (res *worker.TaskExportParam)
- func ToTaskImportParam(data interface{}) (res *worker.TaskImportParam)
- func ToTaskSyncParam(data interface{}) (res *worker.TaskSyncParam)
- type Config
- type DataListResult
- type DatabaseType
- type ExecuteOptions
- type FieldColumn
- type IService
- type Page
- type Param
- type ScriptVar
- type Service
- func (this_ *Service) Close()
- func (this_ *Service) Count(sql string, args []interface{}) (count int64, err error)
- func (this_ *Service) DDL(param *Param, ownerName string, tableName string) (sqlList []string, err error)
- func (this_ *Service) DataListExec(param *Param, ownerName string, tableName string, ...) (err error)
- func (this_ *Service) DataListSql(param *Param, ownerName string, tableName string, ...) (sqlList []string, err error)
- func (this_ *Service) Exec(sql string, args []interface{}) (rowsAffected int64, err error)
- func (this_ *Service) Execs(sqlList []string, argsList [][]interface{}) (rowsAffected int64, err error)
- func (this_ *Service) ExecuteSQL(param *Param, ownerName string, sqlContent string, options *ExecuteOptions) (executeList []map[string]interface{}, errStr string, err error)
- func (this_ *Service) GetConfig() Config
- func (this_ *Service) GetDb() *sql.DB
- func (this_ *Service) GetDialect() dialect.Dialect
- func (this_ *Service) GetTargetDialect(param *Param) (dia dialect.Dialect)
- func (this_ *Service) Info() (res interface{}, err error)
- func (this_ *Service) Model(param *Param, ownerName string, tableName string) (content string, err error)
- func (this_ *Service) NewTestExecutor(options *TestTaskOptions) (testExecutor *TestExecutor, err error)
- func (this_ *Service) OwnerCreate(param *Param, owner *dialect.OwnerModel) (created bool, err error)
- func (this_ *Service) OwnerCreateSql(param *Param, owner *dialect.OwnerModel) (sqlList []string, err error)
- func (this_ *Service) OwnerDataTrim(param *Param, ownerName string) (err error)
- func (this_ *Service) OwnerDelete(param *Param, ownerName string) (deleted bool, err error)
- func (this_ *Service) OwnersSelect(param *Param) (owners []*dialect.OwnerModel, err error)
- func (this_ *Service) Query(sql string, args []interface{}, list interface{}) (err error)
- func (this_ *Service) QueryMap(sql string, args []interface{}) (list []map[string]interface{}, err error)
- func (this_ *Service) QueryMapPage(sql string, args []interface{}, page *worker.Page) (list []map[string]interface{}, err error)
- func (this_ *Service) QueryOne(sql string, args []interface{}, one interface{}) (find bool, err error)
- func (this_ *Service) QueryPage(sql string, args []interface{}, list interface{}, page *worker.Page) (err error)
- func (this_ *Service) StartExport(param *Param, exportParam *worker.TaskExportParam) (task *worker.Task, err error)
- func (this_ *Service) StartImport(param *Param, importParam *worker.TaskImportParam) (task *worker.Task, err error)
- func (this_ *Service) StartSync(param *Param, syncParam *worker.TaskSyncParam) (task *worker.Task, err error)
- func (this_ *Service) TableCreate(param *Param, ownerName string, table *dialect.TableModel) (err error)
- func (this_ *Service) TableCreateSql(param *Param, ownerName string, table *dialect.TableModel) (sqlList []string, err error)
- func (this_ *Service) TableData(param *Param, ownerName string, tableName string, ...) (dataListResult DataListResult, err error)
- func (this_ *Service) TableDataTrim(param *Param, ownerName string, tableName string) (err error)
- func (this_ *Service) TableDelete(param *Param, ownerName string, tableName string) (err error)
- func (this_ *Service) TableDetail(param *Param, ownerName string, tableName string) (tableDetail *dialect.TableModel, err error)
- func (this_ *Service) TableUpdate(param *Param, ownerName string, tableName string, ...) (err error)
- func (this_ *Service) TableUpdateSql(param *Param, ownerName string, tableName string, ...) (sqlList []string, err error)
- func (this_ *Service) TablesSelect(param *Param, ownerName string) (tables []*dialect.TableModel, err error)
- type SqlConditionalOperation
- type SqlParamParser
- type StructInfo
- type Template
- func (this_ *Template[T]) BatchInsert(ctx context.Context, table string, obj []any, ignoreColumns ...string) (res int64, err error)
- func (this_ *Template[T]) Delete(ctx context.Context, table string, whereSql string, whereParam any) (res int64, err error)
- func (this_ *Template[T]) Exec(ctx context.Context, execSql string, execArgs []any) (res int64, err error)
- func (this_ *Template[T]) ExecList(ctx context.Context, execSql string, execArgsList [][]any) (res int64, err error)
- func (this_ *Template[T]) GetColumnsSql() (columnsSql string)
- func (this_ *Template[T]) Insert(ctx context.Context, table string, obj any, ignoreColumns ...string) (res int64, err error)
- func (this_ *Template[T]) QueryCount(ctx context.Context, querySql string, queryArgs []interface{}) (count int, err error)
- func (this_ *Template[T]) QueryList(ctx context.Context, querySql string, queryArgs []interface{}) (res []T, err error)
- func (this_ *Template[T]) QueryOne(ctx context.Context, querySql string, queryArgs []interface{}) (res T, err error)
- func (this_ *Template[T]) QueryPage(ctx context.Context, querySql string, queryArgs []interface{}, pageSize int, ...) (res []T, err error)
- func (this_ *Template[T]) QueryPageBean(ctx context.Context, querySql string, queryArgs []interface{}, pageSize int, ...) (res *Page[T], err error)
- func (this_ *Template[T]) SelectList(ctx context.Context, sqlParamSql string, sqlParam any) (res []T, err error)
- func (this_ *Template[T]) SelectOne(ctx context.Context, sqlParamSql string, sqlParam any) (res T, err error)
- func (this_ *Template[T]) SelectPage(ctx context.Context, sqlParamSql string, sqlParam any, pageSize int, ...) (res []T, err error)
- func (this_ *Template[T]) SelectPageBean(ctx context.Context, sqlParamSql string, sqlParam any, pageSize int, ...) (res *Page[T], err error)
- func (this_ *Template[T]) Update(ctx context.Context, table string, obj any, whereSql string, whereParam any, ...) (res int64, err error)
- type TemplateOptions
- func (this_ *TemplateOptions) GetBatchColumnValues(many any, ignoreColumns ...string) (columnsSql string, valuesList [][]any)
- func (this_ *TemplateOptions) GetBatchInsertSql(table string, many any, ignoreColumns ...string) (insertSql string, sqlArgsList [][]any)
- func (this_ *TemplateOptions) GetColumnValues(obj any, isUpdate bool, ignoreColumns ...string) (columnsSql string, values []any)
- func (this_ *TemplateOptions) GetDeleteSql(table string, whereParser *SqlParamParser) (deleteSql string, sqlArgs []any, err error)
- func (this_ *TemplateOptions) GetInsertSql(table string, obj any, ignoreColumns ...string) (insertSql string, sqlArgs []any)
- func (this_ *TemplateOptions) GetMapColumns(v any) (fieldColumns []*FieldColumn)
- func (this_ *TemplateOptions) GetStructInfo(structType reflect.Type) (info *StructInfo)
- func (this_ *TemplateOptions) GetUpdateSql(table string, obj any, whereParser *SqlParamParser, ignoreColumns ...string) (updateSql string, sqlArgs []any, err error)
- func (this_ *TemplateOptions) SqlParamParser(sql string, param any) (res *SqlParamParser)
- func (this_ *TemplateOptions) ValueIsNull(column *FieldColumn, vField reflect.Value) bool
- type TestExecutor
- func (this_ *TestExecutor) After(param *task.ExecutorParam) (err error)
- func (this_ *TestExecutor) Before(param *task.ExecutorParam) (err error)
- func (this_ *TestExecutor) Close()
- func (this_ *TestExecutor) Execute(param *task.ExecutorParam) (err error)
- func (this_ *TestExecutor) GetNextIndex() (index int)
- type TestTask
- type TestTaskOptions
- type TestWorkerParam
- type TxInfo
- type UpdateTableColumn
- type UpdateTableIndex
- type UpdateTableParam
Constants ¶
This section is empty.
Variables ¶
View Source
var (
DatabaseTypes []*DatabaseType
)
View Source
var (
FileUploadDir string
)
View Source
var (
SqlConditionalOperations []*SqlConditionalOperation
)
Functions ¶
func AddDatabaseType ¶ added in v0.7.6
func AddDatabaseType(databaseType *DatabaseType) (err error)
func DoQueryPageStructs ¶ added in v1.2.17
func DoQueryStruct ¶ added in v1.2.17
func DoQueryStructs ¶ added in v1.2.17
func EndTxContext ¶ added in v1.2.16
func GetListStructType ¶ added in v1.2.17
func NewServiceScript ¶ added in v0.5.7
func OpenTxContext ¶ added in v1.2.16
func RowsToListMap ¶ added in v0.6.3
func SetStructColumnValues ¶ added in v1.2.17
func ToColumnModel ¶ added in v0.5.8
func ToColumnModel(data interface{}) (res *dialect.ColumnModel)
func ToIndexModel ¶ added in v0.5.8
func ToIndexModel(data interface{}) (res *dialect.IndexModel)
func ToOwnerModel ¶ added in v0.5.8
func ToOwnerModel(data interface{}) (res *dialect.OwnerModel)
func ToPrimaryKeyModel ¶ added in v0.5.8
func ToPrimaryKeyModel(data interface{}) (res *dialect.PrimaryKeyModel)
func ToTableModel ¶ added in v0.5.8
func ToTableModel(data interface{}) (res *dialect.TableModel)
func ToTaskExportParam ¶ added in v0.5.8
func ToTaskExportParam(data interface{}) (res *worker.TaskExportParam)
func ToTaskImportParam ¶ added in v0.5.8
func ToTaskImportParam(data interface{}) (res *worker.TaskImportParam)
func ToTaskSyncParam ¶ added in v0.5.8
func ToTaskSyncParam(data interface{}) (res *worker.TaskSyncParam)
Types ¶
type Config ¶ added in v0.0.7
type Config struct { Type string `json:"type,omitempty"` Host string `json:"host,omitempty"` Port int `json:"port,omitempty"` Database string `json:"database,omitempty"` DbName string `json:"dbName,omitempty"` Username string `json:"username,omitempty"` Password string `json:"password,omitempty"` OdbcDsn string `json:"odbcDsn,omitempty"` OdbcDialectName string `json:"odbcDialectName,omitempty"` Schema string `json:"schema,omitempty"` Sid string `json:"sid,omitempty"` MaxIdleConn int `json:"maxIdleConn,omitempty"` MaxOpenConn int `json:"maxOpenConn,omitempty"` DatabasePath string `json:"databasePath,omitempty"` SSHClient *ssh.Client `json:"-"` Dsn string `json:"dsn,omitempty"` TlsConfig string `json:"tlsConfig,omitempty"` TlsRootCert string `json:"tlsRootCert,omitempty"` TlsClientCert string `json:"tlsClientCert,omitempty"` TlsClientKey string `json:"tlsClientKey,omitempty"` }
type DataListResult ¶ added in v0.0.7
type DatabaseType ¶ added in v0.0.7
type DatabaseType struct { DialectName string `json:"dialectName"` NewDb func(config *Config) (db *sql.DB, err error) `json:"-"` Matches []string `json:"-"` // contains filtered or unexported fields }
func GetDatabaseType ¶ added in v0.0.7
func GetDatabaseType(databaseType string) *DatabaseType
func (*DatabaseType) GetDialect ¶ added in v1.1.22
func (this_ *DatabaseType) GetDialect() dialect.Dialect
type ExecuteOptions ¶ added in v0.9.2
type FieldColumn ¶ added in v1.2.16
type IService ¶
type IService interface { // Close 关闭 db 客户端 Close() // GetConfig 获取 数据库 配置 GetConfig() Config // GetDialect 获取 方言 GetDialect() dialect.Dialect // GetDb 获取 sql.DB GetDb() *sql.DB // Info 查询数据库信息 Info() (res interface{}, err error) // Exec 执行 SQL Exec(sql string, args []interface{}) (rowsAffected int64, err error) // Execs 批量执行 SQL Execs(sqlList []string, argsList [][]interface{}) (rowsAffected int64, err error) // Count 统计查询 SQL Count(sql string, args []interface{}) (count int64, err error) // QueryOne 查询 单个 结构体 SQL 需要 传入 结构体 接收 QueryOne(sql string, args []interface{}, one interface{}) (find bool, err error) // Query 查询 列表 结构体 SQL 需要 传入 结构体 接收 Query(sql string, args []interface{}, list interface{}) (err error) // QueryMap 查询 列表 map SQL 返回 list < map > QueryMap(sql string, args []interface{}) (list []map[string]interface{}, err error) // QueryPage 分页查询 列表 结构体 SQL 需要 传入 结构体 接收 QueryPage(sql string, args []interface{}, list interface{}, page *worker.Page) (err error) // QueryMapPage 分页查询 列表 map 列表 SQL 返回 list < map > QueryMapPage(sql string, args []interface{}, page *worker.Page) (list []map[string]interface{}, err error) // OwnerCreateSql 创建 库|模式|用户等 SQL 取决于哪种数据库 OwnerCreateSql(param *Param, owner *dialect.OwnerModel) (sqlList []string, err error) // OwnersSelect 查询 库|模式|用户等 取决于哪种数据库 OwnersSelect(param *Param) (owners []*dialect.OwnerModel, err error) // TablesSelect 查询 库|模式|用户 下所有表 TablesSelect(param *Param, ownerName string) (tables []*dialect.TableModel, err error) // TableDetail 查询 某个表明细 TableDetail(param *Param, ownerName string, tableName string) (tableDetail *dialect.TableModel, err error) // OwnerCreate 创建 库|模式|用户等 取决于哪种数据库 OwnerCreate(param *Param, owner *dialect.OwnerModel) (created bool, err error) // OwnerDelete 删除 库|模式|用户等 取决于哪种数据库 OwnerDelete(param *Param, ownerName string) (deleted bool, err error) // OwnerDataTrim 清空 库|模式|用户等 数据 取决于哪种数据库 OwnerDataTrim(param *Param, ownerName string) (err error) // DDL 查看 库 或 表 SQL语句 DDL(param *Param, ownerName string, tableName string) (sqlList []string, err error) // Model 将 表 转换某些语言的模型 Model(param *Param, ownerName string, tableName string) (content string, err error) // TableCreate 创建表 TableCreate(param *Param, ownerName string, table *dialect.TableModel) (err error) // TableDelete 删除表 TableDelete(param *Param, ownerName string, tableName string) (err error) // TableDataTrim 表数据清理 TableDataTrim(param *Param, ownerName string, tableName string) (err error) // TableCreateSql 获取建表 SQL TableCreateSql(param *Param, ownerName string, table *dialect.TableModel) (sqlList []string, err error) // TableUpdateSql 获取更新表的 SQL TableUpdateSql(param *Param, ownerName string, tableName string, updateTableParam *UpdateTableParam) (sqlList []string, err error) // TableUpdate 更新表 TableUpdate(param *Param, ownerName string, tableName string, updateTableParam *UpdateTableParam) (err error) // DataListSql 将 需要 新增、修改、删除的 数据 转为 SQL DataListSql(param *Param, ownerName string, tableName string, columnList []*dialect.ColumnModel, insertDataList []map[string]interface{}, updateDataList []map[string]interface{}, updateWhereDataList []map[string]interface{}, deleteDataList []map[string]interface{}, ) (sqlList []string, err error) // DataListExec 执行 需要 新增、修改、删除的 数据 DataListExec(param *Param, ownerName string, tableName string, columnList []*dialect.ColumnModel, insertDataList []map[string]interface{}, updateDataList []map[string]interface{}, updateWhereDataList []map[string]interface{}, deleteDataList []map[string]interface{}, ) (err error) // TableData 根据 一些 条件 查询 表数据 TableData(param *Param, ownerName string, tableName string, columnList []*dialect.ColumnModel, whereList []*dialect.Where, orderList []*dialect.Order, pageSize int, pageNo int) (dataListResult DataListResult, err error) // GetTargetDialect 获取 目标数据库方言 GetTargetDialect(param *Param) (dia dialect.Dialect) // ExecuteSQL 执行某段 SQL ExecuteSQL(param *Param, ownerName string, sqlContent string, options *ExecuteOptions) (executeList []map[string]interface{}, errStr string, err error) // StartExport 开始 导出 StartExport(param *Param, exportParam *worker.TaskExportParam) (task *worker.Task, err error) // StartImport 开始 导入 StartImport(param *Param, importParam *worker.TaskImportParam) (task *worker.Task, err error) // StartSync 开始 同步 StartSync(param *Param, syncParam *worker.TaskSyncParam) (task *worker.Task, err error) // NewTestExecutor 新建测试任务 NewTestExecutor(options *TestTaskOptions) (testExecutor *TestExecutor, err error) }
type Param ¶ added in v0.0.7
type Param struct { *dialect.ParamModel TargetDatabaseType string `json:"targetDatabaseType"` AppendOwnerCreateSql bool `json:"appendOwnerCreateSql"` AppendOwnerName bool `json:"appendOwnerName"` OpenTransaction bool `json:"openTransaction"` ErrorContinue bool `json:"errorContinue"` ExecUsername string `json:"execUsername"` ExecPassword string `json:"execPassword"` ExportType string `json:"exportType"` ImportType string `json:"importType"` TargetDatabaseConfig *Config `json:"targetDatabaseConfig"` ModelType string `json:"modelType"` Charset string `json:"charset"` FormatIndexName bool `json:"formatIndexName"` }
type ScriptVar ¶ added in v1.0.0
type ScriptVar struct { Name string `json:"name,omitempty"` Value interface{} `json:"value,omitempty"` }
type Service ¶ added in v0.0.7
Service 注册处理器在线信息等
func (*Service) DataListExec ¶ added in v0.0.7
func (this_ *Service) DataListExec(param *Param, ownerName string, tableName string, columnList []*dialect.ColumnModel, insertDataList []map[string]interface{}, updateDataList []map[string]interface{}, updateWhereDataList []map[string]interface{}, deleteDataList []map[string]interface{}, ) (err error)
func (*Service) DataListSql ¶ added in v0.0.7
func (this_ *Service) DataListSql(param *Param, ownerName string, tableName string, columnList []*dialect.ColumnModel, insertDataList []map[string]interface{}, updateDataList []map[string]interface{}, updateWhereDataList []map[string]interface{}, deleteDataList []map[string]interface{}, ) (sqlList []string, err error)
func (*Service) ExecuteSQL ¶ added in v0.0.7
func (*Service) GetDialect ¶ added in v0.1.4
func (*Service) GetTargetDialect ¶ added in v0.0.7
func (*Service) NewTestExecutor ¶ added in v0.9.7
func (this_ *Service) NewTestExecutor(options *TestTaskOptions) (testExecutor *TestExecutor, err error)
func (*Service) OwnerCreate ¶ added in v0.0.7
func (*Service) OwnerCreateSql ¶ added in v0.1.1
func (*Service) OwnerDataTrim ¶ added in v0.0.7
func (*Service) OwnerDelete ¶ added in v0.0.7
func (*Service) OwnersSelect ¶ added in v0.0.7
func (this_ *Service) OwnersSelect(param *Param) (owners []*dialect.OwnerModel, err error)
func (*Service) QueryMapPage ¶ added in v0.0.7
func (*Service) StartExport ¶ added in v0.0.7
func (*Service) StartImport ¶ added in v0.0.7
func (*Service) TableCreate ¶ added in v0.0.7
func (*Service) TableCreateSql ¶ added in v0.0.7
func (*Service) TableDataTrim ¶ added in v0.0.7
func (*Service) TableDelete ¶ added in v0.0.7
func (*Service) TableDetail ¶ added in v0.0.7
func (*Service) TableUpdate ¶ added in v0.0.7
func (*Service) TableUpdateSql ¶ added in v0.0.7
func (*Service) TablesSelect ¶ added in v0.0.7
type SqlConditionalOperation ¶ added in v0.1.1
type SqlConditionalOperation struct { Value string `json:"value,omitempty"` Text string `json:"text,omitempty"` }
func GetSqlConditionalOperations ¶ added in v0.1.1
func GetSqlConditionalOperations() []*SqlConditionalOperation
type SqlParamParser ¶ added in v1.2.16
type SqlParamParser struct { *TemplateOptions // contains filtered or unexported fields }
func (*SqlParamParser) Append ¶ added in v1.2.16
func (this_ *SqlParamParser) Append(sql string, param any) *SqlParamParser
func (*SqlParamParser) GetParamData ¶ added in v1.2.16
func (this_ *SqlParamParser) GetParamData(param any) (data map[string]any)
type StructInfo ¶ added in v1.2.16
type StructInfo struct {
// contains filtered or unexported fields
}
type Template ¶ added in v1.2.16
type Template[T any] struct { *TemplateOptions // contains filtered or unexported fields }
func WarpTemplate ¶ added in v1.2.16
func WarpTemplate[T any](t T, opts *TemplateOptions) (res *Template[T])
func (*Template[T]) BatchInsert ¶ added in v1.2.16
func (*Template[T]) GetColumnsSql ¶ added in v1.2.16
func (*Template[T]) QueryCount ¶ added in v1.2.16
func (*Template[T]) QueryPageBean ¶ added in v1.2.16
func (*Template[T]) SelectList ¶ added in v1.2.16
func (*Template[T]) SelectPage ¶ added in v1.2.16
func (*Template[T]) SelectPageBean ¶ added in v1.2.16
type TemplateOptions ¶ added in v1.2.16
type TemplateOptions struct { Dialect dialect.Dialect DialectParam *dialect.ParamModel Service IService ColumnTagName string `json:"columnTagName"` // 字段 tag 注解名称 默认 `column:"xx"` NotUseJsonTagName bool `json:"notUseJsonTagName"` // 如果 字段 tag 注解 未找到 使用 json 注解 NotUseFieldName bool `json:"notUseFieldName"` // 如果 以上都未配置 使用 字段名称 StrictColumnName bool `json:"strictColumnName"` // 严格的字段大小写 默认 false `userId 将 匹配 Userid UserId USERID` StringEmptyNotUseNull bool `json:"stringEmptyNotUseNull"` // 字段 string 类型 如果是 空字段 则设置为 null NumberZeroNotUseNull bool `json:"numberZeroNotUseNull"` // 数字 类型 如果是 0 则设置为 null GetColumnValue func(columnType *sql.ColumnType, value any) (res any, err error) `json:"-"` SetFieldValue func(columnType *sql.ColumnType, field reflect.StructField, fieldValue reflect.Value, value any) (err error) `json:"-"` // contains filtered or unexported fields }
func (*TemplateOptions) GetBatchColumnValues ¶ added in v1.2.16
func (this_ *TemplateOptions) GetBatchColumnValues(many any, ignoreColumns ...string) (columnsSql string, valuesList [][]any)
func (*TemplateOptions) GetBatchInsertSql ¶ added in v1.2.16
func (*TemplateOptions) GetColumnValues ¶ added in v1.2.16
func (*TemplateOptions) GetDeleteSql ¶ added in v1.2.16
func (this_ *TemplateOptions) GetDeleteSql(table string, whereParser *SqlParamParser) (deleteSql string, sqlArgs []any, err error)
func (*TemplateOptions) GetInsertSql ¶ added in v1.2.16
func (*TemplateOptions) GetMapColumns ¶ added in v1.2.16
func (this_ *TemplateOptions) GetMapColumns(v any) (fieldColumns []*FieldColumn)
func (*TemplateOptions) GetStructInfo ¶ added in v1.2.16
func (this_ *TemplateOptions) GetStructInfo(structType reflect.Type) (info *StructInfo)
func (*TemplateOptions) GetUpdateSql ¶ added in v1.2.16
func (this_ *TemplateOptions) GetUpdateSql(table string, obj any, whereParser *SqlParamParser, ignoreColumns ...string) (updateSql string, sqlArgs []any, err error)
func (*TemplateOptions) SqlParamParser ¶ added in v1.2.16
func (this_ *TemplateOptions) SqlParamParser(sql string, param any) (res *SqlParamParser)
func (*TemplateOptions) ValueIsNull ¶ added in v1.2.16
func (this_ *TemplateOptions) ValueIsNull(column *FieldColumn, vField reflect.Value) bool
type TestExecutor ¶ added in v0.9.5
type TestExecutor struct { *TestTaskOptions // contains filtered or unexported fields }
func (*TestExecutor) After ¶ added in v0.9.5
func (this_ *TestExecutor) After(param *task.ExecutorParam) (err error)
func (*TestExecutor) Before ¶ added in v0.9.5
func (this_ *TestExecutor) Before(param *task.ExecutorParam) (err error)
func (*TestExecutor) Close ¶ added in v0.9.7
func (this_ *TestExecutor) Close()
func (*TestExecutor) Execute ¶ added in v0.9.5
func (this_ *TestExecutor) Execute(param *task.ExecutorParam) (err error)
func (*TestExecutor) GetNextIndex ¶ added in v1.0.4
func (this_ *TestExecutor) GetNextIndex() (index int)
type TestTaskOptions ¶ added in v0.9.5
type TestTaskOptions struct { *Param OwnerName string `json:"ownerName"` Username string `json:"username,omitempty"` Password string `json:"password,omitempty"` IsBatch bool `json:"isBatch,omitempty"` BatchSize int `json:"batchSize,omitempty"` TestSql string `json:"testSql,omitempty"` FormatSqlList func(sqlList *[]string, sqlArgsList *[][]interface{}) `json:"-"` OnExec func(sqlList *[]string, sqlArgsList *[][]interface{}) `json:"-"` ScriptVars []*ScriptVar `json:"scriptVars,omitempty"` MaxIdleConn int `json:"maxIdleConn,omitempty"` MaxOpenConn int `json:"maxOpenConn,omitempty"` }
type TestWorkerParam ¶ added in v0.9.5
type TestWorkerParam struct { *TestExecutor SqlList []string SqlArgsList [][]interface{} // contains filtered or unexported fields }
func (*TestWorkerParam) GetStringArg ¶ added in v0.9.5
func (this_ *TestWorkerParam) GetStringArg(param *task.ExecutorParam, arg string) (res string, err error)
type UpdateTableColumn ¶ added in v0.0.7
type UpdateTableColumn struct { *dialect.ColumnModel OldColumn *dialect.ColumnModel `json:"oldColumn"` Deleted bool `json:"deleted"` }
type UpdateTableIndex ¶ added in v0.0.7
type UpdateTableIndex struct { *dialect.IndexModel OldIndex *dialect.IndexModel `json:"oldIndex"` Deleted bool `json:"deleted"` }
type UpdateTableParam ¶ added in v0.0.7
type UpdateTableParam struct { TableComment string `json:"tableComment"` OldTableComment string `json:"oldTableComment"` ColumnList []*UpdateTableColumn `json:"columnList"` IndexList []*UpdateTableIndex `json:"indexList"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.