Don't try to insert nothing into the database. Fixes #11
This commit is contained in:
@@ -132,6 +132,9 @@ type MessagePart struct {
|
||||
}
|
||||
|
||||
func (m *Message) MassInsert(msgs []MessagePart) {
|
||||
if len(msgs) == 0 {
|
||||
return
|
||||
}
|
||||
valueStringFormat := "($1, $%d, $2, $3, $4, $5, $6, $7, $%d)"
|
||||
if m.db.Dialect == dbutil.SQLite {
|
||||
valueStringFormat = strings.ReplaceAll(valueStringFormat, "$", "?")
|
||||
|
||||
Reference in New Issue
Block a user