Skip to content

Commit

Permalink
Updating dburl, sqlserver driver
Browse files Browse the repository at this point in the history
  • Loading branch information
kenshaw committed Mar 30, 2023
1 parent 8b1e2d7 commit 51caf2c
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 24 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ associated database, scheme / build tag, and scheme aliases:
[d-adodb]: https://github.com/mattn/go-adodb
[d-athena]: https://github.com/uber/athenadriver
[d-avatica]: https://github.com/apache/calcite-avatica-go
[d-bigquery]: https://github.com/go-gorm/gorm
[d-bigquery]: https://github.com/go-gorm/bigquery
[d-cassandra]: https://github.com/MichaelS11/go-cql-driver
[d-clickhouse]: https://github.com/ClickHouse/clickhouse-go
[d-cosmos]: https://github.com/btnguyen2k/gocosmos
Expand Down
2 changes: 1 addition & 1 deletion drivers/bigquery/bigquery.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Package bigquery defines and registers usql's Google BigQuery driver.
//
// See: https://github.com/go-gorm/gorm
// See: https://github.com/go-gorm/bigquery
package bigquery

import (
Expand Down
12 changes: 0 additions & 12 deletions drivers/sqlserver/sqlserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,12 @@ package sqlserver

import (
"context"
"database/sql"
"fmt"
"io"
"strconv"
"strings"

sqlserver "github.com/microsoft/go-mssqldb" // DRIVER
"github.com/microsoft/go-mssqldb/azuread"
"github.com/xo/dburl"
"github.com/xo/usql/drivers"
"github.com/xo/usql/drivers/metadata"
)
Expand All @@ -24,15 +21,6 @@ func init() {
AllowMultilineComments: true,
RequirePreviousPassword: true,
LexerName: "tsql",
Open: func(u *dburl.URL, _, _ func() io.Writer) (func(string, string) (*sql.DB, error), error) {
return func(_ string, params string) (*sql.DB, error) {
driver := "sqlserver"
if u.Query().Has("fedauth") {
driver = azuread.DriverName
}
return sql.Open(driver, params)
}, nil
},
Version: func(ctx context.Context, db drivers.DB) (string, error) {
var ver, level, edition string
err := db.QueryRowContext(
Expand Down
8 changes: 5 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ require (
github.com/trinodb/trino-go-client v0.310.0
github.com/uber/athenadriver v1.1.14
github.com/vertica/vertica-sql-go v1.3.1
github.com/xo/dburl v0.13.0
github.com/xo/dburl v0.13.1
github.com/xo/tblfmt v0.10.1
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e
github.com/yookoala/realpath v1.0.0
Expand Down Expand Up @@ -108,8 +108,8 @@ require (
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.14.0 // indirect
github.com/aws/aws-sdk-go-v2/service/s3 v1.31.0 // indirect
github.com/aws/smithy-go v1.13.5 // indirect
github.com/beltran/gohive v1.5.3 // indirect
github.com/beltran/gosasl v0.0.0-20220904020400-625f43db35e0 // indirect
github.com/beltran/gohive v1.5.4 // indirect
github.com/beltran/gosasl v0.0.0-20230115020419-e3b503e58833 // indirect
github.com/beltran/gssapi v0.0.0-20200324152954-d86554db4bab // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/btnguyen2k/consu/checksum v0.1.2 // indirect
Expand Down Expand Up @@ -290,3 +290,5 @@ require (
modernc.org/token v1.1.0 // indirect
modernc.org/zappy v1.0.6 // indirect
)

replace github.com/google/flatbuffers => github.com/google/flatbuffers v0.0.0-20230110200425-62e4d2e5b215
14 changes: 7 additions & 7 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,11 @@ github.com/aws/aws-sdk-go-v2/service/sts v1.18.7/go.mod h1:JuTnSoeePXmMVe9G8Ncjj
github.com/aws/smithy-go v1.13.5 h1:hgz0X/DX0dGqTYpGALqXJoRKRj5oQ7150i5FdTePzO8=
github.com/aws/smithy-go v1.13.5/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA=
github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g=
github.com/beltran/gohive v1.5.3 h1:fGvLt4IoVbXMbg4B14igkwCd435ODug95C9tQcbKCmg=
github.com/beltran/gohive v1.5.3/go.mod h1:BJbXAhof7gWk5+kl0y6Ox8TFDJ1xv6gwDksF7l15LFI=
github.com/beltran/gohive v1.5.4 h1:Zb6VkqsDP0QhefL2A5vnKC0p5opIAbU8D57aTA8H3II=
github.com/beltran/gohive v1.5.4/go.mod h1:BJbXAhof7gWk5+kl0y6Ox8TFDJ1xv6gwDksF7l15LFI=
github.com/beltran/gosasl v0.0.0-20200715011608-d5475aebb293/go.mod h1:Qx8cW6jkI8riyzmklj80kAIkv+iezFUTBiGU0qHhHes=
github.com/beltran/gosasl v0.0.0-20220904020400-625f43db35e0 h1:0+69UIVi5lyyhIZxjp5tnFcD1D8b0j723xgo5kM3P/I=
github.com/beltran/gosasl v0.0.0-20220904020400-625f43db35e0/go.mod h1:Qx8cW6jkI8riyzmklj80kAIkv+iezFUTBiGU0qHhHes=
github.com/beltran/gosasl v0.0.0-20230115020419-e3b503e58833 h1:3mDCea/Jo3bCaS62fNuKeNai/zaNjSOjU4hQ6SWixnU=
github.com/beltran/gosasl v0.0.0-20230115020419-e3b503e58833/go.mod h1:Qx8cW6jkI8riyzmklj80kAIkv+iezFUTBiGU0qHhHes=
github.com/beltran/gssapi v0.0.0-20200324152954-d86554db4bab h1:ayfcn60tXOSYy5zUN1AMSTQo4nJCf7hrdzAVchpPst4=
github.com/beltran/gssapi v0.0.0-20200324152954-d86554db4bab/go.mod h1:GLe4UoSyvJ3cVG+DVtKen5eAiaD8mAJFuV5PT3Eeg9Q=
github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8=
Expand Down Expand Up @@ -723,7 +723,7 @@ github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEW
github.com/gomodule/redigo v1.7.1-0.20190724094224-574c33c3df38/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4=
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/flatbuffers v1.11.0/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8=
github.com/google/flatbuffers v0.0.0-20230110200425-62e4d2e5b215/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8=
github.com/google/flatbuffers/go v0.0.0-20230110200425-62e4d2e5b215 h1:HA3/6NDG1q6qLD2sCqDFT/ua/1/wctoLo7leuFcFdSE=
github.com/google/flatbuffers/go v0.0.0-20230110200425-62e4d2e5b215/go.mod h1:qmRCJW6OqZkfBt584Cmq1im0f4367CLrdABrq5lMOWo=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
Expand Down Expand Up @@ -1357,8 +1357,8 @@ github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQ
github.com/xhit/go-str2duration/v2 v2.1.0 h1:lxklc02Drh6ynqX+DdPyp5pCKLUQpRT8bp8Ydu2Bstc=
github.com/xhit/go-str2duration/v2 v2.1.0/go.mod h1:ohY8p+0f07DiV6Em5LKB0s2YpLtXVyJfNt1+BlmyAsU=
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
github.com/xo/dburl v0.13.0 h1:kq+oD1j/m8DnJ/p6G/LQXRosVchs8q5/AszEUKkvYfo=
github.com/xo/dburl v0.13.0/go.mod h1:K6rSPgbVqP3ZFT0RHkdg/M3M5KhLeV2MaS/ZqaLd1kA=
github.com/xo/dburl v0.13.1 h1:EV+BCdo539sc/mBrny0VxaEGLM0b1U0mJA9RpP80ux0=
github.com/xo/dburl v0.13.1/go.mod h1:B7/G9FGungw6ighV8xJNwWYQPMfn3gsi2sn5SE8Bzco=
github.com/xo/tblfmt v0.0.0-20190609041254-28c54ec42ce8/go.mod h1:3U5kKQdIhwACye7ml3acccHmjGExY9WmUGU7rnDWgv0=
github.com/xo/tblfmt v0.10.1 h1:Nw8A/4aKQbA1XY5N62ZmoBOwK1YI9ixF4Wi1yLdiUwE=
github.com/xo/tblfmt v0.10.1/go.mod h1:vJm27N/x4E7avH7MvmBvIF/mGpsmKep5DP27QXHUurU=
Expand Down

0 comments on commit 51caf2c

Please sign in to comment.