Skip to content

Commit

Permalink
Support postgres:// schema connection URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
tomtaylor committed Feb 6, 2025
1 parent 8eb1ca1 commit 9483d00
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/db/postgres/pgdump/pgdump.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ type Options struct {

func (o *Options) GetPgDSN() (string, error) {
// URI or Standard format
if strings.HasPrefix(o.DbName, "postgresql://") || strings.Contains(o.DbName, "=") {
if strings.HasPrefix(o.DbName, "postgresql://") || strings.HasPrefix(o.DbName, "postgres://") || strings.Contains(o.DbName, "=") {
return o.DbName, nil
}

Expand Down
2 changes: 1 addition & 1 deletion internal/db/postgres/pgrestore/pgrestore.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func (o *Options) ToDataSectionSettings() *DataSectionSettings {
}

func (o *Options) GetPgDSN() (string, error) {
if strings.HasPrefix(o.DbName, "postgresql://") || strings.Contains(o.DbName, "=") {
if strings.HasPrefix(o.DbName, "postgresql://") || strings.HasPrefix(o.DbName, "postgres://") || strings.Contains(o.DbName, "=") {
return o.DbName, nil
}

Expand Down

0 comments on commit 9483d00

Please sign in to comment.