Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DB *gorm.DB
DB is a global variable for database
Functions ¶
func NewPostgresql ¶
NewPostgresql returns database object using postgres as database engine
Types ¶
type Model ¶
type Model struct { ID uuid.UUID `gorm:"column:_id;type:uuid;not null;unique;primaryKey;index;"` CreatedAt time.Time `gorm:"default:now()"` UpdatedAt *time.Time DeletedAt *time.Time }
Model is the default schema for database module This should be include in all schema model
func (*Model) GenerateID ¶
func (m *Model) GenerateID()
GenerateID will generate a random UUID and set it into the ID
Click to show internal directories.
Click to hide internal directories.