You've already forked go-sqlmock
mirror of
https://github.com/DATA-DOG/go-sqlmock.git
synced 2025-07-03 00:36:52 +02:00
add AddRows function to allow adding multiple rows
This commit is contained in:
10
rows.go
10
rows.go
@ -188,6 +188,16 @@ func (r *Rows) AddRow(values ...driver.Value) *Rows {
|
||||
return r
|
||||
}
|
||||
|
||||
// AddRows adds multiple rows composed from database driver.Value slice and
|
||||
// returns the same instance to perform subsequent actions.
|
||||
func (r *Rows) AddRows(values ...[]driver.Value) *Rows {
|
||||
for _, value := range values {
|
||||
r.AddRow(value...)
|
||||
}
|
||||
|
||||
return r
|
||||
}
|
||||
|
||||
// FromCSVString build rows from csv string.
|
||||
// return the same instance to perform subsequent actions.
|
||||
// Note that the number of values must match the number
|
||||
|
Reference in New Issue
Block a user