I currently use [knexjs.org](http://knexjs.org/), promise instead of regular callback and use pool connection for SQL query. At the first time, it run smoothly. But now i usually face pool connection error. The code something like this

```
knex('user_detail')
                .select('id','full_name','phone','email')
                .where('id', id_user)
                .then((result) => {
                    resolve(result);
                })
                .catch((error) => {
                    reject(error);
                })

```

But now i usually get error connection timeout and error pool connection in it. The first thing why it gets an error maybe because i haven't release the connection, but i have code like this,

```
knex('user_detail')
                .select('id','full_name','phone','email')
                .where('id', id_user)
                .then((result) => {
                    resolve(result);
                })
                .catch((error) => {
                    reject(error);
                })
                .finally(() => {
                    knex.destroy()
                })

```

It works for the first try, but failed at second try and get an error `There is no pool defined on the current client` and sometimes error `The pool is probably full`

Can someone explain to me what's going on and how i solve it? thanks.