Module: Connection

This module specifies the interface of an internal MySQL server connection.

Members


<inner, readonly> IntegerType :string

Convert either all integers to a BigInt or to a string, or alternatively, convert only unsafe integers to a BigInt or to a string.
Type:
  • string
Example
IntegerType.BIGINT
IntegerType.STRING
IntegerType.UNSAFE_BIGINT
IntegerType.UNSAFE_BIGINT

Type Definitions


Endpoint

MySQL server endpoint details.
Type:
  • Object
Properties:
Name Type Argument Default Description
host string <optional>
localhost hostname or IP (v4 or v6) of a MySQL server instance
port number <optional>
33060 X Plugin port on the MySQL server instance
priority number <optional>
priority of an endpoint relative to the others (endpoints with higher priority are picked first)
socket string <optional>
relative or absolute path of a local Unix socket file

Properties

Connection configuration properties.
Type:
  • Object
Properties:
Name Type Argument Default Description
auth string <optional>
name of the client-side authentication mechanism to use
connectTimeout number <optional>
10000 maximum ammount of time (ms) to wait for a server connection to be opened
connectionAttributes Object <optional>
{} key-value object containing names and values of session attributes
endpoints Array.<module:Connection~Endpoint> <optional>
[] list of endpoints to connect to
host string <optional>
localhost hostname or IP (v4 or v6) of a MySQL server instance
password string <optional>
password for the MySQL account (defaults to '')
port number <optional>
33060 X Plugin port on the MySQL server instance
resolveSrv boolean <optional>
false enable or disable DNS SRV resolution
schema string <optional>
default database to connect to (defaults to '')
socket string <optional>
relative or absolute path of a local Unix socket file
resolveSrv boolean <optional>
false use the host to perform a DNS SRV lookup and obtain the list of endpoints
tls module:Connection~TLS <optional>
TLS options
user string <optional>
user of the MySQL account (defaults to '')

TLS

Connection TLS-specific properties.
Type:
  • Object
Properties:
Name Type Argument Default Description
enabled boolean <optional>
true enables or disables TLS
ca string <optional>
path of a file containing a certificate authority chain used to verify the server certificate
crl string <optional>
path of a file containing a certificate revocation list used, alongside a certificate authority, to verify the server certificate
versions Array.<string> <optional>
TLSv1.2, TLSv1.3 restrict the list of allowed TLS versions (TLSv1.2, TLSv1.3)
ciphershuites Array.<string> <optional>
list of ciphersuites to allow (IANA syntax)