(db *database.DB, table string, bufSize int)
| 47 | } |
| 48 | |
| 49 | func newSQLWriter(db *database.DB, table string, bufSize int) (io.WriteCloser, error) { |
| 50 | if e := dropTableIfExists(db.DB, table); e != nil { |
| 51 | return nil, fmt.Errorf("cannot drop table %s: %v", table, e) |
| 52 | } |
| 53 | if e := createTable(db, table); e != nil { |
| 54 | return nil, fmt.Errorf("cannot create table %s: %v", table, e) |
| 55 | } |
| 56 | return newFlushWriteCloser(flushToSQLTable(db.DB, table), noopWrapUp, bufSize), nil |
| 57 | } |