Skip to content

Commit

Permalink
DBs.Get should read from readBalancer rather than slaves (#7)
Browse files Browse the repository at this point in the history
Co-authored-by: Leon, Yu Le <yuleon@seagroup.com>
  • Loading branch information
nullne and Leon, Yu Le authored Apr 6, 2021
1 parent 34fba28 commit 332ddbb
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 332ddbb

Please sign in to comment.