Documentation
¶
Overview ¶
Package example provides example use cases of goven with a data model.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateModelAdaptor ¶ added in v0.2.0
func CreateModelAdaptor() (*sql_adaptor.SqlAdaptor, error)
CreateModelAdaptor creates a new SqlAdaptor for the model schema.
Types ¶
type Model ¶ added in v0.2.0
type Model struct {
gorm.Model
Name string
Version string
CreatedAt time.Time
Tags []Tag `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
}
Model represents an example machine learning model schema.
type ModelDAO ¶ added in v0.2.0
type ModelDAO struct {
// contains filtered or unexported fields
}
ModelDAO is an example DAO for machine learning models.
func NewModelDAO ¶ added in v0.2.0
NewModelDAO returns a ModelDAO.
func (*ModelDAO) CreateModel ¶ added in v0.2.0
CreateModel commits the provided model to the database.
type User ¶
type User struct {
ID uint
Name string
Email *string
Age uint8
Birthday *time.Time
MemberNumber sql.NullString
CreatedAt time.Time
}
User represents an simple example database schema.
type UserDAO ¶
type UserDAO struct {
// contains filtered or unexported fields
}
UserDAO is an example DAO for user data.
func (*UserDAO) CreateUser ¶
CreateUser commits the provided user to the database.
Click to show internal directories.
Click to hide internal directories.