models

package
v0.0.0-...-779c436 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 4, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

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 ArangoDb

func ArangoDb() (driver.Database, error)

func ArangoDbInsert

func ArangoDbInsert(collection string, model interface{})

func ArangoDbRemove

func ArangoDbRemove(collection string, conditions string, bindVars map[string]interface{})

func ArangoDbUpdate

func ArangoDbUpdate(collection string, conditions string, model interface{})

func ArangoSelectCollection

func ArangoSelectCollection(collection string, conditions string, bindVar map[string]interface{}) []map[string]interface{}

func DbConnect

func DbConnect() (*sql.DB, *gorm.DB, error)

func GetColumnName

func GetColumnName(db *gorm.DB, model []interface{}) *gorm.DB

get Columns Name from Model

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 NullDate

type NullDate struct {
	sql.NullTime
}

date

func NullDateInput

func NullDateInput(t time.Time) NullDate

func (NullDate) MarshalJSON

func (nt NullDate) MarshalJSON() ([]byte, error)

type NullDateTime

type NullDateTime struct {
	sql.NullTime
}

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

type NullInt64 struct {
	sql.NullInt64
}

parse null int on model

func NullInt64Input

func NullInt64Input(s int64) NullInt64

func (NullInt64) MarshalJSON

func (ni NullInt64) MarshalJSON() ([]byte, error)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL