Documentation ¶
Index ¶
- func ToQlType(t reflect.Type, dbTag string) (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 int64) error
- func (b *BaseModel) DeleteWhere(where string, args ...interface{}) error
- func (b *BaseModel) Exists(id int64) (bool, error)
- func (b *BaseModel) ExistsWhere(where string, args ...interface{}) (bool, error)
- func (b *BaseModel) Find(id int64) (interface{}, error)
- func (b *BaseModel) FindWhere(where string, args ...interface{}) (interface{}, error)
- func (b *BaseModel) GetCreateTableSQL() string
- func (b *BaseModel) GetIndexes() ([]Index, error)
- func (b *BaseModel) GetInsertSQL() ([]int, string)
- func (b *BaseModel) GetSelectSQL() string
- func (b *BaseModel) Insert(v interface{}) (interface{}, error)
- 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{}) error
- type Column
- type Index
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToTableName ¶
Types ¶
type BaseModel ¶
type BaseModel struct { Type reflect.Type Dsn string //file path,like : ./app.db or [empty] Pool *ql.DB TableName string // contains filtered or unexported fields }
func NewBaseModel ¶
* NewBaseModel creates a *BaseModel. 1.dsn: file path or empty string. File path like "./app.db"; Empty string for memory database. 2.data: Struct{}
func NewBaseModelWithCreated ¶
func (*BaseModel) CountWhere ¶
func (*BaseModel) DeleteWhere ¶
func (*BaseModel) ExistsWhere ¶
func (*BaseModel) GetCreateTableSQL ¶
func (*BaseModel) GetIndexes ¶
func (*BaseModel) GetInsertSQL ¶
func (*BaseModel) GetSelectSQL ¶
func (*BaseModel) QueryWhere ¶
Click to show internal directories.
Click to hide internal directories.