Skip to content

Commit e922de8

Browse files
committed
Fix bug StreamUpdater
1 parent ca205c2 commit e922de8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

writer/stream_updater.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ func NewStreamUpdaterWithArray[T any](db *sql.DB, tableName string, modelType re
4545
}
4646
func NewSqlStreamUpdater[T any](db *sql.DB, tableName string, modelType reflect.Type, batchSize int,
4747
mp func(context.Context, interface{}) (interface{}, error), toArray func(interface{}) interface {
48-
driver.Valuer
49-
sql.Scanner
50-
}, options ...func(i int) string) *StreamUpdater[T] {
48+
driver.Valuer
49+
sql.Scanner
50+
}, options ...func(i int) string) *StreamUpdater[T] {
5151
var buildParam func(i int) string
5252
if len(options) > 0 && options[0] != nil {
5353
buildParam = options[0]
@@ -60,7 +60,7 @@ func NewSqlStreamUpdater[T any](db *sql.DB, tableName string, modelType reflect.
6060
return &StreamUpdater[T]{db: db, BoolSupport: boolSupport, VersionIndex: -1, schema: schema, tableName: tableName, batchSize: batchSize, BuildParam: buildParam, Map: mp, ToArray: toArray}
6161
}
6262

63-
func (w *StreamUpdater[T]) Write(ctx context.Context, model interface{}) error {
63+
func (w *StreamUpdater[T]) Write(ctx context.Context, model T) error {
6464
if w.Map != nil {
6565
_, er0 := w.Map(ctx, model)
6666
if er0 != nil {

0 commit comments

Comments
 (0)