Documentation ¶
Index ¶
- func ToChPrimitiveType(t reflect.Type) (string, error)
- func ToChType(t reflect.Type) (string, error)
- func ToTableName(s string) string
- type BaseModel
- func (b *BaseModel) Clear() error
- func (b *BaseModel) CountWhere(where string, args ...interface{}) (int64, error)
- func (b *BaseModel) Delete(id interface{}) (int64, error)
- func (b *BaseModel) DeleteWhere(where string, args ...interface{}) (int64, error)
- func (b *BaseModel) Exists(id interface{}) (bool, error)
- func (b *BaseModel) ExistsWhere(where string, args ...interface{}) (bool, error)
- func (b *BaseModel) Find(id interface{}) (interface{}, error)
- func (b *BaseModel) FindWhere(where string, args ...interface{}) (interface{}, error)
- func (b *BaseModel) GetCreateTableSQL(indexes map[string]string) string
- func (b *BaseModel) GetInsertSQL() ([]int, string)
- func (b *BaseModel) GetSelectSQL() ([]int, string)
- func (b *BaseModel) InsertAll(vs interface{}) error
- func (b *BaseModel) QueryWhere(where string, args ...interface{}) (interface{}, error)
- func (b *BaseModel) Truncate() error
- func (b *BaseModel) UpdateSet(sets string, where string, args ...interface{}) (int64, error)
- type Column
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToTableName ¶
Types ¶
type BaseModel ¶
type BaseModel struct { Type reflect.Type Dsn string Pool *sql.DB Database string TableName string // contains filtered or unexported fields }
func NewBaseModel ¶
func NewBaseModelWithCreated ¶
func (*BaseModel) CountWhere ¶
func (*BaseModel) DeleteWhere ¶
func (*BaseModel) ExistsWhere ¶
func (*BaseModel) FindWhere ¶
FindWhere finds a document (*struct type) that matches 'where' condition
func (*BaseModel) GetCreateTableSQL ¶
func (*BaseModel) GetInsertSQL ¶
GetInsertSQL returns insert SQL without returning id
func (*BaseModel) GetSelectSQL ¶
GetSelectSQL returns fieldIndexes, and select SQL
func (*BaseModel) QueryWhere ¶
QueryWhere queries documents ([]*struct type) that matches 'where' condition
Click to show internal directories.
Click to hide internal directories.