Documentation ¶
Index ¶
- Variables
- func BytesIndex(array []byte, val byte) (index int)
- func FormatCountSql(selectSql string) (countSql string, err error)
- func FormatStatement(statement_ Statement, statementContext *StatementContext) (text string, err error)
- func FormatStatements(statements []Statement, statementContext *StatementContext) (text string, err error)
- func GetBaseTypeValue(data interface{}) (res interface{}, is bool)
- func GetStatementValue(statement_ Statement, statementContext *StatementContext) (res interface{}, err error)
- func GetStringValue(value interface{}) string
- func ReplaceStringByRegex(str, rule, replace string) string
- func StatementsFindValue(statements []Statement, statementContext *StatementContext) (findValue bool, err error)
- func StringToInt(str string) (res int, err error)
- func StringToInt64(str string) (res int64, err error)
- func StringsIndex(array []string, val string) (index int)
- func UUID() (res string)
- type AbstractStatement
- func (this_ *AbstractStatement) Format(statementContext *StatementContext) (text string, err error)
- func (this_ *AbstractStatement) GetChildren() (children *[]Statement)
- func (this_ *AbstractStatement) GetContent() (content *string)
- func (this_ *AbstractStatement) GetParent() (parent Statement)
- func (this_ *AbstractStatement) GetTemplate() (template string)
- type ColumnModel
- type ColumnTypeInfo
- type Dialect
- type ElseIfStatement
- type ElseStatement
- type ExpressionBracketsStatement
- type ExpressionFuncStatement
- type ExpressionIdentifierStatement
- type ExpressionNumberStatement
- type ExpressionOperatorStatement
- type ExpressionStatement
- type ExpressionStringStatement
- type ForStatement
- type IfStatement
- type IgnorableStatement
- type IndexModel
- type IndexTypeInfo
- type MethodInfo
- type Order
- type OwnerModel
- type ParamModel
- type PrimaryKeyModel
- type RootStatement
- type SqlMapping
- func NewMappingDM() (mapping *SqlMapping)
- func NewMappingGBase() (mapping *SqlMapping)
- func NewMappingKingBase() (mapping *SqlMapping)
- func NewMappingMysql() (mapping *SqlMapping)
- func NewMappingOdbc() (mapping *SqlMapping)
- func NewMappingOpenGauss() (mapping *SqlMapping)
- func NewMappingOracle() (mapping *SqlMapping)
- func NewMappingPostgresql() (mapping *SqlMapping)
- func NewMappingShenTong() (mapping *SqlMapping)
- func NewMappingSqlite() (mapping *SqlMapping)
- func NewMappingYXRes() (mapping *SqlMapping)
- func (this_ *SqlMapping) AddColumnTypeInfo(columnTypeInfo *ColumnTypeInfo)
- func (this_ *SqlMapping) AddIndexTypeInfo(indexTypeInfo *IndexTypeInfo)
- func (this_ *SqlMapping) ColumnTypePack(column *ColumnModel) (columnTypePack string, err error)
- func (this_ *SqlMapping) DialectType() (dialectType *Type)
- func (this_ *SqlMapping) GenDemoTable() (table *TableModel)
- func (this_ *SqlMapping) GetColumnTypeInfo(column *ColumnModel) (columnTypeInfo *ColumnTypeInfo, err error)
- func (this_ *SqlMapping) GetColumnTypeInfos() (columnTypeInfoList []*ColumnTypeInfo)
- func (this_ *SqlMapping) GetIndexTypeInfo(typeName string) (indexTypeInfo *IndexTypeInfo, err error)
- func (this_ *SqlMapping) GetIndexTypeInfos() (indexTypeInfoList []*IndexTypeInfo)
- func (this_ *SqlMapping) IndexNameFormat(param *ParamModel, ownerName string, tableName string, index *IndexModel) (indexNameFormat string, err error)
- func (this_ *SqlMapping) IndexTypeFormat(index *IndexModel) (indexTypeFormat string, err error)
- type Statement
- type StatementContext
- func (this_ *StatementContext) AddMethod(name string, methodFunc interface{}) *StatementContext
- func (this_ *StatementContext) GetData(name string) (value interface{}, find bool)
- func (this_ *StatementContext) GetMethod(name string) (method *MethodInfo, find bool)
- func (this_ *StatementContext) SetData(name string, value interface{}) *StatementContext
- func (this_ *StatementContext) SetDataIfAbsent(name string, value interface{}) *StatementContext
- func (this_ *StatementContext) SetJSONData(data interface{}) (err error)
- func (this_ *StatementContext) SetMapData(data map[string]interface{}) *StatementContext
- type StatementParser
- type StatementScript
- type TableModel
- func (this_ *TableModel) AddColumn(column *ColumnModel) *ColumnModel
- func (this_ *TableModel) AddIndex(models ...*IndexModel)
- func (this_ *TableModel) AddPrimaryKey(models ...*PrimaryKeyModel)
- func (this_ *TableModel) FindColumnByName(name string) *ColumnModel
- func (this_ *TableModel) FindIndexByName(name string) *IndexModel
- type TextStatement
- type Type
- type Where
Constants ¶
This section is empty.
Variables ¶
View Source
var ( TypeMysql = &Type{Name: "mysql"} TypeSqlite = &Type{Name: "sqlite"} TypeOracle = &Type{Name: "oracle"} TypeDM = &Type{Name: "dm"} TypeKingBase = &Type{Name: "kingbase"} TypeShenTong = &Type{Name: "shentong"} TypePostgresql = &Type{Name: "postgresql"} TypeGBase = &Type{Name: "gbase"} TypeOdbc = &Type{Name: "odbc"} TypeOpenGauss = &Type{Name: "opengauss"} TypeYXu = &Type{Name: "yxres"} )
Functions ¶
func BytesIndex ¶
BytesIndex Returns the index position of the string val in array
func FormatCountSql ¶
func FormatStatement ¶
func FormatStatement(statement_ Statement, statementContext *StatementContext) (text string, err error)
func FormatStatements ¶
func FormatStatements(statements []Statement, statementContext *StatementContext) (text string, err error)
func GetBaseTypeValue ¶
func GetBaseTypeValue(data interface{}) (res interface{}, is bool)
func GetStatementValue ¶
func GetStatementValue(statement_ Statement, statementContext *StatementContext) (res interface{}, err error)
func GetStringValue ¶
func GetStringValue(value interface{}) string
func ReplaceStringByRegex ¶
func StatementsFindValue ¶
func StatementsFindValue(statements []Statement, statementContext *StatementContext) (findValue bool, err error)
func StringToInt ¶
func StringToInt64 ¶
func StringsIndex ¶
StringsIndex Returns the index position of the string val in array
Types ¶
type AbstractStatement ¶
type AbstractStatement struct { Content string `json:"content,omitempty"` Children []Statement `json:"children,omitempty"` Parent Statement `json:"-"` }
func (*AbstractStatement) Format ¶
func (this_ *AbstractStatement) Format(statementContext *StatementContext) (text string, err error)
func (*AbstractStatement) GetChildren ¶
func (this_ *AbstractStatement) GetChildren() (children *[]Statement)
func (*AbstractStatement) GetContent ¶
func (this_ *AbstractStatement) GetContent() (content *string)
func (*AbstractStatement) GetParent ¶
func (this_ *AbstractStatement) GetParent() (parent Statement)
func (*AbstractStatement) GetTemplate ¶
func (this_ *AbstractStatement) GetTemplate() (template string)
type ColumnModel ¶
type ColumnModel struct { ColumnName string `json:"columnName"` ColumnComment string `json:"columnComment"` ColumnDataType string `json:"columnDataType"` ColumnLength int `json:"columnLength"` ColumnPrecision int `json:"columnPrecision"` ColumnScale int `json:"columnScale"` ColumnNotNull bool `json:"columnNotNull"` ColumnDefault string `json:"columnDefault"` ColumnAfterColumn string `json:"columnAfterColumn"` ColumnCharacterSetName string `json:"columnCharacterSetName"` PrimaryKey bool `json:"primaryKey"` ColumnEnums []string `json:"columnEnums"` ColumnExtra string `json:"columnExtra"` OwnerName string `json:"ownerName"` TableName string `json:"tableName"` Error string `json:"error,omitempty"` }
type ColumnTypeInfo ¶
type ColumnTypeInfo struct { Name string `json:"name,omitempty"` Comment string `json:"comment,omitempty"` Format string `json:"format,omitempty"` MinLength *int `json:"minLength"` MaxLength *int `json:"maxLength"` MinPrecision *int `json:"minPrecision"` MaxPrecision *int `json:"maxPrecision"` MinScale *int `json:"minScale"` MaxScale *int `json:"maxScale"` // IsNumber 如果 是 数字 数据存储 设置该属性 IsNumber bool `json:"isNumber,omitempty"` IsInteger bool `json:"isInteger,omitempty"` IsFloat bool `json:"isFloat,omitempty"` // IsString 如果 是 字符串 数据存储 设置该属性 IsString bool `json:"isString,omitempty"` // IsDateTime 如果 是 日期时间 数据存储 设置该属性 IsDateTime bool `json:"isDateTime,omitempty"` // IsBytes 如果 是 流 数据存储 设置该属性 IsBytes bool `json:"isBytes,omitempty"` IsBoolean bool `json:"isBoolean,omitempty"` // IsEnum 如果 是 枚举 数据存储 设置该属性 IsEnum bool `json:"isEnum,omitempty"` // IsExtend 如果 非 当前 数据库能支持的类型 设置该属性 IsExtend bool `json:"isExtend,omitempty"` Matches []string `json:"matches"` IfNotFound bool `json:"ifNotFound,omitempty"` ColumnDefaultPack func(param *ParamModel, column *ColumnModel) (columnDefaultPack string, err error) `json:"-"` ColumnTypePack func(column *ColumnModel) (columnTypePack string, err error) `json:"-"` SqlValuePack func(value string) (sqlValue string) `json:"-"` FullColumnByColumnType func(columnType string, column *ColumnModel) (err error) `json:"-"` }
type Dialect ¶
type Dialect interface { DialectType() (dialectType *Type) GetColumnTypeInfos() (columnTypeInfoList []*ColumnTypeInfo) GetColumnTypeInfo(column *ColumnModel) (columnTypeInfo *ColumnTypeInfo, err error) ColumnTypePack(column *ColumnModel) (columnTypePack string, err error) GetIndexTypeInfos() (indexTypeInfoList []*IndexTypeInfo) OwnerNamePack(param *ParamModel, ownerName string) string TableNamePack(param *ParamModel, tableName string) string OwnerTablePack(param *ParamModel, ownerName string, tableName string) string ColumnNamePack(param *ParamModel, columnName string) string ColumnNamesPack(param *ParamModel, columnNames []string) string SqlValuePack(param *ParamModel, column *ColumnModel, value interface{}) string ColumnDefaultPack(param *ParamModel, column *ColumnModel) (columnDefaultPack string, err error) // IsSqlEnd 判断SQL是否以 分号 结尾 IsSqlEnd(sqlInfo string) bool // SqlSplit 根据 分号 分割多条SQL SqlSplit(sqlInfo string) []string OwnerModel(data map[string]interface{}) (owner *OwnerModel, err error) OwnersSelectSql(param *ParamModel) (sql string, err error) OwnerSelectSql(param *ParamModel, ownerName string) (sql string, err error) OwnerCreateSql(param *ParamModel, owner *OwnerModel) (sqlList []string, err error) OwnerDeleteSql(param *ParamModel, ownerName string) (sqlList []string, err error) TableModel(data map[string]interface{}) (table *TableModel, err error) TablesSelectSql(param *ParamModel, ownerName string) (sql string, err error) TableSelectSql(param *ParamModel, ownerName string, tableName string) (sql string, err error) TableCreateSql(param *ParamModel, ownerName string, table *TableModel) (sqlList []string, err error) TableCommentSql(param *ParamModel, ownerName string, tableName string, tableComment string) (sqlList []string, err error) TableRenameSql(param *ParamModel, ownerName string, oldTableName string, tableName string) (sqlList []string, err error) TableDeleteSql(param *ParamModel, ownerName string, tableName string) (sqlList []string, err error) ColumnModel(data map[string]interface{}) (table *ColumnModel, err error) ColumnsSelectSql(param *ParamModel, ownerName string, tableName string) (sql string, err error) ColumnSelectSql(param *ParamModel, ownerName string, tableName string, columnName string) (sql string, err error) ColumnAddSql(param *ParamModel, ownerName string, tableName string, column *ColumnModel) (sqlList []string, err error) ColumnCommentSql(param *ParamModel, ownerName string, tableName string, columnName string, columnComment string) (sqlList []string, err error) ColumnUpdateSql(param *ParamModel, ownerName string, tableName string, oldColumn *ColumnModel, column *ColumnModel) (sqlList []string, err error) ColumnDeleteSql(param *ParamModel, ownerName string, tableName string, columnName string) (sqlList []string, err error) PrimaryKeyModel(data map[string]interface{}) (primaryKey *PrimaryKeyModel, err error) PrimaryKeysSelectSql(param *ParamModel, ownerName string, tableName string) (sql string, err error) PrimaryKeyAddSql(param *ParamModel, ownerName string, tableName string, columnNames []string) (sqlList []string, err error) PrimaryKeyDeleteSql(param *ParamModel, ownerName string, tableName string) (sqlList []string, err error) IndexModel(data map[string]interface{}) (index *IndexModel, err error) IndexesSelectSql(param *ParamModel, ownerName string, tableName string) (sql string, err error) IndexAddSql(param *ParamModel, ownerName string, tableName string, index *IndexModel) (sqlList []string, err error) IndexDeleteSql(param *ParamModel, ownerName string, tableName string, indexName string) (sqlList []string, err error) PackPageSql(selectSql string, pageSize int, pageNo int) (pageSql string) PackLimitOffsetSql(selectSql string, limit int, offset int) (pageSql string) ReplaceSqlVariable(sqlInfo string, args []interface{}) (variableSql string) // sql 占位符 WrapParamSQL(paramIndex int) string }
func NewDialect ¶
func NewMappingDialect ¶
func NewMappingDialect(mapping *SqlMapping) (dia Dialect, err error)
type ElseIfStatement ¶
type ElseIfStatement struct { *AbstractStatement Condition string `json:"condition"` ConditionExpression *ExpressionStatement `json:"conditionExpression"` If *IfStatement `json:"-"` Index int `json:"index"` }
func (*ElseIfStatement) Format ¶
func (this_ *ElseIfStatement) Format(statementContext *StatementContext) (text string, err error)
func (*ElseIfStatement) GetTemplate ¶
func (this_ *ElseIfStatement) GetTemplate() (template string)
func (*ElseIfStatement) IsEndElseIf ¶
func (this_ *ElseIfStatement) IsEndElseIf() (isEnd bool)
type ElseStatement ¶
type ElseStatement struct { *AbstractStatement If *IfStatement `json:"-"` }
func (*ElseStatement) Format ¶
func (this_ *ElseStatement) Format(statementContext *StatementContext) (text string, err error)
func (*ElseStatement) GetTemplate ¶
func (this_ *ElseStatement) GetTemplate() (template string)
type ExpressionBracketsStatement ¶
type ExpressionBracketsStatement struct {
*AbstractStatement
}
ExpressionBracketsStatement 括号
func (*ExpressionBracketsStatement) GetValue ¶
func (this_ *ExpressionBracketsStatement) GetValue(statementContext *StatementContext) (res interface{}, err error)
type ExpressionFuncStatement ¶
type ExpressionFuncStatement struct { *AbstractStatement Func string `json:"func"` Args []Statement `json:"args"` }
func (*ExpressionFuncStatement) Format ¶
func (this_ *ExpressionFuncStatement) Format(statementContext *StatementContext) (text string, err error)
func (*ExpressionFuncStatement) GetValue ¶
func (this_ *ExpressionFuncStatement) GetValue(statementContext *StatementContext) (res interface{}, err error)
type ExpressionIdentifierStatement ¶
type ExpressionIdentifierStatement struct { *AbstractStatement Identifier string `json:"identifier"` }
func (*ExpressionIdentifierStatement) Format ¶
func (this_ *ExpressionIdentifierStatement) Format(statementContext *StatementContext) (text string, err error)
func (*ExpressionIdentifierStatement) GetValue ¶
func (this_ *ExpressionIdentifierStatement) GetValue(statementContext *StatementContext) (res interface{}, err error)
type ExpressionNumberStatement ¶
type ExpressionNumberStatement struct { *AbstractStatement Value float64 `json:"value"` }
func (*ExpressionNumberStatement) Format ¶
func (this_ *ExpressionNumberStatement) Format(statementContext *StatementContext) (text string, err error)
func (*ExpressionNumberStatement) GetValue ¶
func (this_ *ExpressionNumberStatement) GetValue(statementContext *StatementContext) (res interface{}, err error)
type ExpressionOperatorStatement ¶
type ExpressionOperatorStatement struct { *AbstractStatement Operator string `json:"operator"` }
type ExpressionStatement ¶
type ExpressionStatement struct {
*AbstractStatement
}
func (*ExpressionStatement) GetValue ¶
func (this_ *ExpressionStatement) GetValue(statementContext *StatementContext) (res interface{}, err error)
type ExpressionStringStatement ¶
type ExpressionStringStatement struct { *AbstractStatement Value string `json:"value"` }
func (*ExpressionStringStatement) Format ¶
func (this_ *ExpressionStringStatement) Format(statementContext *StatementContext) (text string, err error)
func (*ExpressionStringStatement) GetValue ¶
func (this_ *ExpressionStringStatement) GetValue(statementContext *StatementContext) (res interface{}, err error)
type ForStatement ¶
type ForStatement struct {
*AbstractStatement
}
func (*ForStatement) GetTemplate ¶
func (this_ *ForStatement) GetTemplate() (template string)
type IfStatement ¶
type IfStatement struct { *AbstractStatement Condition string `json:"condition"` ConditionExpression *ExpressionStatement `json:"conditionExpression"` ElseIfs []*ElseIfStatement `json:"elseIfs"` Else *ElseStatement `json:"else"` }
func (*IfStatement) Format ¶
func (this_ *IfStatement) Format(statementContext *StatementContext) (text string, err error)
func (*IfStatement) GetTemplate ¶
func (this_ *IfStatement) GetTemplate() (template string)
type IgnorableStatement ¶
type IgnorableStatement struct {
*AbstractStatement
}
func (*IgnorableStatement) Format ¶
func (this_ *IgnorableStatement) Format(statementContext *StatementContext) (text string, err error)
func (*IgnorableStatement) GetTemplate ¶
func (this_ *IgnorableStatement) GetTemplate() (template string)
type IndexModel ¶
type IndexModel struct { IndexName string `json:"indexName"` IndexType string `json:"indexType"` ColumnName string `json:"columnName"` ColumnNames []string `json:"columnNames"` IndexComment string `json:"indexComment"` OwnerName string `json:"ownerName"` TableName string `json:"tableName"` Error string `json:"error,omitempty"` }
type IndexTypeInfo ¶
type IndexTypeInfo struct { Name string `json:"name,omitempty"` Format string `json:"format,omitempty"` // IsExtend 如果 非 当前 数据库能支持的类型 设置该属性 IsExtend bool `json:"isExtend,omitempty"` OnlySupportDataTypes []string `json:"onlySupportDataTypes"` NotSupportDataTypes []string `json:"notSupportDataTypes"` IndexTypeFormat func(index *IndexModel) (indexTypeFormat string, err error) `json:"-"` IndexNameFormat func(param *ParamModel, ownerName string, tableName string, index *IndexModel) (indexNameFormat string, err error) `json:"-"` }
type MethodInfo ¶
type MethodInfo struct {
// contains filtered or unexported fields
}
func (*MethodInfo) Call ¶
func (this_ *MethodInfo) Call(inValues []interface{}) (outValues []interface{}, err error)
type OwnerModel ¶
type OwnerModel struct { OwnerName string `json:"ownerName"` OwnerComment string `json:"ownerComment"` OwnerPassword string `json:"ownerPassword"` OwnerCharacterSetName string `json:"ownerCharacterSetName"` OwnerCollationName string `json:"ownerCollationName"` Error string `json:"error,omitempty"` }
type ParamModel ¶
type ParamModel struct { OwnerNamePack *bool `json:"ownerNamePack"` OwnerNamePackChar *string `json:"ownerNamePackChar"` TableNamePack *bool `json:"tableNamePack"` TableNamePackChar *string `json:"tableNamePackChar"` ColumnNamePack *bool `json:"columnNamePack"` ColumnNamePackChar *string `json:"columnNamePackChar"` SqlValuePackChar *string `json:"sqlValuePackChar"` SqlValueEscapeChar *string `json:"sqlValueEscapeChar"` AppendSqlValue *bool `json:"appendSqlValue"` CustomData map[string]interface{} `json:"customData"` }
type PrimaryKeyModel ¶
type RootStatement ¶
type RootStatement struct {
*AbstractStatement
}
type SqlMapping ¶
type SqlMapping struct { CanAppendOwnerName bool OwnersSelect string OwnerSelect string OwnerCreate string OwnerDelete string TablesSelect string TableSelect string TableCreate string TableCreateColumn string TableCreateColumnHasComment bool TableCreatePrimaryKey string TableDelete string TableComment string TableRename string ColumnsSelect string ColumnSelect string ColumnAdd string ColumnDelete string ColumnComment string ColumnRename string ColumnUpdateHasRename bool ColumnUpdateHasComment bool ColumnUpdateHasAfter bool ColumnUpdate string ColumnAfter string PrimaryKeysSelect string PrimaryKeyAdd string PrimaryKeyDelete string IndexesSelect string IndexAdd string IndexDelete string IndexNameMaxLen int IndexNamePack string OwnerNamePackChar string TableNamePackChar string ColumnNamePackChar string SqlValuePackChar string SqlValueEscapeChar string PackPageSql func(selectSql string, pageSize int, pageNo int) (pageSql string) PackLimitOffsetSql func(selectSql string, limit int, offset int) (pageSql string) ReplaceSqlVariable func(sqlInfo string, args []interface{}) (variableSql string) OwnerTablePack func(param *ParamModel, ownerName string, tableName string) string WrapParamSQL func(paramIndex int) string MethodCache map[string]interface{} // contains filtered or unexported fields }
func NewMappingDM ¶
func NewMappingDM() (mapping *SqlMapping)
func NewMappingGBase ¶
func NewMappingGBase() (mapping *SqlMapping)
func NewMappingKingBase ¶
func NewMappingKingBase() (mapping *SqlMapping)
func NewMappingMysql ¶
func NewMappingMysql() (mapping *SqlMapping)
func NewMappingOdbc ¶
func NewMappingOdbc() (mapping *SqlMapping)
func NewMappingOpenGauss ¶
func NewMappingOpenGauss() (mapping *SqlMapping)
func NewMappingOracle ¶
func NewMappingOracle() (mapping *SqlMapping)
func NewMappingPostgresql ¶
func NewMappingPostgresql() (mapping *SqlMapping)
func NewMappingShenTong ¶
func NewMappingShenTong() (mapping *SqlMapping)
func NewMappingSqlite ¶
func NewMappingSqlite() (mapping *SqlMapping)
func NewMappingYXRes ¶
func NewMappingYXRes() (mapping *SqlMapping)
func (*SqlMapping) AddColumnTypeInfo ¶
func (this_ *SqlMapping) AddColumnTypeInfo(columnTypeInfo *ColumnTypeInfo)
func (*SqlMapping) AddIndexTypeInfo ¶
func (this_ *SqlMapping) AddIndexTypeInfo(indexTypeInfo *IndexTypeInfo)
func (*SqlMapping) ColumnTypePack ¶
func (this_ *SqlMapping) ColumnTypePack(column *ColumnModel) (columnTypePack string, err error)
func (*SqlMapping) DialectType ¶
func (this_ *SqlMapping) DialectType() (dialectType *Type)
func (*SqlMapping) GenDemoTable ¶
func (this_ *SqlMapping) GenDemoTable() (table *TableModel)
func (*SqlMapping) GetColumnTypeInfo ¶
func (this_ *SqlMapping) GetColumnTypeInfo(column *ColumnModel) (columnTypeInfo *ColumnTypeInfo, err error)
func (*SqlMapping) GetColumnTypeInfos ¶
func (this_ *SqlMapping) GetColumnTypeInfos() (columnTypeInfoList []*ColumnTypeInfo)
func (*SqlMapping) GetIndexTypeInfo ¶
func (this_ *SqlMapping) GetIndexTypeInfo(typeName string) (indexTypeInfo *IndexTypeInfo, err error)
func (*SqlMapping) GetIndexTypeInfos ¶
func (this_ *SqlMapping) GetIndexTypeInfos() (indexTypeInfoList []*IndexTypeInfo)
func (*SqlMapping) IndexNameFormat ¶
func (this_ *SqlMapping) IndexNameFormat(param *ParamModel, ownerName string, tableName string, index *IndexModel) (indexNameFormat string, err error)
func (*SqlMapping) IndexTypeFormat ¶
func (this_ *SqlMapping) IndexTypeFormat(index *IndexModel) (indexTypeFormat string, err error)
type StatementContext ¶
type StatementContext struct {
// contains filtered or unexported fields
}
func NewStatementContext ¶
func NewStatementContext() (res *StatementContext)
func (*StatementContext) AddMethod ¶
func (this_ *StatementContext) AddMethod(name string, methodFunc interface{}) *StatementContext
func (*StatementContext) GetData ¶
func (this_ *StatementContext) GetData(name string) (value interface{}, find bool)
func (*StatementContext) GetMethod ¶
func (this_ *StatementContext) GetMethod(name string) (method *MethodInfo, find bool)
func (*StatementContext) SetData ¶
func (this_ *StatementContext) SetData(name string, value interface{}) *StatementContext
func (*StatementContext) SetDataIfAbsent ¶
func (this_ *StatementContext) SetDataIfAbsent(name string, value interface{}) *StatementContext
func (*StatementContext) SetJSONData ¶
func (this_ *StatementContext) SetJSONData(data interface{}) (err error)
func (*StatementContext) SetMapData ¶
func (this_ *StatementContext) SetMapData(data map[string]interface{}) *StatementContext
type StatementParser ¶
type StatementParser struct {
// contains filtered or unexported fields
}
type StatementScript ¶
type StatementScript struct { *ParamModel Dialect }
type TableModel ¶
type TableModel struct { TableName string `json:"tableName"` TableComment string `json:"tableComment"` ColumnList []*ColumnModel `json:"columnList"` IndexList []*IndexModel `json:"indexList"` PrimaryKeys []string `json:"primaryKeys"` TableCharacterSetName string `json:"tableCharacterSetName"` OwnerName string `json:"ownerName"` Sql string `json:"sql,omitempty"` Error string `json:"error,omitempty"` }
func (*TableModel) AddColumn ¶
func (this_ *TableModel) AddColumn(column *ColumnModel) *ColumnModel
func (*TableModel) AddIndex ¶
func (this_ *TableModel) AddIndex(models ...*IndexModel)
func (*TableModel) AddPrimaryKey ¶
func (this_ *TableModel) AddPrimaryKey(models ...*PrimaryKeyModel)
func (*TableModel) FindColumnByName ¶
func (this_ *TableModel) FindColumnByName(name string) *ColumnModel
func (*TableModel) FindIndexByName ¶
func (this_ *TableModel) FindIndexByName(name string) *IndexModel
type TextStatement ¶
type TextStatement struct {
*AbstractStatement
}
Source Files ¶
- dialect.go
- dialect_mapping.go
- dialect_mapping_base.go
- dialect_mapping_data_sql.go
- dialect_mapping_sql.go
- mapping.column.go
- mapping.column.type.go
- mapping.dm.go
- mapping.gbase.go
- mapping.go
- mapping.index.go
- mapping.kingbase.go
- mapping.mysql.go
- mapping.odbc.go
- mapping.opengauss.go
- mapping.oracle.go
- mapping.postgresql.go
- mapping.shentong.go
- mapping.sql.go
- mapping.sqlite.go
- mapping.yxres.go
- model.go
- sql.go
- statement.go
- statement_context.go
- statement_invoker.go
- statement_parser.go
- statement_parser_expression.go
- statement_parser_if.go
- statement_parser_text.go
- util.go
Click to show internal directories.
Click to hide internal directories.