where to destroy knex connection

前端 未结 3 1373
独厮守ぢ
独厮守ぢ 2021-02-14 21:11

I\'m using knex with pg.

I have a project similar as following.

dbClient.js

const dbClient = require(\'knex\')({
  client: \'pg\',
  connection:          


        
3条回答
  •  孤城傲影
    2021-02-14 21:49

    You probably don't usually need to explicitly call knex.destroy() – this is implied by the documentation itself saying (emphasis mine):

    If you ever need to explicitly teardown the connection pool, you may use knex.destroy([callback]).

提交回复
热议问题