Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@danneu
Created October 29, 2016 21:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danneu/c6ae99525026fcf32b3c5e91a4a8b991 to your computer and use it in GitHub Desktop.
Save danneu/c6ae99525026fcf32b3c5e91a4a8b991 to your computer and use it in GitHub Desktop.
// objective:
// - move pool.query to pool._query
// - redefine pool.query to wrap the original pool.query
pg.Pool.prototype._query = pg.Pool.prototype.query
pg.Pool.prototype.query = wrapper(async function (sql, params) {
return await this._query(sql, params)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment