Documentation ¶
Index ¶
- func BuildDeleteSQL(tbl *cache.PhysicalTable, rows [][]types.Datum, expire time.Time) (string, error)
- func FormatSQLDatum(d types.Datum, ft *types.FieldType) (string, error)
- type SQLBuilder
- func (b *SQLBuilder) Build() (string, error)
- func (b *SQLBuilder) WriteCommonCondition(cols []*model.ColumnInfo, op string, dp []types.Datum) error
- func (b *SQLBuilder) WriteDelete() error
- func (b *SQLBuilder) WriteExpireCondition(expire time.Time) error
- func (b *SQLBuilder) WriteInCondition(cols []*model.ColumnInfo, dps ...[]types.Datum) error
- func (b *SQLBuilder) WriteLimit(n int) error
- func (b *SQLBuilder) WriteOrderBy(cols []*model.ColumnInfo, desc bool) error
- func (b *SQLBuilder) WriteSelect() error
- type ScanQueryGenerator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildDeleteSQL ¶
func BuildDeleteSQL(tbl *cache.PhysicalTable, rows [][]types.Datum, expire time.Time) (string, error)
BuildDeleteSQL builds a delete SQL
Types ¶
type SQLBuilder ¶
type SQLBuilder struct {
// contains filtered or unexported fields
}
SQLBuilder is used to build SQLs for TTL
func NewSQLBuilder ¶
func NewSQLBuilder(tbl *cache.PhysicalTable) *SQLBuilder
NewSQLBuilder creates a new TTLSQLBuilder
func (*SQLBuilder) WriteCommonCondition ¶
func (b *SQLBuilder) WriteCommonCondition(cols []*model.ColumnInfo, op string, dp []types.Datum) error
WriteCommonCondition writes a new condition
func (*SQLBuilder) WriteDelete ¶
func (b *SQLBuilder) WriteDelete() error
WriteDelete writes a delete statement without any condition
func (*SQLBuilder) WriteExpireCondition ¶
func (b *SQLBuilder) WriteExpireCondition(expire time.Time) error
WriteExpireCondition writes a condition with the time column
func (*SQLBuilder) WriteInCondition ¶
func (b *SQLBuilder) WriteInCondition(cols []*model.ColumnInfo, dps ...[]types.Datum) error
WriteInCondition writes an IN condition
func (*SQLBuilder) WriteLimit ¶
func (b *SQLBuilder) WriteLimit(n int) error
WriteLimit writes the limit
func (*SQLBuilder) WriteOrderBy ¶
func (b *SQLBuilder) WriteOrderBy(cols []*model.ColumnInfo, desc bool) error
WriteOrderBy writes order by
func (*SQLBuilder) WriteSelect ¶
func (b *SQLBuilder) WriteSelect() error
WriteSelect writes a select statement to select key columns without any condition
type ScanQueryGenerator ¶
type ScanQueryGenerator struct {
// contains filtered or unexported fields
}
ScanQueryGenerator generates SQLs for scan task
func NewScanQueryGenerator ¶
func NewScanQueryGenerator(tbl *cache.PhysicalTable, expire time.Time, rangeStart, rangeEnd []types.Datum) (*ScanQueryGenerator, error)
NewScanQueryGenerator creates a new ScanQueryGenerator
func (*ScanQueryGenerator) IsExhausted ¶
func (g *ScanQueryGenerator) IsExhausted() bool
IsExhausted returns whether the generator is exhausted
Click to show internal directories.
Click to hide internal directories.