Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BatchLoader ¶
type CSVBatchLoader ¶
type CSVBatchLoader struct {
// contains filtered or unexported fields
}
CSVBatchLoader helps us insert in batch
func NewCSVBatchLoader ¶
func NewCSVBatchLoader(f *os.File) *CSVBatchLoader
NewCSVBatchLoader creates a batch loader for csv format
func (*CSVBatchLoader) Close ¶
func (b *CSVBatchLoader) Close(ctx context.Context) error
Close closes the file.
func (*CSVBatchLoader) Flush ¶
func (b *CSVBatchLoader) Flush(ctx context.Context) error
Flush inserts all pending values
func (*CSVBatchLoader) InsertValue ¶
func (b *CSVBatchLoader) InsertValue(ctx context.Context, columns []string) error
InsertValue inserts a value, the loader may flush all pending values.
type SQLBatchLoader ¶
type SQLBatchLoader struct {
// contains filtered or unexported fields
}
SQLBatchLoader helps us insert in batch
func NewSQLBatchLoader ¶
func NewSQLBatchLoader(db *sql.DB, hint string, retryCount int, retryInterval time.Duration) *SQLBatchLoader
NewSQLBatchLoader creates a batch loader for database connection
func (*SQLBatchLoader) Flush ¶
func (b *SQLBatchLoader) Flush(ctx context.Context) error
Flush inserts all pending values
func (*SQLBatchLoader) InsertValue ¶
func (b *SQLBatchLoader) InsertValue(ctx context.Context, query []string) error
InsertValue inserts a value, the loader may flush all pending values.
Click to show internal directories.
Click to hide internal directories.