structor

package
v0.0.0-...-b185596 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckType

func CheckType(t string) error

func SetAddExpr

func SetAddExpr(e Expr)

func SetCreateExpr

func SetCreateExpr(e Expr)

func SetDropIndexExpr

func SetDropIndexExpr(e Expr)

func SetIndexExpr

func SetIndexExpr(e Expr)

func SetModifyExpr

func SetModifyExpr(e Expr)

func SetPrimaryExpr

func SetPrimaryExpr(e Expr)

func SetUniqueExpr

func SetUniqueExpr(e Expr)

Types

type Add

type Add struct {
	Table  string
	Fields Fields
}

func (*Add) GetIndex

func (a *Add) GetIndex() string

func (*Add) GetTable

func (a *Add) GetTable() string

func (*Add) GetTag

func (a *Add) GetTag() string

func (*Add) Set

func (a *Add) Set(table string, index string, fields ...*Field)

type Builder

type Builder interface {
	StructBuilder
}

type Constructor

type Constructor interface {
	Set(table string, index string, fields ...*Field)
	Build(builder Builder)
	GetTable() string
	GetIndex() string
}

func GetAddExpr

func GetAddExpr(table string, fields Fields) Constructor

func GetCreateExpr

func GetCreateExpr(table string, fields Fields) Constructor

func GetDropIndexExpr

func GetDropIndexExpr(table string, IndexName string, fields Fields) Constructor

func GetIndexExpr

func GetIndexExpr(table string, IndexName string, fields Fields) Constructor

func GetModifyExpr

func GetModifyExpr(table string, fields Fields) Constructor

func GetPriMaryExpr

func GetPriMaryExpr(table string, fields Fields) Constructor

func GetUniqueExpr

func GetUniqueExpr(table string, IndexName string, fields Fields) Constructor

type Create

type Create struct {
	Table  string
	Fields Fields
}

func (*Create) GetIndex

func (c *Create) GetIndex() string

func (*Create) GetTable

func (c *Create) GetTable() string

func (*Create) GetTag

func (c *Create) GetTag() string

func (*Create) Set

func (c *Create) Set(table string, index string, fields ...*Field)

type Del

type Del struct {
	Table  string
	Fields Fields
}

func (*Del) GetIndex

func (d *Del) GetIndex() string

func (*Del) GetTable

func (d *Del) GetTable() string

func (*Del) GetTag

func (d *Del) GetTag() string

func (*Del) Set

func (d *Del) Set(table string, index string, fields ...*Field)

type DialSpeaker

type DialSpeaker func(*Field) string

type Dialect

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

func (*Dialect) Register

func (d *Dialect) Register(dialector Dialector)

func (*Dialect) Transform

func (d *Dialect) Transform(f *Field) DialSpeaker

type Dialector

type Dialector interface {
	Int(*Field) string
	Float(*Field) string
	Bool(*Field) string
	String(*Field) string
	Datetime(*Field) string
	Object(*Field) string
}

type Drop

type Drop struct {
	Table string
}

func (*Drop) GetIndex

func (d *Drop) GetIndex() string

func (*Drop) GetTable

func (d *Drop) GetTable() string

func (*Drop) GetTag

func (d *Drop) GetTag() string

func (*Drop) Set

func (d *Drop) Set(table string, index string, fields ...*Field)

type DropIndex

type DropIndex struct {
	Table  string
	Name   string
	Fields Fields
}

func (*DropIndex) GetIndex

func (d *DropIndex) GetIndex() string

func (*DropIndex) GetTable

func (d *DropIndex) GetTable() string

func (*DropIndex) GetTag

func (d *DropIndex) GetTag() string

func (*DropIndex) Set

func (d *DropIndex) Set(table string, index string, fields ...*Field)

type Expr

type Expr func() Constructor

type Field

type Field struct {
	Title   string
	Type    string
	Max     int64
	Comment string
	NotNull bool
}

type Fields

type Fields []*Field

func (Fields) Convert

func (fs Fields) Convert(dialector Dialector) []string

func (Fields) ConvertIndex

func (fs Fields) ConvertIndex() string

type Index

type Index struct {
	Table  string
	Name   string
	Fields Fields
}

func (*Index) GetIndex

func (i *Index) GetIndex() string

func (*Index) GetTable

func (i *Index) GetTable() string

func (*Index) GetTag

func (i *Index) GetTag() string

func (*Index) Set

func (i *Index) Set(table string, index string, fields ...*Field)

type Modify

type Modify struct {
	Table  string
	Fields Fields
}

func (*Modify) GetIndex

func (m *Modify) GetIndex() string

func (*Modify) GetTable

func (m *Modify) GetTable() string

func (*Modify) GetTag

func (m *Modify) GetTag() string

func (*Modify) Set

func (m *Modify) Set(table string, index string, fields ...*Field)

type Primary

type Primary struct {
	Table  string
	Fields Fields
}

func (*Primary) GetIndex

func (p *Primary) GetIndex() string

func (*Primary) GetTable

func (p *Primary) GetTable() string

func (*Primary) GetTag

func (p *Primary) GetTag() string

func (*Primary) Set

func (p *Primary) Set(table string, index string, fields ...*Field)

type StructBuilder

type StructBuilder interface {
	WriteRaw(string)
	AddRawVal(interface{})
	AddIndex(string)
}

type Type

type Type string
const (
	INT      Type = "int"
	FLOAT    Type = "float"
	BOOL     Type = "bool"
	STRING   Type = "string"
	DATETIME Type = "datetime"
	OBJECT   Type = "object"
)

type Unique

type Unique struct {
	Table  string
	Name   string
	Fields Fields
}

func (*Unique) GetIndex

func (u *Unique) GetIndex() string

func (*Unique) GetTable

func (u *Unique) GetTable() string

func (*Unique) GetTag

func (u *Unique) GetTag() string

func (*Unique) Set

func (u *Unique) Set(table string, index string, fields ...*Field)

Jump to

Keyboard shortcuts

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