Skip to main content

mssql

(mssql).MSSQLClient

MSSQLClient is a client for MS SQL database. Internally client uses denisenkom/go-mssqldb driver. Kind: inner class of mssql

mssqlClient.Connect(host, port, username, password) ⇒ bool

Connect connects to MS SQL database using given credentials. If connection is successful, it returns true. If connection is unsuccessful, it returns false and error. The connection is closed after the function returns. Kind: instance method of MSSQLClient
Returns: bool - - The status of the connection.
Throws:
  • error - The error encountered during connection.
Example

mssqlClient.ConnectWithDB(host, port, username, password, dbName) ⇒ bool

ConnectWithDB connects to MS SQL database using given credentials and database name. If connection is successful, it returns true. If connection is unsuccessful, it returns false and error. The connection is closed after the function returns. Kind: instance method of MSSQLClient
Returns: bool - - The status of the connection.
Throws:
  • error - The error encountered during connection.
Example

mssqlClient.IsMssql(host, port) ⇒ bool

IsMssql checks if the given host is running MS SQL database. If the host is running MS SQL database, it returns true. If the host is not running MS SQL database, it returns false. Kind: instance method of MSSQLClient
Returns: bool - - The status of the check.
Throws:
  • error - The error encountered during the check.
Example