Module: Client

Client connection pool factory.
Source:

Methods

close() → {Promise}

Pool destructor (closes and cleans up all the connections in the pool).
Source:
Returns:
Type
Promise
Example
const client = mysqlx.getClient({ user: 'root' }, { pooling: { enabled: true, maxSize: 3 } })

client.getSession()
  .then(() => client.close());

getSession() → {Promise.<Session>}

Retrieve a connection from the pool if one is available.
Source:
Returns:
The active session instance.
Type
Promise.<Session>
Example
const client = mysqlx.getClient({ user: 'root' }, { pooling: { enabled: true, maxSize: 3 } })

client.getSession()
  .then(session => {
    console.log(session.inspect()); // { pooling: true, ... }
  })