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 IsNumber(str string) bool
- 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 StringToUint64(str string) (res uint64, 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 InsertModel
- 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 (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 ValueModel
- type ValueType
- 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"} )
Functions ¶
func BytesIndex ¶ added in v1.0.3
BytesIndex Returns the index position of the string val in array
func FormatCountSql ¶ added in v1.0.9
func FormatStatement ¶ added in v1.0.3
func FormatStatement(statement_ Statement, statementContext *StatementContext) (text string, err error)
func FormatStatements ¶ added in v1.0.3
func FormatStatements(statements []Statement, statementContext *StatementContext) (text string, err error)
func GetBaseTypeValue ¶ added in v1.0.3
func GetBaseTypeValue(data interface{}) (res interface{}, is bool)
func GetStatementValue ¶ added in v1.0.3
func GetStatementValue(statement_ Statement, statementContext *StatementContext) (res interface{}, err error)
func GetStringValue ¶
func GetStringValue(value interface{}) string
func ReplaceStringByRegex ¶ added in v1.0.3
func StatementsFindValue ¶ added in v1.0.3
func StatementsFindValue(statements []Statement, statementContext *StatementContext) (findValue bool, err error)
func StringToInt ¶ added in v1.0.2
func StringToInt64 ¶ added in v1.0.2
func StringToUint64 ¶ added in v1.9.14
func StringsIndex ¶ added in v1.0.3
StringsIndex Returns the index position of the string val in array
Types ¶
type AbstractStatement ¶ added in v1.0.3
type AbstractStatement struct { Content string `json:"content,omitempty"` Children []Statement `json:"children,omitempty"` Parent Statement `json:"-"` }
func (*AbstractStatement) Format ¶ added in v1.0.3
func (this_ *AbstractStatement) Format(statementContext *StatementContext) (text string, err error)
func (*AbstractStatement) GetChildren ¶ added in v1.0.3
func (this_ *AbstractStatement) GetChildren() (children *[]Statement)
func (*AbstractStatement) GetContent ¶ added in v1.0.3
func (this_ *AbstractStatement) GetContent() (content *string)
func (*AbstractStatement) GetParent ¶ added in v1.0.3
func (this_ *AbstractStatement) GetParent() (parent Statement)
func (*AbstractStatement) GetTemplate ¶ added in v1.0.3
func (this_ *AbstractStatement) GetTemplate() (template string)
type ColumnModel ¶
type ColumnModel struct { ColumnName string `json:"columnName"` ColumnComment string `json:"columnComment"` ColumnDataType string `json:"columnDataType"` //ColumnType string `json:"columnType"` 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"` Extend map[string]interface{} `json:"extend,omitempty"` 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) ReplaceSqlVariable(sqlInfo string, args []interface{}) (variableSql string) GetVariablePlaceholder() (variablePlaceholder string) InsertSql(param *ParamModel, insert *InsertModel) (sqlList []string, err error) DataListInsertSql(param *ParamModel, ownerName string, tableName string, columnList []*ColumnModel, dataList []map[string]interface{}) (sqlList []string, valuesList [][]interface{}, batchSqlList []string, batchValuesList [][]interface{}, err error) DataListUpdateSql(param *ParamModel, ownerName string, tableName string, columnList []*ColumnModel, dataList []map[string]interface{}, dataWhereList []map[string]interface{}) (sqlList []string, valuesList [][]interface{}, err error) DataListDeleteSql(param *ParamModel, ownerName string, tableName string, columnList []*ColumnModel, dataWhereList []map[string]interface{}) (sqlList []string, valuesList [][]interface{}, err error) DataListSelectSql(param *ParamModel, ownerName string, tableName string, columnList []*ColumnModel, whereList []*Where, orderList []*Order) (sql string, values []interface{}, err error) }
func NewDialect ¶ added in v1.0.3
func NewMappingDialect ¶ added in v1.0.3
func NewMappingDialect(mapping *SqlMapping) (dia Dialect, err error)
type ElseIfStatement ¶ added in v1.0.3
type ElseIfStatement struct { *AbstractStatement Condition string `json:"condition"` ConditionExpression *ExpressionStatement `json:"conditionExpression"` If *IfStatement `json:"-"` Index int `json:"index"` }
func (*ElseIfStatement) Format ¶ added in v1.0.3
func (this_ *ElseIfStatement) Format(statementContext *StatementContext) (text string, err error)
func (*ElseIfStatement) GetTemplate ¶ added in v1.0.3
func (this_ *ElseIfStatement) GetTemplate() (template string)
func (*ElseIfStatement) IsEndElseIf ¶ added in v1.0.3
func (this_ *ElseIfStatement) IsEndElseIf() (isEnd bool)
type ElseStatement ¶ added in v1.0.3
type ElseStatement struct { *AbstractStatement If *IfStatement `json:"-"` }
func (*ElseStatement) Format ¶ added in v1.0.3
func (this_ *ElseStatement) Format(statementContext *StatementContext) (text string, err error)
func (*ElseStatement) GetTemplate ¶ added in v1.0.3
func (this_ *ElseStatement) GetTemplate() (template string)
type ExpressionBracketsStatement ¶ added in v1.0.3
type ExpressionBracketsStatement struct {
*AbstractStatement
}
ExpressionBracketsStatement 括号
func (*ExpressionBracketsStatement) GetValue ¶ added in v1.0.3
func (this_ *ExpressionBracketsStatement) GetValue(statementContext *StatementContext) (res interface{}, err error)
type ExpressionFuncStatement ¶ added in v1.0.3
type ExpressionFuncStatement struct { *AbstractStatement Func string `json:"func"` Args []Statement `json:"args"` }
func (*ExpressionFuncStatement) Format ¶ added in v1.0.3
func (this_ *ExpressionFuncStatement) Format(statementContext *StatementContext) (text string, err error)
func (*ExpressionFuncStatement) GetValue ¶ added in v1.0.3
func (this_ *ExpressionFuncStatement) GetValue(statementContext *StatementContext) (res interface{}, err error)
type ExpressionIdentifierStatement ¶ added in v1.0.3
type ExpressionIdentifierStatement struct { *AbstractStatement Identifier string `json:"identifier"` }
func (*ExpressionIdentifierStatement) Format ¶ added in v1.0.3
func (this_ *ExpressionIdentifierStatement) Format(statementContext *StatementContext) (text string, err error)
func (*ExpressionIdentifierStatement) GetValue ¶ added in v1.0.3
func (this_ *ExpressionIdentifierStatement) GetValue(statementContext *StatementContext) (res interface{}, err error)
type ExpressionNumberStatement ¶ added in v1.0.3
type ExpressionNumberStatement struct { *AbstractStatement Value float64 `json:"value"` }
func (*ExpressionNumberStatement) Format ¶ added in v1.0.3
func (this_ *ExpressionNumberStatement) Format(statementContext *StatementContext) (text string, err error)
func (*ExpressionNumberStatement) GetValue ¶ added in v1.0.3
func (this_ *ExpressionNumberStatement) GetValue(statementContext *StatementContext) (res interface{}, err error)
type ExpressionOperatorStatement ¶ added in v1.0.3
type ExpressionOperatorStatement struct { *AbstractStatement Operator string `json:"operator"` }
type ExpressionStatement ¶ added in v1.0.3
type ExpressionStatement struct {
*AbstractStatement
}
func (*ExpressionStatement) GetValue ¶ added in v1.0.3
func (this_ *ExpressionStatement) GetValue(statementContext *StatementContext) (res interface{}, err error)
type ExpressionStringStatement ¶ added in v1.0.3
type ExpressionStringStatement struct { *AbstractStatement Value string `json:"value"` }
func (*ExpressionStringStatement) Format ¶ added in v1.0.3
func (this_ *ExpressionStringStatement) Format(statementContext *StatementContext) (text string, err error)
func (*ExpressionStringStatement) GetValue ¶ added in v1.0.3
func (this_ *ExpressionStringStatement) GetValue(statementContext *StatementContext) (res interface{}, err error)
type ForStatement ¶ added in v1.0.3
type ForStatement struct {
*AbstractStatement
}
func (*ForStatement) GetTemplate ¶ added in v1.0.3
func (this_ *ForStatement) GetTemplate() (template string)
type IfStatement ¶ added in v1.0.3
type IfStatement struct { *AbstractStatement Condition string `json:"condition"` ConditionExpression *ExpressionStatement `json:"conditionExpression"` ElseIfs []*ElseIfStatement `json:"elseIfs"` Else *ElseStatement `json:"else"` }
func (*IfStatement) Format ¶ added in v1.0.3
func (this_ *IfStatement) Format(statementContext *StatementContext) (text string, err error)
func (*IfStatement) GetTemplate ¶ added in v1.0.3
func (this_ *IfStatement) GetTemplate() (template string)
type IgnorableStatement ¶ added in v1.0.3
type IgnorableStatement struct {
*AbstractStatement
}
func (*IgnorableStatement) Format ¶ added in v1.0.3
func (this_ *IgnorableStatement) Format(statementContext *StatementContext) (text string, err error)
func (*IgnorableStatement) GetTemplate ¶ added in v1.0.3
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 ¶ added in v1.0.3
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 InsertModel ¶ added in v1.0.3
type InsertModel struct { OwnerName string `json:"ownerName"` TableName string `json:"tableName"` Columns []string `json:"columns"` Rows [][]*ValueModel `json:"rows"` }
type MethodInfo ¶ added in v1.0.3
type MethodInfo struct {
// contains filtered or unexported fields
}
func (*MethodInfo) Call ¶ added in v1.0.3
func (this_ *MethodInfo) Call(inValues []interface{}) (outValues []interface{}, err error)
type OwnerModel ¶ added in v1.0.3
type OwnerModel struct { OwnerName string `json:"ownerName"` OwnerComment string `json:"ownerComment"` OwnerUsername string `json:"ownerUsername"` OwnerPassword string `json:"ownerPassword"` OwnerCharacterSetName string `json:"ownerCharacterSetName"` OwnerCollationName string `json:"ownerCollationName"` Extend map[string]interface{} `json:"extend,omitempty"` Error string `json:"error,omitempty"` }
type ParamModel ¶ added in v1.0.3
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 ¶ added in v1.0.3
type RootStatement struct {
*AbstractStatement
}
type SqlMapping ¶ added in v1.0.3
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 VariablePlaceholder string PackPageSql func(selectSql string, pageSize int, pageNo int) (pageSql string) ReplaceSqlVariable func(sqlInfo string, args []interface{}) (variableSql string) OwnerTablePack func(param *ParamModel, ownerName string, tableName string) string MethodCache map[string]interface{} // contains filtered or unexported fields }
func NewMappingDM ¶ added in v1.0.3
func NewMappingDM() (mapping *SqlMapping)
func NewMappingGBase ¶ added in v1.6.7
func NewMappingGBase() (mapping *SqlMapping)
func NewMappingKingBase ¶ added in v1.3.3
func NewMappingKingBase() (mapping *SqlMapping)
func NewMappingMysql ¶ added in v1.0.3
func NewMappingMysql() (mapping *SqlMapping)
func NewMappingOdbc ¶ added in v1.6.2
func NewMappingOdbc() (mapping *SqlMapping)
func NewMappingOpenGauss ¶ added in v1.8.5
func NewMappingOpenGauss() (mapping *SqlMapping)
func NewMappingOracle ¶ added in v1.0.3
func NewMappingOracle() (mapping *SqlMapping)
func NewMappingPostgresql ¶ added in v1.0.3
func NewMappingPostgresql() (mapping *SqlMapping)
func NewMappingShenTong ¶ added in v1.0.3
func NewMappingShenTong() (mapping *SqlMapping)
func NewMappingSqlite ¶ added in v1.0.3
func NewMappingSqlite() (mapping *SqlMapping)
func (*SqlMapping) AddColumnTypeInfo ¶ added in v1.0.3
func (this_ *SqlMapping) AddColumnTypeInfo(columnTypeInfo *ColumnTypeInfo)
func (*SqlMapping) AddIndexTypeInfo ¶ added in v1.0.3
func (this_ *SqlMapping) AddIndexTypeInfo(indexTypeInfo *IndexTypeInfo)
func (*SqlMapping) ColumnTypePack ¶ added in v1.0.3
func (this_ *SqlMapping) ColumnTypePack(column *ColumnModel) (columnTypePack string, err error)
func (*SqlMapping) DialectType ¶ added in v1.0.3
func (this_ *SqlMapping) DialectType() (dialectType *Type)
func (*SqlMapping) GenDemoTable ¶ added in v1.0.3
func (this_ *SqlMapping) GenDemoTable() (table *TableModel)
func (*SqlMapping) GetColumnTypeInfo ¶ added in v1.0.3
func (this_ *SqlMapping) GetColumnTypeInfo(column *ColumnModel) (columnTypeInfo *ColumnTypeInfo, err error)
func (*SqlMapping) GetColumnTypeInfos ¶ added in v1.0.3
func (this_ *SqlMapping) GetColumnTypeInfos() (columnTypeInfoList []*ColumnTypeInfo)
func (*SqlMapping) GetIndexTypeInfo ¶ added in v1.0.3
func (this_ *SqlMapping) GetIndexTypeInfo(typeName string) (indexTypeInfo *IndexTypeInfo, err error)
func (*SqlMapping) GetIndexTypeInfos ¶ added in v1.0.3
func (this_ *SqlMapping) GetIndexTypeInfos() (indexTypeInfoList []*IndexTypeInfo)
func (*SqlMapping) IndexNameFormat ¶ added in v1.0.3
func (this_ *SqlMapping) IndexNameFormat(param *ParamModel, ownerName string, tableName string, index *IndexModel) (indexNameFormat string, err error)
func (*SqlMapping) IndexTypeFormat ¶ added in v1.0.3
func (this_ *SqlMapping) IndexTypeFormat(index *IndexModel) (indexTypeFormat string, err error)
type StatementContext ¶ added in v1.0.3
type StatementContext struct {
// contains filtered or unexported fields
}
func NewStatementContext ¶ added in v1.0.3
func NewStatementContext() (res *StatementContext)
func (*StatementContext) AddMethod ¶ added in v1.0.3
func (this_ *StatementContext) AddMethod(name string, methodFunc interface{}) *StatementContext
func (*StatementContext) GetData ¶ added in v1.0.3
func (this_ *StatementContext) GetData(name string) (value interface{}, find bool)
func (*StatementContext) GetMethod ¶ added in v1.0.3
func (this_ *StatementContext) GetMethod(name string) (method *MethodInfo, find bool)
func (*StatementContext) SetData ¶ added in v1.0.3
func (this_ *StatementContext) SetData(name string, value interface{}) *StatementContext
func (*StatementContext) SetDataIfAbsent ¶ added in v1.0.3
func (this_ *StatementContext) SetDataIfAbsent(name string, value interface{}) *StatementContext
func (*StatementContext) SetJSONData ¶ added in v1.0.3
func (this_ *StatementContext) SetJSONData(data interface{}) (err error)
func (*StatementContext) SetMapData ¶ added in v1.0.3
func (this_ *StatementContext) SetMapData(data map[string]interface{}) *StatementContext
type StatementParser ¶ added in v1.0.3
type StatementParser struct {
// contains filtered or unexported fields
}
type StatementScript ¶ added in v1.0.3
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"` TableCollationName string `json:"tableCollationName"` Extend map[string]interface{} `json:"extend,omitempty"` OwnerName string `json:"ownerName"` Sql string `json:"sql,omitempty"` Error string `json:"error,omitempty"` }
func (*TableModel) AddColumn ¶ added in v1.0.3
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 ¶ added in v1.0.3
type TextStatement struct {
*AbstractStatement
}
type ValueModel ¶ added in v1.0.3
Source Files
¶
- dialect.go
- dialect_mapping.go
- dialect_mapping_base.go
- dialect_mapping_data_sql.go
- dialect_mapping_sql.go
- insert.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
- 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.