MCPcopy Create free account
hub / github.com/sql-machine-learning/sqlflow / newSQLWriter

Function newSQLWriter

go/sqlfs/sql_writer.go:49–57  ·  view source on GitHub ↗
(db *database.DB, table string, bufSize int)

Source from the content-addressed store, hash-verified

47}
48
49func 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}

Callers 3

TestSQLFSNewSQLWriterFunction · 0.85
CreateFunction · 0.85

Calls 5

newFlushWriteCloserFunction · 0.85
flushToSQLTableFunction · 0.85
ErrorfMethod · 0.80
dropTableIfExistsFunction · 0.70
createTableFunction · 0.70

Tested by 2

TestSQLFSNewSQLWriterFunction · 0.68