Wait blocks until the whole batch is executed.
()
| 67 | |
| 68 | // Wait blocks until the whole batch is executed. |
| 69 | func (b *BatchInserter) Wait() error { |
| 70 | for { |
| 71 | q := b.nextQuery() |
| 72 | if q == nil { |
| 73 | break |
| 74 | } |
| 75 | if _, err := q.Exec(); err != nil { |
| 76 | b.err = err |
| 77 | break |
| 78 | } |
| 79 | } |
| 80 | return b.Err() |
| 81 | } |
| 82 | |
| 83 | // Err returns any error while executing the batch. |
| 84 | func (b *BatchInserter) Err() error { |
nothing calls this directly
no test coverage detected