Skip to content

Commit 088425d

Browse files
committed
adding mssql check
1 parent b14e634 commit 088425d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pkg/js/libs/mssql/mssql.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,14 @@ func (c *MSSQLClient) ExecuteQuery(host string, port int, username, password, db
154154

155155
target := net.JoinHostPort(host, fmt.Sprintf("%d", port))
156156

157+
ok, err := c.IsMssql(host, port)
158+
if err != nil {
159+
return nil, err
160+
}
161+
if !ok {
162+
return nil, fmt.Errorf("not a mssql service")
163+
}
164+
157165
connString := fmt.Sprintf("sqlserver://%s:%s@%s?database=%s&connection+timeout=30",
158166
url.PathEscape(username),
159167
url.PathEscape(password),

0 commit comments

Comments
 (0)