Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Statement timeout and keep_alive pg pool options #9

Merged
merged 3 commits into from May 18, 2018
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions package.json
Expand Up @@ -22,7 +22,8 @@
"homepage": "http://github.com/joeandaverde/tinypg",
"author": "Joe Andaverde",
"contributors": [
"Scott Smerchek"
"Scott Smerchek",
"Alex Munda"
],
"keywords": [
"postgres",
Expand All @@ -39,7 +40,8 @@
"glob": "7.1.2",
"lodash": "4.17.5",
"node-uuid": "1.4.7",
"pg-format": "1.0.1"
"pg-format": "1.0.1",
"source-map-support": "0.5.6"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be in dev!

},
"devDependencies": {
"@types/chai": "3.4.34",
Expand Down
2 changes: 2 additions & 0 deletions src/tiny.ts
Expand Up @@ -42,9 +42,11 @@ export class TinyPg {
port: port,
database: database,
ssl: enable_ssl ? _.defaultTo(options.tls_options, true) : false,
keepAlive: pool_options.keep_alive,
connectionTimeoutMillis: pool_options.connection_timeout_ms,
idleTimeoutMillis: pool_options.idle_timeout_ms,
application_name: pool_options.application_name,
statement_timeout: pool_options.statement_timeout_ms,
max: pool_options.max,
min: pool_options.min,
log: Debug('tinypg:pool'),
Expand Down
3 changes: 3 additions & 0 deletions src/types.ts
Expand Up @@ -14,6 +14,8 @@ export interface TinyPgOptions {
connection_timeout_ms?: number
idle_timeout_ms?: number
application_name?: string
statement_timeout_ms?: number
keep_alive?: boolean
}
}

Expand Down Expand Up @@ -86,5 +88,6 @@ export interface TinyPgEvents extends EventEmitter {
declare module 'pg' {
export interface PoolConfig {
log?: any
statement_timeout?: number
}
}
33 changes: 19 additions & 14 deletions yarn.lock
Expand Up @@ -19,8 +19,8 @@
resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-2.2.41.tgz#e27cf0817153eb9f2713b2d3f6c68f1e1c3ca608"

"@types/node@*":
version "9.6.2"
resolved "https://registry.yarnpkg.com/@types/node/-/node-9.6.2.tgz#e49ac1adb458835e95ca6487bc20f916b37aff23"
version "10.1.1"
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.1.1.tgz#ca39d8607fa1fcb146b0530420b93f1dd4802f6c"

"@types/node@^8.10.0":
version "8.10.9"
Expand All @@ -33,8 +33,8 @@
moment ">=2.14.0"

"@types/pg@^7.4.5":
version "7.4.5"
resolved "https://registry.yarnpkg.com/@types/pg/-/pg-7.4.5.tgz#eca6fdfefaa0865cb652b9a8265be217e10acb1e"
version "7.4.9"
resolved "https://registry.yarnpkg.com/@types/pg/-/pg-7.4.9.tgz#441a88f14bb89d531e00bcf4cf02b23dd512168d"
dependencies:
"@types/events" "*"
"@types/node" "*"
Expand All @@ -59,6 +59,10 @@ browser-stdout@1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.0.tgz#f351d32969d32fa5d7a5567154263d928ae3bd1f"

buffer-from@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.0.0.tgz#4cb8832d23612589b0406e9e2956c17f06fdf531"

buffer-writer@1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/buffer-writer/-/buffer-writer-1.0.1.tgz#22a936901e3029afcd7547eb4487ceb697a3bf08"
Expand Down Expand Up @@ -87,7 +91,7 @@ debug@2.6.8:
dependencies:
ms "2.0.0"

debug@^3.1.0:
debug@3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261"
dependencies:
Expand Down Expand Up @@ -253,8 +257,8 @@ mocha@^3.2.0:
supports-color "3.1.2"

moment@>=2.14.0:
version "2.22.0"
resolved "https://registry.yarnpkg.com/moment/-/moment-2.22.0.tgz#7921ade01017dd45186e7fee5f424f0b8663a730"
version "2.22.1"
resolved "https://registry.yarnpkg.com/moment/-/moment-2.22.1.tgz#529a2e9bf973f259c9643d237fda84de3a26e8ad"

ms@2.0.0:
version "2.0.0"
Expand Down Expand Up @@ -346,15 +350,16 @@ semver@4.3.2:
version "4.3.2"
resolved "https://registry.yarnpkg.com/semver/-/semver-4.3.2.tgz#c7a07158a80bedd052355b770d82d6640f803be7"

source-map-support@0.4.11:
version "0.4.11"
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.11.tgz#647f939978b38535909530885303daf23279f322"
source-map-support@0.5.6:
version "0.5.6"
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.6.tgz#4435cee46b1aab62b8e8610ce60f788091c51c13"
dependencies:
source-map "^0.5.3"
buffer-from "^1.0.0"
source-map "^0.6.0"

source-map@^0.5.3:
version "0.5.7"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc"
source-map@^0.6.0:
version "0.6.1"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"

split@^1.0.0:
version "1.0.1"
Expand Down