static receive(options, data, result, ctx) {
        if (typeof options.receive === 'function') {
            try {
                options.receive({data, result, ctx});
            } catch (e) {
                // throwing an error during event 'receive'
                // will result in a reject for the request.
                return e instanceof Error ? e : new npm.utils.InternalError(e);
            }
        }
    }
@event receive
@description
Global notification of any data received from the database, coming from a regular query or from a stream.

The event is fired before the data reaches the client, and it serves two purposes:
 - Providing selective data logging for debugging;
 - Pre-processing data before it reaches the client.

**NOTES:**
- If you alter the size of `data` directly or through the `result` object, it may affect `QueryResultMask`
  validation for regular queries, which is executed right after.
- Any data pre-processing needs to be fast here, to avoid performance penalties.
- If the event handler throws an error, the original request will be rejected with that error.

For methods {@link Database#multi Database.multi} and {@link Database#multiResult Database.multiResult},
this event is called for every result that's returned. And for method {@link Database#stream Database.stream},
the event occurs for every record.

@param {{}} e Event Properties

@param {Array<Object>} e.data
Array of received objects/rows.

If any of those objects are modified during notification, the client will receive the modified data.

@param {external:Result} e.result
- Original $[Result] object, if the data is from a non-stream query, in which case `data = result.rows`.
  For single-query requests, $[Result] object is extended with property `duration` - number of milliseconds
  it took to send the query, execute it and get the result back.
- It is `undefined` when the data comes from a stream (method {@link Database#stream Database.stream}).

@param {EventContext} e.ctx
Event Context Object.

@example

// Example below shows the fastest way to camelize all column names.
// NOTE: The example does not do processing for nested JSON objects.

const initOptions = {

    // pg-promise initialization options...

    receive(e) {
        camelizeColumns(e.data);
    }
};

function camelizeColumns(data) {
    const tmp = data[0];
    for (const prop in tmp) {
        const camel = pgp.utils.camelize(prop);
        if (!(camel in tmp)) {
            for (let i = 0; i < data.length; i++) {
                const d = data[i];
                d[camel] = d[prop];
                delete d[prop];
            }
        }
    }
}