meta

package
v0.0.0-...-f013270 Latest Latest
Warning

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

Go to latest
Published: May 27, 2017 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FieldTypeId        FieldType = "id"
	FieldTypeString              = "string"
	FieldTypeInt8                = "int8"
	FieldTypeInt16               = "int16"
	FieldTypeInt32               = "int32"
	FieldTypeInt64               = "int64"
	FieldTypeUInt8               = "uint8"
	FieldTypeUInt16              = "uint16"
	FieldTypeUInt32              = "uint32"
	FieldTypeUInt64              = "uint64"
	FieldTypeFloat64             = "float64"
	FieldTypeBool                = "bool"
	FieldTypeEnum                = "enum"
	FieldTypeTimestamp           = "timestamp"
	FieldTypeDatetime            = "datetime"
	FieldTypeBytes               = "bytes"
	FieldTypeText                = "text"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Field

type Field struct {
	Name         FieldName
	Type         FieldType
	Column       string
	Length       int
	Nullable     bool
	AutoIncr     bool
	DefaultValue interface{}
}

func (*Field) Default

func (this *Field) Default() string

type FieldName

type FieldName string

func (FieldName) String

func (this FieldName) String() string

func (FieldName) Valid

func (this FieldName) Valid() bool

type FieldType

type FieldType string

func (FieldType) AutoIncrable

func (this FieldType) AutoIncrable() bool

func (FieldType) GoType

func (this FieldType) GoType() string

func (FieldType) GoZero

func (this FieldType) GoZero() string

func (FieldType) HasDefault

func (this FieldType) HasDefault() bool

func (FieldType) Valid

func (this FieldType) Valid() bool

func (FieldType) ZeroValue

func (this FieldType) ZeroValue() interface{}

type Fields

type Fields []Field

func (Fields) FuncArgs

func (this Fields) FuncArgs() string

func (Fields) FuncTypedArgs

func (this Fields) FuncTypedArgs() string

type Index

type Index struct {
	IsSparse bool
	IsUnique bool
	Fields   IndexFields
}

type IndexField

type IndexField struct {
	Field
	Desc bool
}

type IndexFields

type IndexFields []IndexField

func (IndexFields) FuncArgs

func (this IndexFields) FuncArgs() string

func (IndexFields) FuncTypedArgs

func (this IndexFields) FuncTypedArgs() string

type Object

type Object struct {
	Package   string
	Name      string
	Engine    string
	DB        string
	Table     string
	Indexes   []Index
	Partition Partition

	PrimaryKey Fields
	Fields     Fields
	FieldMap   map[string]Field
}

func (*Object) Columns

func (this *Object) Columns() []string

func (*Object) ColumnsJoin

func (this *Object) ColumnsJoin(sep string) string

func (*Object) TableIdentifier

func (this *Object) TableIdentifier() string

type Partition

type Partition struct {
	Type      string
	Linear    bool
	Algorithm int
	Expr      string
	Columns   []string
	Num       int
	Defs      []PartitionDef
}

type PartitionDef

type PartitionDef struct {
	Name     string
	Op       string
	Expr     string
	Values   []string
	MaxValue bool
}

Jump to

Keyboard shortcuts

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