Skip to content

Commit

Permalink
fix insert issues
Browse files Browse the repository at this point in the history
  • Loading branch information
oussama4 committed Nov 18, 2021
1 parent 293e221 commit 10cd328
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions insert.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,18 @@ func (b *InsertBuilder) Query() (string, []interface{}) {
b.WriteString(") ")
b.WriteString("VALUES ")

for i, v := range b.values {
for i, row := range b.values {
if i > 0 {
b.WriteString(",")
b.WriteString(", ")
}
for j, u := range v {
b.WriteString("(")
for j, col := range row {
if j > 0 {
b.WriteString(",")
b.WriteString(", ")
}
b.WriteArg(u)
b.WriteArg(col)
}
b.WriteString(")")
}

return b.String(), b.args
Expand Down

0 comments on commit 10cd328

Please sign in to comment.