Skip to content

Commit

Permalink
Extend search path
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-farries committed Jul 31, 2024
1 parent 8ff9841 commit d1010d8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/roll/roll.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"context"
"database/sql"
"fmt"
"strings"

"github.com/lib/pq"

Expand Down Expand Up @@ -78,7 +79,8 @@ func setupConn(ctx context.Context, pgURL, schema string, options options) (*sql
dsn = pgURL
}

dsn += " search_path=" + schema
searchPath := append([]string{schema}, options.searchPath...)
dsn += " search_path=" + strings.Join(searchPath, ",")

conn, err := sql.Open("postgres", dsn)
if err != nil {
Expand Down

0 comments on commit d1010d8

Please sign in to comment.