docs: function automock (dbClient) {
      // require db client to have a query method
      if (typeof dbClient.query !== 'function') {
          throw new Error('automock error: db-client must have query method')
      }
      // capture original query method
      var queryFunction = dbClient.query
      // create wrapper for queryPromise method
      dbClient.query = function dbClientQueryAutomockWrapper (query, params, options, session) {
          // if query is not a string then pass through to original
          if (typeof query !== 'string') {
              return queryFunction.apply(this, arguments)
          }
          // require params options and session to be objects
          params = requireValidOptionalObject(params)
          options = requireValidOptionalObject(options)
          session = requireValidOptionalObject(session)
          // get stable id for args
          var stableId = dbQueryStableId({
              moduleCallSignature: session.moduleCallSignature,
              options: options,
              params: params,
              query: query,
              requestId: session.requestId,
              stack: session.stack,
          })
          // get mock data for db query
          var dbQueryMock = immutableAutomock.dbQueryMocks[stableId]
          var dbResponseMock = dbQueryMock && immutableAutomock.dbResponseMocks[dbQueryMock.dbQueryId]
          // both query and response mock data exist
          if (dbQueryMock && dbResponseMock) {
              // mock data is a successful query
              if (dbResponseMock.dbResponseSuccess) {
                  // clone mock data before returning to prevent mock pollution
                  var res = _.cloneDeep(dbResponseMock.data)
                  // add info to res
                  res.info = _.cloneDeep(dbResponseMock.info)
                  // resolve with mock data
                  return Promise.resolve(res)
              }
              // mock data is a query error
              else {
                  // build mock error object
                  var err = new Error(dbResponseMock.data.message)
                  err.code = dbResponseMock.data.code
                  err.isOperational = dbResponseMock.data.isOperational
                  // reject with mock error object
                  return Promise.reject(err)
              }
          }
          // if requireAutomock flag is set on session throw error
          else if (session.requireAutomock) {
              // create new error object
              var error = new Error('missing automock for query: '+query)
              // add call data to error
              error.automockCallData = {
                  moduleCallId: session.moduleCallId,
                  options: options,
                  params: params,
                  query: query,
                  requestId: session.requestId,
              }
              error.automockStableId = stableId
              // throw error
              throw error
          }
          // do original query
          else {
              return queryFunction.apply(this, arguments)
          }
      }
  }