model

package
v0.0.0-...-6c7ef32 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2019 License: Apache-2.0 Imports: 2 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CIStr

type CIStr struct {
	O string `json:"O"` // Original string.
	L string `json:"L"` // Lower case string.
}

CIStr is case insensitve string.

func NewCIStr

func NewCIStr(s string) (cs CIStr)

NewCIStr creates a new CIStr.

func (CIStr) String

func (cis CIStr) String() string

String implements fmt.Stringer interface.

type ColumnInfo

type ColumnInfo struct {
	ID              int64       `json:"id"`
	Name            CIStr       `json:"name"` // Column Name.
	Offset          int         `json:"offset"`
	DefaultValue    interface{} `json:"default"` // Default Value.
	types.FieldType `json:"type"`
}

ColumnInfo provides meta data describing of a table column.

type DBInfo

type DBInfo struct {
	ID      int64        `json:"id"`      // Database ID
	Name    CIStr        `json:"db_name"` // DB name.
	Charset string       `json:"charset"`
	Collate string       `json:"collate"`
	Tables  []*TableInfo `json:"tables"` // Tables in the DB.
}

DBInfo provides meta data describing a DB.

type IndexColumn

type IndexColumn struct {
	Name   CIStr `json:"name"`   // Index name
	Offset int   `json:"offset"` // Index offset
	Length int   `json:"length"` // Index length
}

IndexColumn provides index column info.

type IndexInfo

type IndexInfo struct {
	Name    CIStr          `json:"idx_name"`   // Index name.
	Table   CIStr          `json:"tbl_name"`   // Table name.
	Columns []*IndexColumn `json:"idx_cols"`   // Index columns.
	Unique  bool           `json:"is_unique"`  // Whether the index is unique.
	Primary bool           `json:"is_primary"` // Whether the index is primary key.
}

IndexInfo provides meta data describing a DB index. It corresponds to the statement `CREATE INDEX Name ON Table (Column);` See: https://dev.mysql.com/doc/refman/5.7/en/create-index.html

type TableInfo

type TableInfo struct {
	// Table name.
	ID      int64  `json:"id"`
	Name    CIStr  `json:"name"`
	Charset string `json:"charset"`
	Collate string `json:"collate"`
	// Columns are listed in the order in which they appear in the schema.
	Columns []*ColumnInfo `json:"cols"`
	Indices []*IndexInfo  `json:"index_info"`
}

TableInfo provides meta data describing a DB table.

Jump to

Keyboard shortcuts

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