metabuild

package
v1.1.0-beta.0...-f2db9c4 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

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

func NewContext(opts ...Option) *Context

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) AppendNote

func (ctx *Context) AppendNote(note error)

AppendNote appends a note.

func (*Context) AppendWarning

func (ctx *Context) AppendWarning(err error)

AppendWarning appends a warning.

func (*Context) EnableAutoIncrementInGenerated

func (ctx *Context) EnableAutoIncrementInGenerated() bool

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

func (ctx *Context) GetDefaultCollationForUTF8MB4() string

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

func (ctx *Context) GetPreSplitRegions() uint64

GetPreSplitRegions returns the pre-split regions.

func (*Context) GetSQLMode

func (ctx *Context) GetSQLMode() mysql.SQLMode

GetSQLMode returns the SQL mode.

func (*Context) GetShardRowIDBits

func (ctx *Context) GetShardRowIDBits() uint64

GetShardRowIDBits returns the shard row id bits.

func (*Context) PrimaryKeyRequired

func (ctx *Context) PrimaryKeyRequired() bool

PrimaryKeyRequired returns whether primary key is required.

func (*Context) SuppressTooLongIndexErr

func (ctx *Context) SuppressTooLongIndexErr() bool

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

func WithEnableAutoIncrementInGenerated(enable bool) Option

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

func WithPreSplitRegions(regions uint64) Option

WithPreSplitRegions sets the pre-split regions.

func WithPrimaryKeyRequired

func WithPrimaryKeyRequired(required bool) Option

WithPrimaryKeyRequired sets whether primary key is required.

func WithShardRowIDBits

func WithShardRowIDBits(bits uint64) Option

WithShardRowIDBits sets the shard row id bits.

func WithSuppressTooLongIndexErr

func WithSuppressTooLongIndexErr(suppress bool) Option

WithSuppressTooLongIndexErr sets whether to suppress too long index error.

Jump to

Keyboard shortcuts

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