parent
a3e2e73b65
commit
1aa62881bb
|
@ -41,7 +41,7 @@ func parseURL(connstr string) (string, error) {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
if u.Scheme != "postgresql" {
|
if u.Scheme != "postgresql" && u.Scheme != "postgres" {
|
||||||
return "", fmt.Errorf("invalid connection protocol: %s", u.Scheme)
|
return "", fmt.Errorf("invalid connection protocol: %s", u.Scheme)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ func (p *pqDriver) Parse(driverName, dataSourceName string) (*core.Uri, error) {
|
||||||
db := &core.Uri{DbType: core.POSTGRES}
|
db := &core.Uri{DbType: core.POSTGRES}
|
||||||
o := make(values)
|
o := make(values)
|
||||||
var err error
|
var err error
|
||||||
if strings.HasPrefix(dataSourceName, "postgresql://") {
|
if strings.HasPrefix(dataSourceName, "postgresql://") || strings.HasPrefix(dataSourceName, "postgres://") {
|
||||||
dataSourceName, err = parseURL(dataSourceName)
|
dataSourceName, err = parseURL(dataSourceName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
Loading…
Reference in New Issue