We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
func (r *petRepository) CreateTagsIfNotExist(tx *sqlx.Tx, tagDBModels []*dbmodel.TagDBModel) ([]*dbmodel.TagDBModel, error) { query := `INSERT INTO tags (tag_id, tag_name) VALUES (:tag_id, :tag_name) ON CONFLICT DO NOTHING` var NewTagDBModels []*dbmodel.TagDBModel //TODO:バルクインサートにしたい for _, tagDBModel := range tagDBModels { rows, err := tx.NamedQuery(query, tagDBModel) if err != nil { return nil, err } NewTagDBModel := &dbmodel.TagDBModel{} for rows.Next() { err = rows.StructScan(tagDBModel) if err != nil { return nil, err } } NewTagDBModels = append(NewTagDBModels, NewTagDBModel) } return NewTagDBModels, nil }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The text was updated successfully, but these errors were encountered: