Let people connect with just a hostname
This commit is contained in:
parent
ee35fe61af
commit
15e3b9b4c0
@ -4,6 +4,7 @@ package postgresql
|
||||
import (
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
"unicode"
|
||||
|
||||
@ -192,6 +193,9 @@ func New(opts ...options.Option) (store.Store, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !strings.Contains(dataSourceName, " ") {
|
||||
dataSourceName = fmt.Sprintf("host=%s", dataSourceName)
|
||||
}
|
||||
db, err := sql.Open(driver, dataSourceName)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
Loading…
Reference in New Issue
Block a user