Documentation ¶
Index ¶
Constants ¶
View Source
const ( SQLITE = "sqlite3" MYSQL = "mysql" )
constants for supported dmbs names in config
View Source
const ID_LENGTH = 8
Variables ¶
This section is empty.
Functions ¶
func CloseDatabaseConnection ¶
func CloseDatabaseConnection()
func ConnectDatabase ¶
func ConnectDatabase()
func CreateOrUpdate ¶
func CreateOrUpdate() error
func GetDatabase ¶
Types ¶
type DatabaseLogger ¶
func (*DatabaseLogger) Print ¶
func (logger *DatabaseLogger) Print(v ...interface{})
type DatabaseObject ¶
type DatabaseObject struct { ID string `gorm:"primary_key;size:64" json:"id"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` DeletedAt *time.Time `sql:"index" json:"-"` }
DatabaseObject is the base object for all database objects. Copy from `gorm.Model` for json annotations
func (*DatabaseObject) BeforeCreate ¶
func (d *DatabaseObject) BeforeCreate(scope *gorm.Scope) error
type ObjectMapping ¶
ObjectMapping is a simple class to map every ID to the relation (tablename) of it's object
Click to show internal directories.
Click to hide internal directories.