Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var AllGender = []Gender{ GenderMale, GenderFemale, }
Functions ¶
This section is empty.
Types ¶
type Todo ¶
type Todo struct { bun.BaseModel `bun:"table: todos,alias:t"` ID int `bun:",pk,autoincrement" json:"id"` Text string `bun:"text,notnull" json:"text"` Done bool `bun:"done,notnull,default: '0'" json:"done"` UserID int `bun:"user_id,notnull" json:"user"` User *User `bun:"rel:belongs-to,join:user_id=id"` CreatedAt time.Time `bun:"created_at,notnull" json:"-"` ModifiedAt time.Time `bun:"modified_at,notnull" json:"-"` }
Todo is the ORM model to save todos in the database and used when returning data for queries
func (*Todo) BeforeAppendModel ¶
type User ¶
type User struct { bun.BaseModel `bun:"table: users,alias:u"` ID int `bun:",pk,autoincrement" json:"id"` Name string `bun:"name,notnull" json:"name"` Gender string `bun:"gender,notnull" json:"gender"` CreatedAt time.Time `bun:"created_at,notnull" json:"-"` ModifiedAt time.Time `bun:"modified_at,notnull" json:"-"` }
User is the ORM model to save user in the database and return the data back to consumers
func (*User) BeforeAppendModel ¶
Click to show internal directories.
Click to hide internal directories.