You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The data does not exist in multiple databases,and i just know the map struct, i want insert the data into multiple databases.
if I use createForUpdate logic,and the same logic is executed simultaneously in multiple databases,if not set Model, just know the table name. the same map will add “@id”,causing some SQL statements to fail execution.
For example:
`
updateList := make([]map[string]interface{}, 0) // the map will be add '@id'
columns := make([]clause.Column, 0)
updateColumns := make([]string, 0)
for _, v := range req.dbList {
dbName := v
db := global.GVA_DBList[dbName]
err := db.Table(req.table).Clauses(clause.OnConflict{
Columns: columns,
DoUpdates: clause.AssignmentColumns(updateColumns),
}).Create(&updateList).Error
if err != nil {
errDbList = append(errDbList, dbName)
isAllDone = false
}
}
The issue has been automatically marked as stale as it missing playground pull request link, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkout https://github.com/go-gorm/playground for details. it will be closed in 30 days if no further activity occurs. if you are asking question, please use the Question template, most likely your question already answered https://github.com/go-gorm/gorm/issues or described in the document https://gorm.io ✨ Search Before Asking ✨
GORM Playground Link
go-gorm/playground#739
Description
The data does not exist in multiple databases,and i just know the map struct, i want insert the data into multiple databases.
if I use createForUpdate logic,and the same logic is executed simultaneously in multiple databases,if not set Model, just know the table name. the same map will add “@id”,causing some SQL statements to fail execution.
For example:
`
`
Error Msg: Error 1054 (42S22): Unknown column '@id' in 'field list'
Will the same issue also occur during insert, This is not very compatible with old versions.
The text was updated successfully, but these errors were encountered: