Skip to content

Commit

Permalink
feat: make WithReadOnlyReplica variadic
Browse files Browse the repository at this point in the history
  • Loading branch information
vmihailenco committed Jan 18, 2025
1 parent dfc4059 commit 4cbb15a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions db.go
Original file line number Diff line number Diff line change
Expand Up @@ -771,9 +771,9 @@ func NewReadWriteConnResolver(opts ...ReadWriteConnResolverOption) *ReadWriteCon

type ReadWriteConnResolverOption func(r *ReadWriteConnResolver)

func WithReadOnlyReplica(db *sql.DB) ReadWriteConnResolverOption {
func WithReadOnlyReplica(dbs ...*sql.DB) ReadWriteConnResolverOption {
return func(r *ReadWriteConnResolver) {
r.replicas = append(r.replicas, db)
r.replicas = append(r.replicas, dbs...)
}
}

Expand Down

0 comments on commit 4cbb15a

Please sign in to comment.