Skip to content

Commit

Permalink
DBs.Get should read from readBalancer rather than slaves
Browse files Browse the repository at this point in the history
  • Loading branch information
Leon, Yu Le committed Apr 5, 2021
1 parent 34fba28 commit b1d4bde
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mssqlx.go
Original file line number Diff line number Diff line change
Expand Up @@ -932,7 +932,7 @@ func _get(ctx context.Context, target *balancer, dest interface{}, query string,
// Any placeholder parameters are replaced with supplied args.
// An error is returned if the result set is empty.
func (dbs *DBs) Get(dest interface{}, query string, args ...interface{}) (err error) {
_, err = _get(context.Background(), dbs.slaves, dest, query, args...)
_, err = _get(context.Background(), dbs.readBalancer(), dest, query, args...)
return
}

Expand Down

0 comments on commit b1d4bde

Please sign in to comment.