types

package
v0.0.0-...-336e064 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 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 Column

type Column struct {
	DB           string
	Table        string
	OriginTable  string
	Column       string
	OriginColumn string
	DataType     string
	DataLen      int
	Func         bool
	NewFunc      bool
	Options      []ast.ColumnOptionType
}

Column defines database column

func (*Column) AddOption

func (c *Column) AddOption(opt ast.ColumnOptionType)

AddOption add option for column

func (*Column) Clone

func (c *Column) Clone() *Column

Clone makes a replica of column

func (*Column) HasOption

func (c *Column) HasOption(opt ast.ColumnOptionType) bool

HasOption return is has the given option

type Database

type Database struct {
	Name   string
	Online bool
	Tables map[string]*Table
}

Database defines database database

func (*Database) RandTables

func (d *Database) RandTables() []*Table

RandTables rand tables

type Table

type Table struct {
	DB          string
	Table       string
	OriginTable string
	Type        string
	Columns     map[string]*Column
	Indexes     []string
	// Online is for self obtain,
	// which means this table is online and will be manipulated in a txn
	Online bool
	// OnlineOther is for other instances obtain,
	// which means this table is being manipulated in other txns and should not be a DDL table
	OnlineOther    bool
	InnerTableList []*Table
}

Table defines database table

func (*Table) AddToInnerTables

func (t *Table) AddToInnerTables(tables ...*Table)

AddToInnerTables Do NOT set InnerTableList directly

func (*Table) Clone

func (t *Table) Clone() *Table

Clone copy table struct

func (*Table) GetColumns

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

GetColumns get ordered columns

func (*Table) RandColumn

func (t *Table) RandColumn() *Column

RandColumn rand column from table

func (*Table) RandIndex

func (t *Table) RandIndex() string

RandIndex rand indexes

Jump to

Keyboard shortcuts

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