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
returnfmt.Errorf("UpdateStruct of table %s: %T has no exported struct fields with ,pk tag value suffix to mark primary key column(s)", table, rowStruct)
returnfmt.Errorf("UpsertStruct to table %s: %T has no exported struct fields with `db` tag", table, rowStruct)
32
32
}
33
33
34
34
varb strings.Builder
35
35
writeInsertQuery(&b, table, columns)
36
36
b.WriteString(` ON CONFLICT(`)
37
-
first:=true
37
+
hasPK:=false
38
38
fori:=rangecolumns {
39
-
if!pkCol[i] {
39
+
if!flags[i].IsPrimaryKey() {
40
40
continue
41
41
}
42
-
iffirst {
43
-
first=false
42
+
if!hasPK {
43
+
hasPK=true
44
44
} else {
45
45
b.WriteByte(',')
46
46
}
47
47
fmt.Fprintf(&b, `"%s"`, columns[i])
48
48
}
49
-
iffirst {
49
+
if!hasPK {
50
50
returnfmt.Errorf("UpsertStruct to table %s: %T has no exported struct fields with ,pk tag value suffix to mark primary key column(s)", table, rowStruct)
0 commit comments