mysql.MySQLClient
MySQLClient is a client for MySQL database. Internally client uses go-sql-driver/mysql driver.
Example
• new MySQLClient(): MySQLClient
mysql.ts:33
▸ Connect(host
, port
, username
): boolean
Connect connects to MySQL 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.
Name | Type |
---|---|
host | string |
port | number |
username | string |
boolean
Example
mysql.ts:61
▸ ConnectWithDSN(dsn
): boolean
ConnectWithDSN connects to MySQL database using given DSN. we override mysql dialer with fastdialer so it respects network policy If connection is successful, it returns true.
Name | Type |
---|---|
dsn | string |
boolean
Example
mysql.ts:91
▸ ExecuteQuery(host
, port
, username
): SQLResult
ExecuteQuery connects to Mysql database using given credentials and executes a query on the db.
Name | Type |
---|---|
host | string |
port | number |
username | string |
Example
mysql.ts:124
▸ ExecuteQueryOnDB(host
, port
, username
): SQLResult
ExecuteQuery connects to Mysql database using given credentials and executes a query on the db.
Name | Type |
---|---|
host | string |
port | number |
username | string |
Example
mysql.ts:139
▸ ExecuteQueryWithOpts(opts
, query
): SQLResult
ExecuteQueryWithOpts connects to Mysql database using given credentials and executes a query on the db.
Name | Type |
---|---|
opts | MySQLOptions |
query | string |
Example
mysql.ts:109
▸ FingerprintMySQL(host
, port
): MySQLInfo
returns MySQLInfo when fingerpint is successful
Name | Type |
---|---|
host | string |
port | number |
Example
mysql.ts:75
▸ IsMySQL(host
, port
): boolean
IsMySQL checks if the given host is running MySQL database. If the host is running MySQL database, it returns true. If the host is not running MySQL database, it returns false.
Name | Type |
---|---|
host | string |
port | number |
boolean
Example
mysql.ts:44