Add a ReadOrCreate method:
m := &User{Name: "Kyle"}
// Returns a boolean indicating whether the object was created,
// the primary key of the object, or an error.
created, id, err := orm.ReadOrCreate(m, "Name")
Showing
3 changed files
with
53 additions
and
0 deletions
-
Please register or sign in to post a comment