Skip to content

Commit f90eb2c

Browse files
committed
Describe idle_timeout - fixes porsager#119
1 parent 00a10b2 commit f90eb2c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,10 @@ Any query which was already sent over the wire will be rejected if the connectio
585585

586586
There are no guarantees about queries executing in order unless using a transaction with `sql.begin()` or setting `max: 1`. Of course doing a series of queries, one awaiting the other will work as expected, but that's just due to the nature of js async/promise handling, so it's not necessary for this library to be concerned with ordering.
587587

588+
### Idle timeout
589+
590+
Connections will by default not close until `.end()` is called, but often it is useful to have them close when there is no activity or if using Postgres.js in eg. Lamdas. This can be done using the `idle_timeout` option to specify the amount of seconds to wait before automatically closing an idle connection.
591+
588592
## Prepared statements
589593

590594
Prepared statements will automatically be created for any queries where it can be inferred that the query is static. This can be disabled by using the `no_prepare` option. For instance — this is useful when [using PGBouncer in `transaction mode`](https://github.com/porsager/postgres/issues/93).

0 commit comments

Comments
 (0)