database

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Column

type Column struct {
	Table *Table
	Name  model.CIStr
	Type  *types.FieldType
	Null  bool
	Key   string
}

Column defines database column

func LoadColumn

func LoadColumn(table *Table, row executor.Row) (column *Column, err error)

func (*Column) ColumnName

func (c *Column) ColumnName() *ast.ColumnName

func (*Column) FullType

func (c *Column) FullType() string

func (*Column) String

func (c *Column) String() string

type Database

type Database struct {
	Name       string
	BaseTables map[string]*Table
}

Database defines database database

func LoadDatabase

func LoadDatabase(rawName, tables executor.Rows) (db *Database, err error)

type Parser

type Parser struct {
	parser.Parser
}

func NewParser

func NewParser() *Parser

func (*Parser) ParseFieldType

func (p *Parser) ParseFieldType(tp string) (fieldType *types.FieldType, err error)

type Table

type Table struct {
	DBName     model.CIStr
	Name       model.CIStr
	PrimaryKey *Column
	Columns    []*Column
	ColumnsMap map[string]*Column
}

Table defines database table

func PrepareTable

func PrepareTable(dbName, name string) *Table

func (*Table) Keys

func (t *Table) Keys() []*Column

func (*Table) LoadColumns

func (t *Table) LoadColumns(data executor.Rows) error

Jump to

Keyboard shortcuts

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