Documentation ¶
Index ¶
- type Context
- func (ctx *Context) AppendNote(note error)
- func (ctx *Context) AppendWarning(err error)
- func (ctx *Context) EnableAutoIncrementInGenerated() bool
- func (ctx *Context) GetClusteredIndexDefMode() variable.ClusteredIndexDefMode
- func (ctx *Context) GetDefaultCollationForUTF8MB4() string
- func (ctx *Context) GetExprCtx() exprctx.ExprContext
- func (ctx *Context) GetInfoSchema() (infoschemactx.MetaOnlyInfoSchema, bool)
- func (ctx *Context) GetPreSplitRegions() uint64
- func (ctx *Context) GetSQLMode() mysql.SQLMode
- func (ctx *Context) GetShardRowIDBits() uint64
- func (ctx *Context) PrimaryKeyRequired() bool
- func (ctx *Context) SuppressTooLongIndexErr() bool
- type Option
- func WithClusteredIndexDefMode(mode variable.ClusteredIndexDefMode) Option
- func WithEnableAutoIncrementInGenerated(enable bool) Option
- func WithExprCtx(exprCtx exprctx.ExprContext) Option
- func WithInfoSchema(schema infoschemactx.MetaOnlyInfoSchema) Option
- func WithPreSplitRegions(regions uint64) Option
- func WithPrimaryKeyRequired(required bool) Option
- func WithShardRowIDBits(bits uint64) Option
- func WithSuppressTooLongIndexErr(suppress bool) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Context is used to build meta like `TableInfo`, `IndexInfo`, etc...
func NewContext ¶
NewContext creates a new context for meta-building.
func NewNonStrictContext ¶
func NewNonStrictContext() *Context
NewNonStrictContext creates a new context for meta-building with non-strict mode.
func (*Context) AppendWarning ¶
AppendWarning appends a warning.
func (*Context) EnableAutoIncrementInGenerated ¶
EnableAutoIncrementInGenerated returns whether enable auto increment in generated column.
func (*Context) GetClusteredIndexDefMode ¶
func (ctx *Context) GetClusteredIndexDefMode() variable.ClusteredIndexDefMode
GetClusteredIndexDefMode returns the clustered index mode.
func (*Context) GetDefaultCollationForUTF8MB4 ¶
GetDefaultCollationForUTF8MB4 returns the default collation for utf8mb4.
func (*Context) GetExprCtx ¶
func (ctx *Context) GetExprCtx() exprctx.ExprContext
GetExprCtx returns the expression context of the session.
func (*Context) GetInfoSchema ¶
func (ctx *Context) GetInfoSchema() (infoschemactx.MetaOnlyInfoSchema, bool)
GetInfoSchema returns the info schema for check some constraints between tables. If the second return value is false, it means that we do not need to check the constraints referred to other tables.
func (*Context) GetPreSplitRegions ¶
GetPreSplitRegions returns the pre-split regions.
func (*Context) GetSQLMode ¶
GetSQLMode returns the SQL mode.
func (*Context) GetShardRowIDBits ¶
GetShardRowIDBits returns the shard row id bits.
func (*Context) PrimaryKeyRequired ¶
PrimaryKeyRequired returns whether primary key is required.
func (*Context) SuppressTooLongIndexErr ¶
SuppressTooLongIndexErr returns whether suppress too long index error.
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option is used to set context options.
func WithClusteredIndexDefMode ¶
func WithClusteredIndexDefMode(mode variable.ClusteredIndexDefMode) Option
WithClusteredIndexDefMode sets the clustered index mode.
func WithEnableAutoIncrementInGenerated ¶
WithEnableAutoIncrementInGenerated sets whether enable auto increment in generated column.
func WithExprCtx ¶
func WithExprCtx(exprCtx exprctx.ExprContext) Option
WithExprCtx sets the expression context.
func WithInfoSchema ¶
func WithInfoSchema(schema infoschemactx.MetaOnlyInfoSchema) Option
WithInfoSchema sets the info schema.
func WithPreSplitRegions ¶
WithPreSplitRegions sets the pre-split regions.
func WithPrimaryKeyRequired ¶
WithPrimaryKeyRequired sets whether primary key is required.
func WithShardRowIDBits ¶
WithShardRowIDBits sets the shard row id bits.
func WithSuppressTooLongIndexErr ¶
WithSuppressTooLongIndexErr sets whether to suppress too long index error.