dialect

package
v1.9.19 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 9, 2024 License: Apache-2.0 Imports: 12 Imported by: 3

Documentation

Index

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

func BytesIndex(array []byte, val byte) (index int)

BytesIndex Returns the index position of the string val in array

func FormatCountSql added in v1.0.9

func FormatCountSql(selectSql string) (countSql string, err error)

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 IsNumber added in v1.9.13

func IsNumber(str string) bool

func ReplaceStringByRegex added in v1.0.3

func ReplaceStringByRegex(str, rule, replace string) string

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 StringToInt(str string) (res int, err error)

func StringToInt64 added in v1.0.2

func StringToInt64(str string) (res int64, err error)

func StringToUint64 added in v1.9.14

func StringToUint64(str string) (res uint64, err error)

func StringsIndex added in v1.0.3

func StringsIndex(array []string, val string) (index int)

StringsIndex Returns the index position of the string val in array

func UUID added in v1.0.3

func UUID() (res string)

UUID 生成UUID

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)
	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 NewDialect(dialectType string) (dia Dialect, err error)

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 Order added in v1.0.9

type Order struct {
	Name    string `json:"name"`
	AscDesc string `json:"ascDesc"`
}

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 PrimaryKeyModel struct {
	ColumnName string `json:"columnName"`

	OwnerName string `json:"ownerName"`
	TableName string `json:"tableName"`
	Error     string `json:"error,omitempty"`
}

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

	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 Statement added in v1.0.3

type Statement interface {
	GetTemplate() (template string)
	GetContent() (content *string)
	GetParent() (parent Statement)
	GetChildren() (children *[]Statement)
	Format(statementContext *StatementContext) (text 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 Type

type Type struct {
	Name string `json:"name"`
}

type ValueModel added in v1.0.3

type ValueModel struct {
	Type  ValueType `json:"type"`
	Value string    `json:"value"`
}

type ValueType added in v1.0.3

type ValueType string
var (
	ValueTypeString ValueType = "string"
	ValueTypeNumber ValueType = "number"
	ValueTypeFunc   ValueType = "func"
)

type Where added in v1.0.9

type Where struct {
	Name                    string `json:"name"`
	Value                   string `json:"value"`
	Before                  string `json:"before"`
	After                   string `json:"after"`
	CustomSql               string `json:"customSql"`
	SqlConditionalOperation string `json:"sqlConditionalOperation"`
	AndOr                   string `json:"andOr"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL