Skip to content

Commit

Permalink
fix iterator
Browse files Browse the repository at this point in the history
  • Loading branch information
hariso committed Sep 5, 2023
1 parent cd9cbbe commit c1e58c9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions source/iterator/iterator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit c1e58c9

Please sign in to comment.