Documentation ¶
Index ¶
- Constants
- Variables
- func ArangoDb() (driver.Database, error)
- func ArangoDbInsert(collection string, model interface{})
- func ArangoDbRemove(collection string, conditions string, bindVars map[string]interface{})
- func ArangoDbUpdate(collection string, conditions string, model interface{})
- func ArangoSelectCollection(collection string, conditions string, bindVar map[string]interface{}) []map[string]interface{}
- func DbConnect() (*sql.DB, *gorm.DB, error)
- func GetColumnName(db *gorm.DB, model []interface{}) *gorm.DB
- type CityModelPreload
- type CityModels
- type NullDate
- type NullDateTime
- type NullInt64
- type NullString
- type ProvinceModels
Constants ¶
View Source
const ( Username string = "pusdikl7_jawievent" Password string = "Wonderwoman122.." DbName string = "pusdikl7_jawievent" Tcp string = "203.161.184.81:3306" )
Variables ¶
View Source
var OpenDB *gorm.DB
Functions ¶
func ArangoDbInsert ¶
func ArangoDbInsert(collection string, model interface{})
func ArangoDbRemove ¶
func ArangoDbUpdate ¶
func ArangoSelectCollection ¶
Types ¶
type CityModelPreload ¶
type CityModelPreload struct { CityID int `gorm:"column:city_id;primary_key" json:"city_id"` CityName string `gorm:"column:city_name" json:"city_name"` ProvID int `gorm:"column:prov_id" json:"prov_id"` ProvinceInfo ProvinceModels `gorm:"->;foreignKey:ID;references:ProvID" json:"province_info"` }
func (*CityModelPreload) TableName ¶
func (p *CityModelPreload) TableName() string
type CityModels ¶
type CityModels struct { CityID int `gorm:"column:city_id;primary_key" json:"city_id"` CityName string `gorm:"column:city_name" json:"city_name"` ProvID int `gorm:"column:prov_id" json:"prov_id"` }
func (*CityModels) AfterUpdate ¶
func (p *CityModels) AfterUpdate(tx *gorm.DB) (err error)
func (*CityModels) BeforeCreate ¶
func (p *CityModels) BeforeCreate(tx *gorm.DB) (err error)
func (*CityModels) BeforeDelete ¶
func (p *CityModels) BeforeDelete(tx *gorm.DB) (err error)
func (*CityModels) BeforeUpdate ¶
func (p *CityModels) BeforeUpdate(tx *gorm.DB) (err error)
func (*CityModels) TableName ¶
func (p *CityModels) TableName() string
type NullDateTime ¶
parse null time on model
func NullDateTimeInput ¶
func NullDateTimeInput(t time.Time) NullDateTime
func (NullDateTime) MarshalJSON ¶
func (nt NullDateTime) MarshalJSON() ([]byte, error)
parse null time on model
type NullInt64 ¶
parse null int on model
func NullInt64Input ¶
func (NullInt64) MarshalJSON ¶
parse null int on model
type NullString ¶
type NullString struct {
sql.NullString
}
parse null string on model
func NullStringInput ¶
func NullStringInput(s string) NullString
func (NullString) MarshalJSON ¶
func (ns NullString) MarshalJSON() ([]byte, error)
parse null string on model
type ProvinceModels ¶
type ProvinceModels struct { ID int `gorm:"column:prov_id;primary_key" json:"prov_id"` ProvName NullString `gorm:"column:prov_name" json:"prov_name"` LocationID int `gorm:"column:locationid" json:"locationid"` Status int `gorm:"column:status" json:"status"` }
func (*ProvinceModels) TableName ¶
func (*ProvinceModels) TableName() string
Click to show internal directories.
Click to hide internal directories.