From c1e58c902e18f0716a88d9cc2625a84f076d89bc Mon Sep 17 00:00:00 2001 From: Haris Osmanagic Date: Tue, 5 Sep 2023 12:43:24 +0200 Subject: [PATCH] fix iterator --- source/iterator/iterator.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/iterator/iterator.go b/source/iterator/iterator.go index ba6334b..b5c8e4f 100644 --- a/source/iterator/iterator.go +++ b/source/iterator/iterator.go @@ -66,7 +66,7 @@ func New(ctx context.Context, driverName string, pos *Position, config config.So batchSize: config.BatchSize, } - err := iterator.openDB(ctx, driverName) + err := iterator.openDB(ctx, driverName, config.DSN) if err != nil { return nil, fmt.Errorf("open db: %w", err) } @@ -323,9 +323,9 @@ func (iter *Iterator) latestSnapshotValue(ctx context.Context) (any, error) { return latestSnapshotValue, nil } -func (iter *Iterator) openDB(ctx context.Context, driverName string) error { +func (iter *Iterator) openDB(ctx context.Context, driverName string, dsn string) error { var err error - iter.db, err = sqlx.Open(driverName, config.DSN) + iter.db, err = sqlx.Open(driverName, dsn) if err != nil { return fmt.Errorf("open db connection: %w", err) }