Skip to content

Commit

Permalink
clean up, update go.mod
Browse files Browse the repository at this point in the history
  • Loading branch information
flarco committed Oct 2, 2024
1 parent 7c17e51 commit 61e838f
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 32 deletions.
29 changes: 0 additions & 29 deletions core/dbio/connection/connection_discover.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package connection

import (
"context"
"sort"
"strings"
"time"

Expand All @@ -12,8 +11,6 @@ import (
"github.com/slingdata-io/sling-cli/core/dbio/database"
"github.com/slingdata-io/sling-cli/core/dbio/filesys"
"github.com/slingdata-io/sling-cli/core/dbio/iop"
"github.com/slingdata-io/sling-cli/core/env"
"github.com/spf13/cast"
)

func (c *Connection) Test() (ok bool, err error) {
Expand Down Expand Up @@ -244,29 +241,3 @@ func (c *Connection) Discover(opt *DiscoverOptions) (ok bool, nodes filesys.File

return
}

func EnvFileConnectionEntries(ef env.EnvFile, sourceName string) (entries ConnEntries, err error) {
m := g.M()
if err = g.JSONConvert(ef, &m); err != nil {
return entries, g.Error(err)
}

connsMap := map[string]ConnEntry{}
profileConns, err := ReadConnections(m)
for _, conn := range profileConns {
c := ConnEntry{
Name: strings.ToUpper(conn.Info().Name),
Description: conn.Type.NameLong(),
Source: sourceName,
Connection: conn,
}
connsMap[c.Name] = c
}

entries = lo.Values(connsMap)
sort.Slice(entries, func(i, j int) bool {
return cast.ToString(entries[i].Name) < cast.ToString(entries[j].Name)
})

return
}
2 changes: 1 addition & 1 deletion core/dbio/iop/datatype_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func initProcessRow(name string) (columns []Column, row []interface{}) {
} else if name == "int64" {
row = []interface{}{int64(48714719874194)}
} else if name == "string" {
row = []interface{}{g.RandString(g.AplhanumericRunes, 1000)}
row = []interface{}{g.RandString(g.AlphaNumericRunes, 1000)}
} else if name == "timestamp" || name == "timestampz" {
row = []interface{}{time.Now()}
// row = []interface{}{"17-OCT-20 07.01.59.000000 PM"}
Expand Down
2 changes: 1 addition & 1 deletion core/sling/task_run_write.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func (t *TaskExecution) WriteToDb(cfg *Config, df *iop.Dataflow, tgtConn databas
}

// some weird column / commit error, not picking up latest columns
suffix2 := g.RandString(g.NumericRunes, 1) + g.RandString(g.AplhanumericRunes, 1)
suffix2 := g.RandString(g.NumericRunes, 1) + g.RandString(g.AlphaNumericRunes, 1)
suffix2 = lo.Ternary(
tgtConn.GetType().DBNameUpperCase(),
strings.ToUpper(suffix2),
Expand Down
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ require (
github.com/dustin/go-humanize v1.0.1
github.com/fatih/color v1.17.0
github.com/flarco/bigquery v0.0.9
github.com/flarco/g v0.1.122
github.com/flarco/g v0.1.123
github.com/getsentry/sentry-go v0.27.0
github.com/go-sql-driver/mysql v1.8.1
github.com/gobwas/glob v0.2.3
Expand Down Expand Up @@ -192,6 +192,7 @@ require (
github.com/montanaflynn/stats v0.7.0 // indirect
github.com/mtibben/percent v0.2.1 // indirect
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect
github.com/nalgeon/redka v0.5.2 // indirect
github.com/nats-io/nats.go v1.36.0 // indirect
github.com/nats-io/nkeys v0.4.7 // indirect
github.com/nats-io/nuid v1.0.1 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,8 @@ github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs
github.com/mtibben/percent v0.2.1/go.mod h1:KG9uO+SZkUp+VkRHsCdYQV3XSZrrSpR3O9ibNBTZrns=
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU=
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/nalgeon/redka v0.5.2 h1:CX71v88kYj55EwJ10zq7U2eJdH0xcLAIjvKFvUMoM0o=
github.com/nalgeon/redka v0.5.2/go.mod h1:vLxjY3XS9IwBID2YEFWeeMiN4Ar/DtKd4JW62JTAxuU=
github.com/nats-io/nats.go v1.36.0 h1:suEUPuWzTSse/XhESwqLxXGuj8vGRuPRoG7MoRN/qyU=
github.com/nats-io/nats.go v1.36.0/go.mod h1:Ubdu4Nh9exXdSz0RVWRFBbRfrbSxOYd26oF0wkWclB8=
github.com/nats-io/nkeys v0.4.7 h1:RwNJbbIdYCoClSDNY7QVKZlyb/wfT6ugvFCiKy6vDvI=
Expand Down

0 comments on commit 61e838f

Please sign in to comment.