Version: v0.0.0-...-7f9930a Latest Latest

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

Go to latest
Published: Sep 6, 2015 License: Apache-2.0 Imports: 7 Imported by: 0




View Source
const (

Infomation Schema Name.


This section is empty.


This section is empty.


type Handle

type Handle struct {
	// contains filtered or unexported fields

Handle handles information schema, including getting and setting.

func NewHandle

func NewHandle(store kv.Storage) *Handle

NewHandle creates a new Handle.

func (*Handle) Get

func (h *Handle) Get() InfoSchema

Get gets information schema from Handle.

func (*Handle) Set

func (h *Handle) Set(newInfo []*model.DBInfo)

Set sets DBInfo to information schema.

type InfoSchema

type InfoSchema interface {
	SchemaByName(schema model.CIStr) (*model.DBInfo, bool)
	SchemaExists(schema model.CIStr) bool
	TableByName(schema, table model.CIStr) (table.Table, error)
	TableExists(schema, table model.CIStr) bool
	ColumnByName(schema, table, column model.CIStr) (*model.ColumnInfo, bool)
	ColumnExists(schema, table, column model.CIStr) bool
	IndexByName(schema, table, index model.CIStr) (*model.IndexInfo, bool)
	SchemaByID(id int64) (*model.DBInfo, bool)
	TableByID(id int64) (table.Table, bool)
	ColumnByID(id int64) (*model.ColumnInfo, bool)
	ColumnIndices(id int64) []*model.IndexInfo
	AllSchemaNames() []string
	AllSchemas() []*model.DBInfo
	Clone() (result []*model.DBInfo)
	SchemaTables(schema model.CIStr) []table.Table

InfoSchema is the interface used to retrieve the schema information. It works as a in memory cache and doesn't handle any schema change. InfoSchema is read-only, and the returned value is a copy.

Source Files

Jump to

Keyboard shortcuts

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