db

package
v0.6.17 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2024 License: MIT Imports: 18 Imported by: 16

Documentation

Index

Constants

View Source
const (
	MODELS = "models"
	DOMAIN = "domain"
	DRIVER = "driver"
	DB     = "db"
)
View Source
const (
	MODEL      = "model"
	CREATED_AT = "created_at"
	UPDATED_AT = "updated_at"
	DELETED_AT = "deleted_at"
	OPERATOR   = "operator"
	CREATOR    = "creator"
	UID        = "uid"
	ICON       = "icon"
	NAME       = "name"
	TYPE       = "type"
	ROLE       = "role"
	STATUS     = "status"
	AVATAR     = "avatar"
	ADDRESS    = "address"
)

Variables

This section is empty.

Functions

func CmdModels added in v0.6.15

func CmdModels(db string, tables ...ice.Any)

Types

type Dialector

type Dialector interface{ gorm.Dialector }

type Driver

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

func (Driver) AfterMigrate

func (s Driver) AfterMigrate(m *ice.Message, arg ...string)

func (Driver) BeforeMigrate

func (s Driver) BeforeMigrate(m *ice.Message, arg ...string)

func (Driver) Exit added in v0.6.15

func (s Driver) Exit(m *ice.Message, arg ...string)

func (Driver) Register

func (s Driver) Register(m *ice.Message, cb func(string) Dialector, arg ...string)

func (Driver) Select

func (s Driver) Select(m *ice.Message, arg ...string)

func (Driver) Target

func (s Driver) Target(m *ice.Message, d string, domain string) *gorm.DB

type Model

type Model struct {
	gorm.Model
	Operator string `gorm:"type:char(32)"`
	Creator  string `gorm:"type:char(32)"`
}

type ModelCommand added in v0.6.17

type ModelCommand struct {
	ModelWithUID
	CityName   string `gorm:"type:varchar(32)"`
	StreetName string `gorm:"type:varchar(32)"`
	PlaceName  string `gorm:"type:varchar(32)"`
	Operate    string `gorm:"type:varchar(32)"`
	Args       string `gorm:"type:varchar(128)"`
}

type ModelContent added in v0.6.17

type ModelContent struct {
	ModelWithUID
	UserUID string `gorm:"type:char(32);index"`
	Title   string `gorm:"type:varchar(64)"`
	Content string
}

type ModelPlace added in v0.6.17

type ModelPlace struct {
	ModelWithAuth
	Name string `gorm:"type:varchar(64)"`
	Type uint8  `gorm:"default:0"`
	Init uint8  `gorm:"default:0"`
}

type ModelStreet added in v0.6.17

type ModelStreet struct {
	ModelWithAuth
	CityUID string `gorm:"type:char(32);index:idx_city"`
	Name    string `gorm:"type:varchar(64);index:idx_city"`
	Info    string
}

type ModelUserPlace added in v0.6.17

type ModelUserPlace struct {
	ModelWithUID
	UserUID string `gorm:"type:char(32);index"`
	Role    uint8  `gorm:"default:0"`
}

type ModelWithAuth added in v0.6.17

type ModelWithAuth struct {
	ModelWithUID
	AuthUID string `gorm:"type:char(32);index"`
}

type ModelWithUID

type ModelWithUID struct {
	Model
	Uid string `gorm:"type:char(32);uniqueIndex"`
}

type Models

type Models struct {
	Database string
	Tables   []ice.Any
	// contains filtered or unexported fields
}

func (Models) AutoCreate added in v0.6.15

func (s Models) AutoCreate(m *ice.Message, arg ...string)

func (Models) Exit added in v0.6.15

func (s Models) Exit(m *ice.Message, arg ...string)

func (Models) Init added in v0.6.15

func (s Models) Init(m *ice.Message, arg ...string)

func (Models) List added in v0.6.15

func (s Models) List(m *ice.Message, arg ...string)

func (Models) Register

func (s Models) Register(m *ice.Message, domain string, target ...ice.Any)

func (Models) Select

func (s Models) Select(m *ice.Message, arg ...string)

func (Models) Target

func (s Models) Target(m *ice.Message, name string) ice.Any

func (Models) Xterm added in v0.6.15

func (s Models) Xterm(m *ice.Message, arg ...string)

type Table

type Table struct {
	ice.Hash
	// contains filtered or unexported fields
}

func (Table) AS added in v0.6.15

func (s Table) AS(from, to string) string

func (Table) AddCount added in v0.6.15

func (s Table) AddCount(m *ice.Message, arg ...string)

func (Table) AfterMigrate

func (s Table) AfterMigrate(m *ice.Message, arg ...string)

func (Table) BeforeMigrate

func (s Table) BeforeMigrate(m *ice.Message, arg ...string)

func (Table) ClearOption added in v0.6.15

func (s Table) ClearOption(m *ice.Message, arg ...string) *ice.Message

func (Table) Create

func (s Table) Create(m *ice.Message, arg ...string)

func (Table) Delete

func (s Table) Delete(m *ice.Message, arg ...string) *ice.Message

func (Table) Desc added in v0.6.15

func (s Table) Desc(k string) string

func (Table) Exec added in v0.6.15

func (s Table) Exec(m *ice.Message, arg ...string)

func (Table) Fields added in v0.6.15

func (s Table) Fields(m *ice.Message, arg ...ice.Any) Table

func (Table) FieldsWithCreatedAT added in v0.6.15

func (s Table) FieldsWithCreatedAT(m *ice.Message, target ice.Any, arg ...ice.Any) Table

func (Table) Find added in v0.6.15

func (s Table) Find(m *ice.Message, arg ...string)

func (Table) Inputs added in v0.6.15

func (s Table) Inputs(m *ice.Message, arg ...string)

func (Table) Key added in v0.6.15

func (s Table) Key(target ice.Any, k string) string

func (Table) Keys added in v0.6.15

func (s Table) Keys(target ice.Any, k string) string

func (Table) LeftJoin added in v0.6.15

func (s Table) LeftJoin(target ice.Any) string

func (Table) Limit added in v0.6.15

func (s Table) Limit(m *ice.Message, limit int) Table

func (Table) List

func (s Table) List(m *ice.Message, arg ...string) *ice.Message

func (Table) Modify

func (s Table) Modify(m *ice.Message, arg ...string)

func (Table) Open

func (s Table) Open(m *ice.Message) *gorm.DB

func (Table) OpenID

func (s Table) OpenID(m *ice.Message, id string) *gorm.DB

func (Table) Orders added in v0.6.15

func (s Table) Orders(m *ice.Message, arg ...ice.Any) Table

func (Table) Remove

func (s Table) Remove(m *ice.Message, arg ...string)

func (Table) Rename added in v0.6.15

func (s Table) Rename(m *ice.Message, arg ...string) *ice.Message

func (Table) Select

func (s Table) Select(m *ice.Message, arg ...string) *ice.Message

func (Table) SelectDetail added in v0.6.15

func (s Table) SelectDetail(m *ice.Message, arg ...string) *ice.Message

func (Table) SelectForUpdate added in v0.6.15

func (s Table) SelectForUpdate(m *ice.Message, arg ...string) *ice.Message

func (Table) SelectJoin added in v0.6.15

func (s Table) SelectJoin(m *ice.Message, target ice.Any, arg ...string) *ice.Message

func (Table) SelectList added in v0.6.15

func (s Table) SelectList(m *ice.Message, arg ...string)

func (Table) Show

func (s Table) Show(m *ice.Message, db *gorm.DB) *ice.Message

func (Table) TableName added in v0.6.15

func (s Table) TableName(model string) string

func (Table) Tables added in v0.6.15

func (s Table) Tables(m *ice.Message, target ...ice.Any) Table

func (Table) ToLower added in v0.6.15

func (s Table) ToLower(model string) string

func (Table) Transaction added in v0.6.15

func (s Table) Transaction(m *ice.Message, cb func())

func (Table) Update

func (s Table) Update(m *ice.Message, data ice.Map, arg ...string)

func (Table) Where added in v0.6.15

func (s Table) Where(m *ice.Message, db *gorm.DB, arg ...string) *gorm.DB

type Time added in v0.6.15

type Time time.Time

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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