Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): bump github.com/xo/dburl from 0.14.2 to 0.16.0 #183

Merged
merged 2 commits into from
Aug 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ require (
github.com/sijms/go-ora/v2 v2.7.12
github.com/spf13/cobra v1.7.0
github.com/stretchr/testify v1.8.4
github.com/xo/dburl v0.14.2
github.com/xo/dburl v0.16.0
golang.org/x/term v0.11.0
gopkg.in/yaml.v3 v3.0.1
nhooyr.io/websocket v1.8.7
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,8 @@ github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo=
github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw=
github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs=
github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY=
github.com/xo/dburl v0.14.2 h1:tqiXv1glyxFph3LA39RXE4TYidr/yp7kG2YDrgJVjiA=
github.com/xo/dburl v0.14.2/go.mod h1:B7/G9FGungw6ighV8xJNwWYQPMfn3gsi2sn5SE8Bzco=
github.com/xo/dburl v0.16.0 h1:jlBeGe8fnsW+vBYemte903WHQbJnZx7OpJZy2ofq+5g=
github.com/xo/dburl v0.16.0/go.mod h1:B7/G9FGungw6ighV8xJNwWYQPMfn3gsi2sn5SE8Bzco=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
Expand Down
2 changes: 1 addition & 1 deletion internal/app/dataconnector/ping.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func newPingCommand(fullName string, err *os.File, out *os.File, in *os.File) *c
os.Exit(5)
}
u := urlbuilder.BuildURL(dc, err)
dataPingerFactory, ok := dataPingerFactory[u.Unaliased]
dataPingerFactory, ok := dataPingerFactory[u.UnaliasedDriver]
if !ok {
fmt.Fprintln(err, "no datadestination found for database type")
os.Exit(4)
Expand Down
5 changes: 3 additions & 2 deletions internal/app/pull/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ func Inject(
dsfmap map[string]pull.DataSourceFactory,
exporterFactory func(io.Writer) pull.RowExporter,
rrf func(io.ReadCloser) pull.RowReader,
tl pull.TraceListener) {
tl pull.TraceListener,
) {
dataconnectorStorage = dbas
relStorage = rs
tabStorage = ts
Expand Down Expand Up @@ -192,7 +193,7 @@ func getDataSource(dataconnectorName string, out io.Writer) (pull.DataSource, er

u := urlbuilder.BuildURL(alias, out)

datasourceFactory, ok := dataSourceFactories[u.Unaliased]
datasourceFactory, ok := dataSourceFactories[u.UnaliasedDriver]
if !ok {
return nil, fmt.Errorf("no datasource found for database type")
}
Expand Down
4 changes: 2 additions & 2 deletions internal/app/push/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,9 @@ func getDataDestination(dataconnectorName string) (push.DataDestination, *push.E

u := urlbuilder.BuildURL(alias, nil)

datadestinationFactory, ok := datadestinationFactories[u.Unaliased]
datadestinationFactory, ok := datadestinationFactories[u.UnaliasedDriver]
if !ok {
return nil, &push.Error{Description: "no datadestination found for database type " + u.Unaliased}
return nil, &push.Error{Description: "no datadestination found for database type " + u.UnaliasedDriver}
}

return datadestinationFactory.New(u.URL.String(), alias.Schema), nil
Expand Down
2 changes: 1 addition & 1 deletion internal/app/relation/extract.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func newExtractCommand(fullName string, err *os.File, out *os.File, in *os.File)

u := urlbuilder.BuildURL(alias, err)

factory, ok := relationExtractorFactories[u.Unaliased]
factory, ok := relationExtractorFactories[u.UnaliasedDriver]
if !ok {
fmt.Fprintln(err, "no extractor found for database type")
os.Exit(1)
Expand Down
2 changes: 1 addition & 1 deletion internal/app/sequence/extract.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func newExtractCommand(fullName string, err *os.File, out *os.File, in *os.File)

u := urlbuilder.BuildURL(alias, err)

factory, ok := sequenceUpdatorFactories[u.Unaliased]
factory, ok := sequenceUpdatorFactories[u.UnaliasedDriver]
if !ok {
fmt.Fprintln(err, "no extractor found for database type")
os.Exit(1)
Expand Down
2 changes: 1 addition & 1 deletion internal/app/sequence/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func newStatusCommand(fullName string, err *os.File, out *os.File, in *os.File)

u := urlbuilder.BuildURL(alias, err)

factory, ok := sequenceUpdatorFactories[u.Unaliased]
factory, ok := sequenceUpdatorFactories[u.UnaliasedDriver]
if !ok {
fmt.Fprintln(err, "no extractor found for database type")
os.Exit(1)
Expand Down
2 changes: 1 addition & 1 deletion internal/app/sequence/updateSequence.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func newUpdateCommand(fullName string, err *os.File, out *os.File, in *os.File)

u := urlbuilder.BuildURL(alias, err)

factory, ok := sequenceUpdatorFactories[u.Unaliased]
factory, ok := sequenceUpdatorFactories[u.UnaliasedDriver]
if !ok {
fmt.Fprintln(err, "no extractor found for database type")
os.Exit(1)
Expand Down
2 changes: 1 addition & 1 deletion internal/app/table/count.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func newCountCommand(fullName string, err *os.File, out *os.File, in *os.File) *

u := urlbuilder.BuildURL(alias, err)

factory, ok := tableExtractorFactories[u.Unaliased]
factory, ok := tableExtractorFactories[u.UnaliasedDriver]
if !ok {
fmt.Fprintln(err, "no extractor found for database type")
os.Exit(1)
Expand Down
2 changes: 1 addition & 1 deletion internal/app/table/extract.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func newExtractCommand(fullName string, err *os.File, out *os.File, in *os.File)

u := urlbuilder.BuildURL(alias, err)

factory, ok := tableExtractorFactories[u.Unaliased]
factory, ok := tableExtractorFactories[u.UnaliasedDriver]
if !ok {
fmt.Fprintln(err, "no extractor found for database type")
os.Exit(1)
Expand Down
18 changes: 9 additions & 9 deletions internal/app/urlbuilder/urlbuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import (
)

// GenOracleRaw generates a Go Driver for Oracle (godror) DSN from the passed URL.
func GenOracleRaw(u *dburl.URL) (string, error) {
func GenOracleRaw(u *dburl.URL) (string, string, error) {
// example of DSN generated :
// `oracle://proxy_user:proxy_password@host:port/service?proxy client name=schema_owner`

Expand Down Expand Up @@ -61,23 +61,23 @@ func GenOracleRaw(u *dburl.URL) (string, error) {
dsn += fmt.Sprintf("%s=\"%s\"", value, u.Query().Get(value))
}

return dsn, nil
return dsn, "", nil
}

func genJDBCOracle(u *dburl.URL) (string, error) {
func genJDBCOracle(u *dburl.URL) (string, string, error) {
if u.User == nil {
return go_ora.BuildJDBC("", "", u.Host, map[string]string{}), nil
return go_ora.BuildJDBC("", "", u.Host, map[string]string{}), "", nil
}

if un := u.User.Username(); len(un) > 0 {
if up, ok := u.User.Password(); ok {
return go_ora.BuildJDBC(u.User.Username(), up, u.Host, map[string]string{}), nil
return go_ora.BuildJDBC(u.User.Username(), up, u.Host, map[string]string{}), "", nil
} else {
return go_ora.BuildJDBC(u.User.Username(), "", u.Host, map[string]string{}), nil
return go_ora.BuildJDBC(u.User.Username(), "", u.Host, map[string]string{}), "", nil
}
}

return go_ora.BuildJDBC("", "", u.Host, map[string]string{}), nil
return go_ora.BuildJDBC("", "", u.Host, map[string]string{}), "", nil
}

func init() {
Expand All @@ -93,11 +93,11 @@ func init() {

db2Scheme := dburl.Scheme{
Driver: "db2",
Generator: func(u *dburl.URL) (string, error) {
Generator: func(u *dburl.URL) (string, string, error) {
password, _ := u.User.Password()
database := strings.TrimPrefix(u.Path, "/")
result := fmt.Sprintf("HOSTNAME=%s;DATABASE=%s;PORT=%s;UID=%s;PWD=%s", u.Hostname(), database, u.Port(), u.User.Username(), password)
return result, nil
return result, "", nil
},
Transport: dburl.TransportAny,
Opaque: false,
Expand Down
2 changes: 1 addition & 1 deletion internal/infra/dataconnector/pinger_sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func (pdp SQLDataPinger) Ping() *dataconnector.Error {
return &dataconnector.Error{Description: err.Error()}
}

dbx := sqlx.NewDb(db, u.Unaliased)
dbx := sqlx.NewDb(db, u.UnaliasedDriver)

err = dbx.Ping()
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/infra/pull/sql_datasource.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func (ds *SQLDataSource) Open() error {
return err
}

ds.dbx = sqlx.NewDb(db, u.Unaliased)
ds.dbx = sqlx.NewDb(db, u.UnaliasedDriver)

err = ds.dbx.Ping()
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/infra/push/datadestination_sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func (dd *SQLDataDestination) Open(plan push.Plan, mode push.Mode, disableConstr
return &push.Error{Description: err.Error()}
}

dbx := sqlx.NewDb(db, u.Unaliased)
dbx := sqlx.NewDb(db, u.UnaliasedDriver)

err = dbx.Ping()
if err != nil {
Expand Down
Loading