object

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: May 17, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DBType

func DBType(t string) string

func IsFieldType

func IsFieldType(t string) bool

func MySQLType

func MySQLType(t string) string

func TimeFormat

func TimeFormat(t time.Time) string

func TimeParse

func TimeParse(s string) time.Time

func TimeParseLocalTime

func TimeParseLocalTime(s string) time.Time

func TimeToLocalTime

func TimeToLocalTime(c time.Time) string

Types

type Convert

type Convert struct {
	TypeOrigin  string
	ConvertTo   string
	TypeTarget  string
	ConvertBack string
}

type Field

type Field struct {
	// contains filtered or unexported fields
}

func (*Field) Attribute

func (f *Field) Attribute(name string) interface{}

func (*Field) Comment

func (f *Field) Comment() string

func (*Field) DBColumn

func (f *Field) DBColumn() string

func (*Field) DBDefault

func (f *Field) DBDefault() string

func (*Field) DBNull

func (f *Field) DBNull() string

func (*Field) DBType

func (f *Field) DBType() string

func (*Field) IsAutoIncrement

func (f *Field) IsAutoIncrement() bool

func (*Field) IsEncode

func (f *Field) IsEncode() bool

func (*Field) IsNullable

func (f *Field) IsNullable() bool

func (*Field) IsPassword

func (f *Field) IsPassword() bool

func (*Field) IsPrimary

func (f *Field) IsPrimary() bool

func (*Field) IsText

func (f *Field) IsText() bool

func (*Field) IsTime

func (f *Field) IsTime() bool

func (*Field) Name

func (f *Field) Name() string

func (*Field) SQLNullType

func (f *Field) SQLNullType() string

func (*Field) SQLNullValueField

func (f *Field) SQLNullValueField() string

func (*Field) TagValue

func (f *Field) TagValue(key string) string

func (*Field) Tags

func (f *Field) Tags(keys []string) string

func (*Field) Type

func (f *Field) Type(language string) string

func (*Field) Value

func (f *Field) Value() string

type FieldD

type FieldD struct {
	Name       string                 `yaml:"name,omitempty"`
	Type       string                 `yaml:"type,omitempty"`
	Comment    string                 `yaml:"comment,omitempty"`
	Attributes map[string]interface{} `yaml:"attributes,omitempty"`
	Tags       map[string]interface{} `yaml:"tags,omitempty"`
}

type Index

type Index struct {
	// contains filtered or unexported fields
}

func (*Index) Comment

func (u *Index) Comment() string

func (*Index) Fields

func (u *Index) Fields() []*Field

func (*Index) JoinFields

func (u *Index) JoinFields(sep string) string

func (*Index) Name

func (u *Index) Name() string

func (*Index) Table

func (u *Index) Table() *Table

type IndexD

type IndexD struct {
	Name       string   `yaml:"name,omitempty"`
	FieldNames []string `yaml:"fields,omitempty"`
}

type Object

type Object struct {
	Version    string                 `yaml:"version,omitempty"`
	Object     string                 `yaml:"object,omitempty"`
	Name       string                 `yaml:"name,omitempty"`
	Comment    string                 `yaml:"comment,omitempty"`
	Fields     []*FieldD              `yaml:"fields,omitempty"`
	Uniques    []*UniqueD             `yaml:"uniques,omitempty"`
	Indexes    []*IndexD              `yaml:"indexes,omitempty"`
	Primary    []string               `yaml:"primary,omitempty"`
	Tags       []string               `yaml:"tags,omitempty"`
	Attributes map[string]interface{} `yaml:"attributes,omitempty"`
}

func (*Object) Adjust

func (obj *Object) Adjust()

func (*Object) IsQuery

func (obj *Object) IsQuery() bool

func (*Object) IsTable

func (obj *Object) IsTable() bool

func (*Object) Query

func (obj *Object) Query() (*Query, error)

func (*Object) Table

func (obj *Object) Table() (*Table, error)

type Primary

type Primary struct {
	// contains filtered or unexported fields
}

func (*Primary) Fields

func (u *Primary) Fields() []*Field

func (*Primary) JoinFields

func (u *Primary) JoinFields(sep string) string

func (*Primary) Table

func (u *Primary) Table() *Table

type Query

type Query struct {
	// contains filtered or unexported fields
}

func (*Query) FieldByName

func (q *Query) FieldByName(name string) *Field

func (*Query) Fields

func (q *Query) Fields() []*Field

func (*Query) Name

func (q *Query) Name() string

func (*Query) Tags

func (q *Query) Tags() []string

type Table

type Table struct {
	// contains filtered or unexported fields
}

func (*Table) Attribute

func (tb *Table) Attribute(name string) interface{}

func (*Table) AutoIncrement

func (tb *Table) AutoIncrement(defautBegin string) string

func (*Table) Comment

func (tb *Table) Comment() string

func (*Table) DBCharset

func (tb *Table) DBCharset(defaultCharset string) string

func (*Table) DBEngine

func (tb *Table) DBEngine(defaultEngine string) string

func (*Table) DBName

func (tb *Table) DBName() string

func (*Table) FieldByName

func (tb *Table) FieldByName(name string) *Field

func (*Table) Fields

func (tb *Table) Fields() []*Field

func (*Table) IndexByName

func (tb *Table) IndexByName(name string) *Index

func (*Table) Indexes

func (tb *Table) Indexes() []*Index

func (*Table) Name

func (tb *Table) Name() string

func (*Table) PrimaryKey

func (tb *Table) PrimaryKey() *Primary

func (*Table) Tags

func (tb *Table) Tags() []string

func (*Table) UniqueByName

func (tb *Table) UniqueByName(name string) *Unique

func (*Table) Uniques

func (tb *Table) Uniques() []*Unique

type Unique

type Unique struct {
	// contains filtered or unexported fields
}

func (*Unique) Comment

func (u *Unique) Comment() string

func (*Unique) Fields

func (u *Unique) Fields() []*Field

func (*Unique) JoinFields

func (u *Unique) JoinFields(sep string) string

func (*Unique) Name

func (u *Unique) Name() string

func (*Unique) Table

func (u *Unique) Table() *Table

type UniqueD

type UniqueD struct {
	Name       string   `yaml:"name,omitempty"`
	FieldNames []string `yaml:"fields,omitempty"`
}

Jump to

Keyboard shortcuts

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