async cancelQuery(query) {
    const connection = this.connection;
    const driver = this.driver;
    const user = this.user;
    const connectionName = connection.name;
    const startTime = new Date();

    const queryContext = {
      executionId: uuidv4(),
      connectionClientId: this.id,
      driver: connection.driver,
      userId: user && user.id,
      userEmail: user && user.email,
      connectionId: connection.id,
      connectionName,
      query,
      startTime,
    };

    appLog.info(queryContext, 'Cancel query');

    try {
      if (!connection.isAsynchronous) {
        throw new Error(
          `Driver ${driver.name} does not support cancellation of queries`
        );
      }

      // If client is connected use that connection,
      // otherwise use driver.cancelQuery to cancel query with fresh one-off connection
      if (this.isConnected()) {
        // uses pre-existing connection to cancel query, and keeps connection open
        // lastActivityAt is updated both before and after query (the query could take a while)
        this.lastActivityAt = new Date();
        await this.client.cancelQuery(query);
        this.lastActivityAt = new Date();
      } else {
        // Opens a new connection to db, runs query, then closes connection
        await driver.cancelQuery(query, connection);
      }
    } catch (error) {
      // It is logged INFO because it isn't necessarily a server/application error
      // It could just be a bad query
      appLog.info(
        { ...queryContext, error: error.toString() },
        'Error cancelling query'
      );

      // Rethrow the error
      // The error here is something expected and should be shown to user
      throw error;
    }
    const stopTime = new Date();
    const queryRunTime = stopTime - startTime;

    appLog.info(
      {
        ...queryContext,
        stopTime,
        queryRunTime,
      },
      'Cancellation finished'
    );
    return true;
  }
Cancel query
If the connectionClient supports persistent database connections and is connected,
it'll use the database connection already established.
If not connected or does not support persistent connection,
it uses the driver.cancelQuery() implementation that will open a connection, run query, then close.
@param {string} query
@returns {Promise}