Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BatchLoader ¶
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.