schema

package
v0.0.0-...-469cf1e Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2022 License: Apache-2.0 Imports: 8 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 {
	ID          INT64  `json:"id"`
	Name        string `json:"name"`
	OriginName  string
	Table       string `json:"table"`
	OriginTable string
	Type        string `json:"type"`
	Size        INT64  `json:"size"`
	PrimaryKey  bool   `json:"primary_key"`
}

type INT64

type INT64 int64

func (*INT64) UnmarshalJSON

func (u *INT64) UnmarshalJSON(bs []byte) error

type Index

type Index struct {
	ID          INT64  `json:"id"`
	Name        string `json:"name"`
	OriginName  string
	Table       string `json:"table"`
	OriginTable string
	Columns     []*Column `json:"columns"`
}

type Schema

type Schema struct {
	*util.Random

	TableVec []*Table
	TableMap map[string]*Table
}

func NewSchema

func NewSchema(s string) *Schema

func (*Schema) AddTable

func (s *Schema) AddTable(t *Table)

func (*Schema) GetRandomTable

func (s *Schema) GetRandomTable() *Table

func (*Schema) GetSchemaInfo

func (s *Schema) GetSchemaInfo() (tables []*model.TableInfo)

type Table

type Table struct {
	ID         INT64  `json:"id"`
	Name       string `json:"name"`
	OriginName string
	Charset    string `json:"charset"`
	Collate    string `json:"collate"`

	Columns []*Column `json:"columns"`
	Indices []*Index  `json:"indices"`

	*util.Random
}

func MergeTable

func MergeTable(l *Table, r *Table) *Table

func NewTable

func NewTable() *Table

func (*Table) GetRandomColumn

func (t *Table) GetRandomColumn() *Column

func (*Table) ReName

func (t *Table) ReName(name string)

func (*Table) SetID

func (t *Table) SetID(id int64)

Jump to

Keyboard shortcuts

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