db

package
v0.6.24 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2024 License: MIT Imports: 15 Imported by: 16

Documentation

Index

Constants

View Source
const (
	MODELS = "models"
	DOMAIN = "domain"
	DRIVER = "driver"
	DB     = "db"
)
View Source
const (
	MODEL      = "model"
	FIELDS     = "fields"
	TARGET     = "target"
	CREATED_AT = "created_at"
	UPDATED_AT = "updated_at"
	DELETED_AT = "deleted_at"
	OPERATOR   = "operator"
	CREATOR    = "creator"
	UID        = "uid"
	ICON       = "icon"
	NAME       = "name"
	INFO       = "info"
	TYPE       = "type"
	ROLE       = "role"
	LEVEL      = "level"
	SCORE      = "score"
	STATUS     = "status"
	TITLE      = "title"
	CONTENT    = "content"
	AVATAR     = "avatar"
	BACKGROUND = "background"
	ADDRESS    = "address"
)

Variables

View Source
var CommonField = []string{
	ICON, NAME, INFO, TYPE, ROLE, LEVEL, SCORE, STATUS, TITLE, CONTENT,
	AVATAR, BACKGROUND, ADDRESS,
}

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
}

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 ModelExternal added in v0.6.19

type ModelExternal struct {
	ModelWithUID
	CompanyUID string `gorm:"type:char(32)"`
	OpenID     string `gorm:"type:varchar(128)"`
	Status     uint8  `gorm:"default:0"`
}

type ModelNameInfo added in v0.6.19

type ModelNameInfo struct {
	ModelWithUID
	UserUID string `gorm:"type:char(32);index"`
	Name    string `gorm:"type:varchar(64)"`
	Info    string `gorm:"type:varchar(255)"`
	Type    uint8  `gorm:"default:0"`
}

type ModelPlace added in v0.6.17

type ModelPlace struct {
	ModelWithAuth
	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"`
}

type ModelUserPlace added in v0.6.17

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

type ModelWithAuth added in v0.6.17

type ModelWithAuth struct {
	ModelWithUID
	AuthUID    string `gorm:"type:char(32);index"`
	Name       string `gorm:"type:varchar(32)"`
	Info       string `gorm:"type:varchar(255)"`
	Avatar     string `gorm:"type:varchar(255)"`
	Background string `gorm:"type:varchar(255)"`
}

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) 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) 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

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)

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) Groups added in v0.6.23

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

func (Table) Inputs added in v0.6.15

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

func (Table) Insert added in v0.6.19

func (s Table) Insert(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) OpenUID added in v0.6.19

func (s Table) OpenUID(m *ice.Message, uid 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) Rows added in v0.6.19

func (s Table) Rows(m *ice.Message, db *gorm.DB) *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) *ice.Message

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) TableNames added in v0.6.24

func (s Table) TableNames(model ice.Any) 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.Any, 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