context

package
v1.1.0-beta.0...-92d45d5 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBInfoAsInfoSchema

type DBInfoAsInfoSchema []*model.DBInfo

DBInfoAsInfoSchema is used mainly in test.

func (DBInfoAsInfoSchema) AllSchemas

func (d DBInfoAsInfoSchema) AllSchemas() []*model.DBInfo

AllSchemas implement infoschema.SchemaAndTable interface.

func (DBInfoAsInfoSchema) SchemaTableInfos

func (d DBInfoAsInfoSchema) SchemaTableInfos(ctx stdctx.Context, schema pmodel.CIStr) ([]*model.TableInfo, error)

SchemaTableInfos implement infoschema.SchemaAndTable interface.

type MetaOnlyInfoSchema

type MetaOnlyInfoSchema interface {
	SchemaMetaVersion() int64
	SchemaByName(schema pmodel.CIStr) (*model.DBInfo, bool)
	SchemaExists(schema pmodel.CIStr) bool
	TableInfoByName(schema, table pmodel.CIStr) (*model.TableInfo, error)
	TableInfoByID(id int64) (*model.TableInfo, bool)
	FindTableInfoByPartitionID(partitionID int64) (*model.TableInfo, *model.DBInfo, *model.PartitionDefinition)
	TableExists(schema, table pmodel.CIStr) bool
	SchemaByID(id int64) (*model.DBInfo, bool)
	SchemaAndTable
	AllSchemaNames() []pmodel.CIStr
	SchemaSimpleTableInfos(ctx stdctx.Context, schema pmodel.CIStr) ([]*model.TableNameInfo, error)
	Misc
}

MetaOnlyInfoSchema is a workaround. Due to circular dependency cannot return the complete interface. But MetaOnlyInfoSchema is widely used for scenes that require meta only, so we give a convenience for that.

type Misc

type Misc interface {
	PolicyByName(name pmodel.CIStr) (*model.PolicyInfo, bool)
	ResourceGroupByName(name pmodel.CIStr) (*model.ResourceGroupInfo, bool)
	// PlacementBundleByPhysicalTableID is used to get a rule bundle.
	PlacementBundleByPhysicalTableID(id int64) (*placement.Bundle, bool)
	// AllPlacementBundles is used to get all placement bundles
	AllPlacementBundles() []*placement.Bundle
	// AllPlacementPolicies returns all placement policies
	AllPlacementPolicies() []*model.PolicyInfo
	// ClonePlacementPolicies returns a copy of all placement policies.
	ClonePlacementPolicies() map[string]*model.PolicyInfo
	// AllResourceGroups returns all resource groups
	AllResourceGroups() []*model.ResourceGroupInfo
	// CloneResourceGroups returns a copy of all resource groups.
	CloneResourceGroups() map[string]*model.ResourceGroupInfo
	// HasTemporaryTable returns whether information schema has temporary table
	HasTemporaryTable() bool
	// GetTableReferredForeignKeys gets the table's ReferredFKInfo by lowercase schema and table name.
	GetTableReferredForeignKeys(schema, table string) []*model.ReferredFKInfo
}

Misc contains the methods that are not closely related to InfoSchema.

type SchemaAndTable

type SchemaAndTable interface {
	AllSchemas() []*model.DBInfo
	SchemaTableInfos(ctx stdctx.Context, schema pmodel.CIStr) ([]*model.TableInfo, error)
}

SchemaAndTable is define for iterating all the schemas and tables in the infoschema.

Jump to

Keyboard shortcuts

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