Describe the feature
Skip creating relation records with primary keys, for example:
var languages = map[string]*Language{
langEN: &Language{},
langZH: &Language{},
}
func apiCreateLang() {
for _, lang := range languages {
db.Create(&lang)
}
}
func apiCreateUser() {
db.Clauses("skip-relation-pk").
Create(&User{
Languages: []Language{
languages[langEN], languages[langZH],
}
})
}
INSERT INTO languages ...
-- Skip creating language object with primary key
INSERT INTO user_languages ...
Motivation
Avoid duplicate INSERT INTO
Related Issues
Would you accept this proposal? I can make pr
Comment From: github-actions[bot]
This issue has been automatically marked as stale because it has been open 360 days with no activity. Remove stale label or comment or this will be closed in 180 days