Documentation ¶
Index ¶
- Constants
- func New(name, prefix string, matcher xdb.TemplateMatcher) xdb.SQLTemplate
- func NewSqlState(placeHolder xdb.Placeholder) xdb.SqlState
- type MssqlSqlState
- func (s *MssqlSqlState) AppendExpr(propName string, value any) (phName string)
- func (s *MssqlSqlState) BuildCache(sql string) xdb.ExpressionCache
- func (s *MssqlSqlState) CanCache() bool
- func (s *MssqlSqlState) GetNames() []string
- func (s *MssqlSqlState) GetValues() []any
- func (s *MssqlSqlState) HasDynamic(dynamicType xdb.DynamicType) bool
- func (s *MssqlSqlState) Reset()
- func (s *MssqlSqlState) SetDynamic(dynamicType xdb.DynamicType)
- func (s *MssqlSqlState) UseExprCache() bool
- func (s *MssqlSqlState) WithPlaceholder(placeholder xdb.Placeholder)
- func (s *MssqlSqlState) WithTemplateOptions(tplOpts *xdb.TemplateOptions)
- type MssqlTemplate
- func (template *MssqlTemplate) GetSQLContext(sqlTpl string, input map[string]any, opts ...xdb.TemplateOption) (query string, args []any, err error)
- func (template *MssqlTemplate) GetSqlState(tplOpts *xdb.TemplateOptions) xdb.SqlState
- func (template *MssqlTemplate) HandleExpr(item xdb.SqlState, sqlTpl string, input xdb.DBParam) (sql string, err error)
- func (template *MssqlTemplate) Name() string
- func (template *MssqlTemplate) Placeholder() xdb.Placeholder
- func (template *MssqlTemplate) RegistExpressionMatcher(matchers ...xdb.ExpressionMatcher)
- func (template *MssqlTemplate) ReleaseSqlState(state xdb.SqlState)
Constants ¶
View Source
const ArgumentPrefix = "p_"
View Source
const Proto = "sqlserver"
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(name, prefix string, matcher xdb.TemplateMatcher) xdb.SQLTemplate
func NewSqlState ¶ added in v0.7.0
func NewSqlState(placeHolder xdb.Placeholder) xdb.SqlState
新建一个SqlState
Types ¶
type MssqlSqlState ¶ added in v0.7.0
type MssqlSqlState struct {
// contains filtered or unexported fields
}
func (*MssqlSqlState) AppendExpr ¶ added in v0.7.0
func (s *MssqlSqlState) AppendExpr(propName string, value any) (phName string)
func (*MssqlSqlState) BuildCache ¶ added in v0.7.0
func (s *MssqlSqlState) BuildCache(sql string) xdb.ExpressionCache
func (*MssqlSqlState) CanCache ¶ added in v0.7.0
func (s *MssqlSqlState) CanCache() bool
func (*MssqlSqlState) GetNames ¶ added in v0.7.0
func (s *MssqlSqlState) GetNames() []string
func (*MssqlSqlState) GetValues ¶ added in v0.7.0
func (s *MssqlSqlState) GetValues() []any
func (*MssqlSqlState) HasDynamic ¶ added in v0.7.0
func (s *MssqlSqlState) HasDynamic(dynamicType xdb.DynamicType) bool
func (*MssqlSqlState) Reset ¶ added in v0.7.0
func (s *MssqlSqlState) Reset()
func (*MssqlSqlState) SetDynamic ¶ added in v0.7.0
func (s *MssqlSqlState) SetDynamic(dynamicType xdb.DynamicType)
func (*MssqlSqlState) UseExprCache ¶ added in v0.7.0
func (s *MssqlSqlState) UseExprCache() bool
func (*MssqlSqlState) WithPlaceholder ¶ added in v0.7.0
func (s *MssqlSqlState) WithPlaceholder(placeholder xdb.Placeholder)
func (*MssqlSqlState) WithTemplateOptions ¶ added in v0.7.0
func (s *MssqlSqlState) WithTemplateOptions(tplOpts *xdb.TemplateOptions)
type MssqlTemplate ¶ added in v0.7.0
type MssqlTemplate struct {
// contains filtered or unexported fields
}
MssqlTemplate 模板
func (*MssqlTemplate) GetSQLContext ¶ added in v0.7.0
func (template *MssqlTemplate) GetSQLContext(sqlTpl string, input map[string]any, opts ...xdb.TemplateOption) (query string, args []any, err error)
GetSQLContext 获取查询串
func (*MssqlTemplate) GetSqlState ¶ added in v0.7.0
func (template *MssqlTemplate) GetSqlState(tplOpts *xdb.TemplateOptions) xdb.SqlState
func (*MssqlTemplate) HandleExpr ¶ added in v0.7.0
func (*MssqlTemplate) Name ¶ added in v0.7.0
func (template *MssqlTemplate) Name() string
func (*MssqlTemplate) Placeholder ¶ added in v0.7.0
func (template *MssqlTemplate) Placeholder() xdb.Placeholder
func (*MssqlTemplate) RegistExpressionMatcher ¶ added in v0.7.0
func (template *MssqlTemplate) RegistExpressionMatcher(matchers ...xdb.ExpressionMatcher)
func (*MssqlTemplate) ReleaseSqlState ¶ added in v0.7.0
func (template *MssqlTemplate) ReleaseSqlState(state xdb.SqlState)
Click to show internal directories.
Click to hide internal directories.