Discover Packages
github.com/goodhot/tinycms
orm
package
Version:
v0.0.0-...-69154b6
Opens a new window with list of versions in this module.
Published: Apr 13, 2020
License: MIT
Opens a new window with license information.
Imports: 7
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
type Model struct {
ID uint `gorm:"primary_key" json:"id"`
CreatedAt time .Time `json:"created_at"`
UpdatedAt time .Time `json:"updated_at"`
DeletedAt *time .Time `sql:"index" json:"deleted_at"`
}
type ORM struct {
Dialect string `val:"${db.dialect}"`
URL string `val:"${db.url}"`
TablePrefix string `val:"${db.table_prefix}"`
PhysicalDeletion bool `val:${db.physical_deletion}`
DB *gorm .DB
}
func (s *ORM ) Init(model ...interface{}) error
type ORMWhere struct {
Has bool
Cond string
Param []interface{}
}
type Page struct {
List interface{} `json:"list"`
PageNum int `json:"page_num"`
PageSize int `json:"page_size"`
TotalPage int `json:"total_page"`
TotalCount int `json:"total_count"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.