Note that the interface for the custom JS code inside a report template has changed. It now offers promise-based interface and exposes knex.