â»2016/12/16 ä¿®æ£ãã¾ãã Goè¨èªã®O/R Mapperãdbrã§replace intoããããã£ãã ã®ã§ãããdbrã§ã¯replaceæ§æã¯ãµãã¼ããã¦ãªããããã ããã§ãdelete-insertã§å¯¾å¿ãããã¨ã«ãã¾ããã type ( //User ã¦ã¼ã¶ã¼ User struct { ID int Contacts []*Contact } //Contact ã¦ã¼ã¶ã¼ã®é£çµ¡å Contact struct { MailAddress string } ) //replaceUserContacts ã¦ã¼ã¶ã¼ã®é£çµ¡å ãåé¤ãã¦ç»é²ãã func (u *UserContacts) replaceUserContacts(sess *dbr.Session) error { //åé¤ã㦠_, err := sess.DeleteFrom("user_contact
{{#tags}}- {{label}}
{{/tags}}