Skip to content

Commit

Permalink
Merge pull request #1 from goark/debug-and-refactoring
Browse files Browse the repository at this point in the history
Bump up parent module
  • Loading branch information
spiegel-im-spiegel authored Sep 11, 2022
2 parents b27ff66 + bed89ce commit 0749a1a
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,21 @@ import (
)

func main() {
pgdrv.New(&sshql.Dialer{
dialer := &sshql.Dialer{
Hostname: "sshserver",
Port: 22,
Username: "remoteuser",
Password: "passphraseforauthkey",
PrivateKey: "/home/username/.ssh/id_eddsa",
}).Register()
}
pgdrv.New(dialer).Register()

db, err := sql.Open(pgdrv.DriverName, "postgres://dbuser:dbpassword@localhost:5432/example?sslmode=disable")
if err != nil {
fmt.Fprintln(os.Stderr, err)
return
}
defer dialer.Close()
defer db.Close()

rows, err := db.Query("SELECT id, name FROM example ORDER BY id")
Expand Down Expand Up @@ -72,19 +74,21 @@ import (
)

func main() {
mysqldrv.New(&sshql.Dialer{
dialer := &sshql.Dialer{
Hostname: "sshserver",
Port: 22,
Username: "remoteuser",
Password: "passphraseforauthkey",
PrivateKey: "/home/username/.ssh/id_eddsa",
}).RegisterDial()
}
mysqldrv.New(dialer).RegisterDial()

db, err := sql.Open("mysql", fmt.Sprintf("dbuser:dbpassword@%s(localhost:3306)/dbname", mysqldrv.DialName))
if err != nil {
fmt.Fprintln(os.Stderr, err)
return
}
defer dialer.Close()
defer db.Close()

rows, err := db.Query("SELECT id, name FROM example ORDER BY id")
Expand Down
2 changes: 1 addition & 1 deletion mysqldrv/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.19
require (
github.com/go-sql-driver/mysql v1.6.0
github.com/goark/errs v1.1.0
github.com/goark/sshql v0.1.2
github.com/goark/sshql v0.1.3
)

require (
Expand Down
4 changes: 2 additions & 2 deletions mysqldrv/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfC
github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
github.com/goark/errs v1.1.0 h1:FKnyw4LVyRADIjM8Nj0Up6r0/y5cfADvZAd1E+tthXE=
github.com/goark/errs v1.1.0/go.mod h1:TtaPEoadm2mzqzfXdkkfpN2xuniCFm2q4JH+c1qzaqw=
github.com/goark/sshql v0.1.2 h1:WWGRF9Cz3rzUDz/qDZwyrZN66o840FdaLsTn4KXQDEk=
github.com/goark/sshql v0.1.2/go.mod h1:CKO0diQlHb5BpJMi4mT0MlhA5qqrG3Pg+5b+wi6OtgU=
github.com/goark/sshql v0.1.3 h1:fAzkGTkteiwAtkBroi8YS44V1zCYern5l42MqWGl6Bo=
github.com/goark/sshql v0.1.3/go.mod h1:CKO0diQlHb5BpJMi4mT0MlhA5qqrG3Pg+5b+wi6OtgU=
golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 h1:Y/gsMcFOcR+6S6f3YeMKl5g+dZMEWqcz5Czj/GWYbkM=
golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 h1:SrN+KX8Art/Sf4HNj6Zcz06G7VEz+7w9tdXTPOZ7+l4=
Expand Down
2 changes: 1 addition & 1 deletion pgdrv/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/goark/sshql/pgdrv
go 1.19

require (
github.com/goark/sshql v0.1.2
github.com/goark/sshql v0.1.3
github.com/lib/pq v1.10.7
)

Expand Down
4 changes: 2 additions & 2 deletions pgdrv/go.sum
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
github.com/goark/errs v1.1.0 h1:FKnyw4LVyRADIjM8Nj0Up6r0/y5cfADvZAd1E+tthXE=
github.com/goark/errs v1.1.0/go.mod h1:TtaPEoadm2mzqzfXdkkfpN2xuniCFm2q4JH+c1qzaqw=
github.com/goark/sshql v0.1.2 h1:WWGRF9Cz3rzUDz/qDZwyrZN66o840FdaLsTn4KXQDEk=
github.com/goark/sshql v0.1.2/go.mod h1:CKO0diQlHb5BpJMi4mT0MlhA5qqrG3Pg+5b+wi6OtgU=
github.com/goark/sshql v0.1.3 h1:fAzkGTkteiwAtkBroi8YS44V1zCYern5l42MqWGl6Bo=
github.com/goark/sshql v0.1.3/go.mod h1:CKO0diQlHb5BpJMi4mT0MlhA5qqrG3Pg+5b+wi6OtgU=
github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw=
github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 h1:Y/gsMcFOcR+6S6f3YeMKl5g+dZMEWqcz5Czj/GWYbkM=
Expand Down

0 comments on commit 0749a1a

Please sign in to comment.