schema

package
v0.0.0-...-3f9fa3b Latest Latest
Warning

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

Go to latest
Published: May 21, 2015 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TYPE_NUMBER = iota + 1 //tinyint, smallint, mediumint, int, bigint, year
	TYPE_FLOAT             //float, double
	TYPE_ENUM              //enum
	TYPE_SET               //set
	TYPE_STRING            //other
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Index

type Index struct {
	Name        string
	Columns     []string
	Cardinality []uint64
}

func NewIndex

func NewIndex(name string) *Index

func (*Index) AddColumn

func (idx *Index) AddColumn(name string, cardinality uint64)

func (*Index) FindColumn

func (idx *Index) FindColumn(name string) int

type Table

type Table struct {
	Schema string
	Name   string

	Columns   []TableColumn
	Indexes   []*Index
	PKColumns []int
}

func NewTable

func NewTable(conn mysql.Executer, schema string, name string) (*Table, error)

func (*Table) AddColumn

func (ta *Table) AddColumn(name string, columnType string, extra string)

func (*Table) AddIndex

func (ta *Table) AddIndex(name string) (index *Index)

func (*Table) FindColumn

func (ta *Table) FindColumn(name string) int

func (*Table) GetPKColumn

func (ta *Table) GetPKColumn(index int) *TableColumn

func (*Table) String

func (ta *Table) String() string

type TableColumn

type TableColumn struct {
	Name       string
	Type       int
	IsAuto     bool
	EnumValues []string
	SetValues  []string
}

Jump to

Keyboard shortcuts

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