schema

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const TableNotFoundError = 1146

Variables

View Source
var ColumnNameTypeMapping map[string]core.ColumnType

Functions

func InitGlobal

func InitGlobal()

Types

type SchemaStore

type SchemaStore interface {
	core.LogAware
	GetTable(db string, table string) (*core.Table, error)
	DeleteTable(db string, table string) error
	GetType() string
	Close()
}

type SimpleSchemaStore

type SimpleSchemaStore struct {
	// contains filtered or unexported fields
}

SimpleSchemaStore always get the newest table schemas from db. DDL event will trigger refreshing.

func NewSimpleSchemaStoreWithClient

func NewSimpleSchemaStoreWithClient(client *sql.DB) *SimpleSchemaStore

func NewSimpleSchemaStoreWithParameters

func NewSimpleSchemaStoreWithParameters(host string, port uint16, user string, password string) (*SimpleSchemaStore, error)

func (*SimpleSchemaStore) Close

func (s *SimpleSchemaStore) Close()

func (*SimpleSchemaStore) DeleteTable

func (s *SimpleSchemaStore) DeleteTable(db string, table string) error

DeleteTable remove table schema from cache

func (*SimpleSchemaStore) GetTable

func (s *SimpleSchemaStore) GetTable(db string, table string) (ts *core.Table, err error)

GetTable first tries to return table schema from cache, if not found then query from DB.

func (*SimpleSchemaStore) GetType

func (s *SimpleSchemaStore) GetType() string

func (*SimpleSchemaStore) InitWithClient

func (s *SimpleSchemaStore) InitWithClient(client *sql.DB)

func (*SimpleSchemaStore) SetLogger

func (s *SimpleSchemaStore) SetLogger(logger *log.Logger)

Jump to

Keyboard shortcuts

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