Connect with MariaDB database based on config, Handle any errors in connection Set the pool handlers on connection.error Also set proper timezone once connection is connected.
Closes the connection. This can also be called with a connection whose setup failed, which the pool never handed out, and which may already be closed.
The connection to close
Called after connect, once the connection has been registered with the pool.
Override this to attach error handlers or run post-connection setup queries.
If this method throws, the connection is closed with disconnect.
Calling pool.destroy() on the connection from here does not throw, but it does not
close the connection either: the pool only takes ownership once setup is done.
To have a connection that breaks during setup closed, make validate return false
for it: once setup is done, the connection is checked with validate (or the
pool.validate option), and closed if the check fails.
The connection returned by connect
Determine if a connection is still valid or not.
Unless the pool.validate option is set, this is also called once for every new connection
after it has been set up, so it must return true for a connection that was just created.
MariaDB Connection Manager
Get connections, validate and disconnect them. AbstractConnectionManager pooling use it to handle MariaDB specific connections Use https://github.com/MariaDB/mariadb-connector-nodejs to connect with MariaDB server