Response Filters

Response filters are filters that are invoked whenever a response is received from the database server. Response filters can examine the response and do whatever they want to it before it gets sent over to the database client.

Response filters need to be more careful about performance than request filter, because a single request packet can result in millions of response packets

Context

All response filters define the following variables, which can be accessed from your JavaScript code:

  • log : A Logger object to output messages to the logging system

  • context : a container object with the following properties:

    • packet : the packet being processed - can be any response packet type

    • packetType : the type of the packet, equivalent to context.packet.getPacketType()

    • filterContext : the variables that persist through the life of the filter

    • adapterContext : the variables that persist through the life of this database connection

Response filters for Postgres