{"action":"created","comment":{"url":"https://api.github.com/repos/fastify/fastify-postgres/pulls/comments/224681885","pull_request_review_id":164111275,"id":224681885,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNDY4MTg4NQ==","diff_hunk":"@@ -56,6 +56,10 @@ function transact (fn, cb) {\n }\n \n function fastifyPostgres (fastify, options, next) {\n+  let pg = defaultPg\n+  if (options.pg) {","path":"index.js","position":14,"original_position":14,"commit_id":"9af5886bfbf9ae2aec404658984192bd152885cf","original_commit_id":"9af5886bfbf9ae2aec404658984192bd152885cf","user":{"login":"salmanm","id":2510597,"node_id":"MDQ6VXNlcjI1MTA1OTc=","avatar_url":"https://avatars2.githubusercontent.com/u/2510597?v=4","gravatar_id":"","url":"https://api.github.com/users/salmanm","html_url":"https://github.com/salmanm","followers_url":"https://api.github.com/users/salmanm/followers","following_url":"https://api.github.com/users/salmanm/following{/other_user}","gists_url":"https://api.github.com/users/salmanm/gists{/gist_id}","starred_url":"https://api.github.com/users/salmanm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/salmanm/subscriptions","organizations_url":"https://api.github.com/users/salmanm/orgs","repos_url":"https://api.github.com/users/salmanm/repos","events_url":"https://api.github.com/users/salmanm/events{/privacy}","received_events_url":"https://api.github.com/users/salmanm/received_events","type":"User","site_admin":false},"body":"While this seems legit to be able to pass `pg` into it, but I don't think there's a good use case.\r\n\r\nAt this line `pg === defaultPg` is actually `true` even if you pass the `pg` instance after patching it with `pg-range`, so not sure if there's any benefit in passing it altogether.\r\n\r\nAll `pg-range` does is patch the `pg`, it doesn't return a new/different object. So just `require`ing `pg-range` **before** `fastify-postgres` should do the trick.\r\n\r\nOr am I missing something?","created_at":"2018-10-12T06:28:24Z","updated_at":"2018-10-12T06:28:24Z","html_url":"https://github.com/fastify/fastify-postgres/pull/30#discussion_r224681885","pull_request_url":"https://api.github.com/repos/fastify/fastify-postgres/pulls/30","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/fastify/fastify-postgres/pulls/comments/224681885"},"html":{"href":"https://github.com/fastify/fastify-postgres/pull/30#discussion_r224681885"},"pull_request":{"href":"https://api.github.com/repos/fastify/fastify-postgres/pulls/30"}}},"pull_request":{"url":"https://api.github.com/repos/fastify/fastify-postgres/pulls/30","id":221697844,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIxNjk3ODQ0","html_url":"https://github.com/fastify/fastify-postgres/pull/30","diff_url":"https://github.com/fastify/fastify-postgres/pull/30.diff","patch_url":"https://github.com/fastify/fastify-postgres/pull/30.patch","issue_url":"https://api.github.com/repos/fastify/fastify-postgres/issues/30","number":30,"state":"closed","locked":false,"title":"add `pg` option, a simple test and some doc","user":{"login":"temsa","id":174621,"node_id":"MDQ6VXNlcjE3NDYyMQ==","avatar_url":"https://avatars3.githubusercontent.com/u/174621?v=4","gravatar_id":"","url":"https://api.github.com/users/temsa","html_url":"https://github.com/temsa","followers_url":"https://api.github.com/users/temsa/followers","following_url":"https://api.github.com/users/temsa/following{/other_user}","gists_url":"https://api.github.com/users/temsa/gists{/gist_id}","starred_url":"https://api.github.com/users/temsa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/temsa/subscriptions","organizations_url":"https://api.github.com/users/temsa/orgs","repos_url":"https://api.github.com/users/temsa/repos","events_url":"https://api.github.com/users/temsa/events{/privacy}","received_events_url":"https://api.github.com/users/temsa/received_events","type":"User","site_admin":false},"body":"should fix #28 \r\n\r\nThe test of the option is very simple and could probably be better","created_at":"2018-10-10T08:22:39Z","updated_at":"2018-10-12T06:28:24Z","closed_at":"2018-10-10T14:33:15Z","merged_at":"2018-10-10T14:33:15Z","merge_commit_sha":"9445b8892e5fff730616f872ef67b29bb7df8502","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/fastify/fastify-postgres/pulls/30/commits","review_comments_url":"https://api.github.com/repos/fastify/fastify-postgres/pulls/30/comments","review_comment_url":"https://api.github.com/repos/fastify/fastify-postgres/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fastify/fastify-postgres/issues/30/comments","statuses_url":"https://api.github.com/repos/fastify/fastify-postgres/statuses/9af5886bfbf9ae2aec404658984192bd152885cf","head":{"label":"temsa:override-pg","ref":"override-pg","sha":"9af5886bfbf9ae2aec404658984192bd152885cf","user":{"login":"temsa","id":174621,"node_id":"MDQ6VXNlcjE3NDYyMQ==","avatar_url":"https://avatars3.githubusercontent.com/u/174621?v=4","gravatar_id":"","url":"https://api.github.com/users/temsa","html_url":"https://github.com/temsa","followers_url":"https://api.github.com/users/temsa/followers","following_url":"https://api.github.com/users/temsa/following{/other_user}","gists_url":"https://api.github.com/users/temsa/gists{/gist_id}","starred_url":"https://api.github.com/users/temsa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/temsa/subscriptions","organizations_url":"https://api.github.com/users/temsa/orgs","repos_url":"https://api.github.com/users/temsa/repos","events_url":"https://api.github.com/users/temsa/events{/privacy}","received_events_url":"https://api.github.com/users/temsa/received_events","type":"User","site_admin":false},"repo":{"id":152284975,"node_id":"MDEwOlJlcG9zaXRvcnkxNTIyODQ5NzU=","name":"fastify-postgres","full_name":"temsa/fastify-postgres","private":false,"owner":{"login":"temsa","id":174621,"node_id":"MDQ6VXNlcjE3NDYyMQ==","avatar_url":"https://avatars3.githubusercontent.com/u/174621?v=4","gravatar_id":"","url":"https://api.github.com/users/temsa","html_url":"https://github.com/temsa","followers_url":"https://api.github.com/users/temsa/followers","following_url":"https://api.github.com/users/temsa/following{/other_user}","gists_url":"https://api.github.com/users/temsa/gists{/gist_id}","starred_url":"https://api.github.com/users/temsa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/temsa/subscriptions","organizations_url":"https://api.github.com/users/temsa/orgs","repos_url":"https://api.github.com/users/temsa/repos","events_url":"https://api.github.com/users/temsa/events{/privacy}","received_events_url":"https://api.github.com/users/temsa/received_events","type":"User","site_admin":false},"html_url":"https://github.com/temsa/fastify-postgres","description":"Fastify PostgreSQL connection plugin","fork":true,"url":"https://api.github.com/repos/temsa/fastify-postgres","forks_url":"https://api.github.com/repos/temsa/fastify-postgres/forks","keys_url":"https://api.github.com/repos/temsa/fastify-postgres/keys{/key_id}","collaborators_url":"https://api.github.com/repos/temsa/fastify-postgres/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/temsa/fastify-postgres/teams","hooks_url":"https://api.github.com/repos/temsa/fastify-postgres/hooks","issue_events_url":"https://api.github.com/repos/temsa/fastify-postgres/issues/events{/number}","events_url":"https://api.github.com/repos/temsa/fastify-postgres/events","assignees_url":"https://api.github.com/repos/temsa/fastify-postgres/assignees{/user}","branches_url":"https://api.github.com/repos/temsa/fastify-postgres/branches{/branch}","tags_url":"https://api.github.com/repos/temsa/fastify-postgres/tags","blobs_url":"https://api.github.com/repos/temsa/fastify-postgres/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/temsa/fastify-postgres/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/temsa/fastify-postgres/git/refs{/sha}","trees_url":"https://api.github.com/repos/temsa/fastify-postgres/git/trees{/sha}","statuses_url":"https://api.github.com/repos/temsa/fastify-postgres/statuses/{sha}","languages_url":"https://api.github.com/repos/temsa/fastify-postgres/languages","stargazers_url":"https://api.github.com/repos/temsa/fastify-postgres/stargazers","contributors_url":"https://api.github.com/repos/temsa/fastify-postgres/contributors","subscribers_url":"https://api.github.com/repos/temsa/fastify-postgres/subscribers","subscription_url":"https://api.github.com/repos/temsa/fastify-postgres/subscription","commits_url":"https://api.github.com/repos/temsa/fastify-postgres/commits{/sha}","git_commits_url":"https://api.github.com/repos/temsa/fastify-postgres/git/commits{/sha}","comments_url":"https://api.github.com/repos/temsa/fastify-postgres/comments{/number}","issue_comment_url":"https://api.github.com/repos/temsa/fastify-postgres/issues/comments{/number}","contents_url":"https://api.github.com/repos/temsa/fastify-postgres/contents/{+path}","compare_url":"https://api.github.com/repos/temsa/fastify-postgres/compare/{base}...{head}","merges_url":"https://api.github.com/repos/temsa/fastify-postgres/merges","archive_url":"https://api.github.com/repos/temsa/fastify-postgres/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/temsa/fastify-postgres/downloads","issues_url":"https://api.github.com/repos/temsa/fastify-postgres/issues{/number}","pulls_url":"https://api.github.com/repos/temsa/fastify-postgres/pulls{/number}","milestones_url":"https://api.github.com/repos/temsa/fastify-postgres/milestones{/number}","notifications_url":"https://api.github.com/repos/temsa/fastify-postgres/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/temsa/fastify-postgres/labels{/name}","releases_url":"https://api.github.com/repos/temsa/fastify-postgres/releases{/id}","deployments_url":"https://api.github.com/repos/temsa/fastify-postgres/deployments","created_at":"2018-10-09T16:32:14Z","updated_at":"2018-10-09T16:32:17Z","pushed_at":"2018-10-11T12:20:43Z","git_url":"git://github.com/temsa/fastify-postgres.git","ssh_url":"git@github.com:temsa/fastify-postgres.git","clone_url":"https://github.com/temsa/fastify-postgres.git","svn_url":"https://github.com/temsa/fastify-postgres","homepage":null,"size":42,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"fastify:master","ref":"master","sha":"772ff91b64226761910ff111fdf2635df4e7e4e6","user":{"login":"fastify","id":24939410,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI0OTM5NDEw","avatar_url":"https://avatars3.githubusercontent.com/u/24939410?v=4","gravatar_id":"","url":"https://api.github.com/users/fastify","html_url":"https://github.com/fastify","followers_url":"https://api.github.com/users/fastify/followers","following_url":"https://api.github.com/users/fastify/following{/other_user}","gists_url":"https://api.github.com/users/fastify/gists{/gist_id}","starred_url":"https://api.github.com/users/fastify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fastify/subscriptions","organizations_url":"https://api.github.com/users/fastify/orgs","repos_url":"https://api.github.com/users/fastify/repos","events_url":"https://api.github.com/users/fastify/events{/privacy}","received_events_url":"https://api.github.com/users/fastify/received_events","type":"Organization","site_admin":false},"repo":{"id":106552085,"node_id":"MDEwOlJlcG9zaXRvcnkxMDY1NTIwODU=","name":"fastify-postgres","full_name":"fastify/fastify-postgres","private":false,"owner":{"login":"fastify","id":24939410,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI0OTM5NDEw","avatar_url":"https://avatars3.githubusercontent.com/u/24939410?v=4","gravatar_id":"","url":"https://api.github.com/users/fastify","html_url":"https://github.com/fastify","followers_url":"https://api.github.com/users/fastify/followers","following_url":"https://api.github.com/users/fastify/following{/other_user}","gists_url":"https://api.github.com/users/fastify/gists{/gist_id}","starred_url":"https://api.github.com/users/fastify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fastify/subscriptions","organizations_url":"https://api.github.com/users/fastify/orgs","repos_url":"https://api.github.com/users/fastify/repos","events_url":"https://api.github.com/users/fastify/events{/privacy}","received_events_url":"https://api.github.com/users/fastify/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/fastify/fastify-postgres","description":"Fastify PostgreSQL connection plugin","fork":false,"url":"https://api.github.com/repos/fastify/fastify-postgres","forks_url":"https://api.github.com/repos/fastify/fastify-postgres/forks","keys_url":"https://api.github.com/repos/fastify/fastify-postgres/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fastify/fastify-postgres/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fastify/fastify-postgres/teams","hooks_url":"https://api.github.com/repos/fastify/fastify-postgres/hooks","issue_events_url":"https://api.github.com/repos/fastify/fastify-postgres/issues/events{/number}","events_url":"https://api.github.com/repos/fastify/fastify-postgres/events","assignees_url":"https://api.github.com/repos/fastify/fastify-postgres/assignees{/user}","branches_url":"https://api.github.com/repos/fastify/fastify-postgres/branches{/branch}","tags_url":"https://api.github.com/repos/fastify/fastify-postgres/tags","blobs_url":"https://api.github.com/repos/fastify/fastify-postgres/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fastify/fastify-postgres/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fastify/fastify-postgres/git/refs{/sha}","trees_url":"https://api.github.com/repos/fastify/fastify-postgres/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fastify/fastify-postgres/statuses/{sha}","languages_url":"https://api.github.com/repos/fastify/fastify-postgres/languages","stargazers_url":"https://api.github.com/repos/fastify/fastify-postgres/stargazers","contributors_url":"https://api.github.com/repos/fastify/fastify-postgres/contributors","subscribers_url":"https://api.github.com/repos/fastify/fastify-postgres/subscribers","subscription_url":"https://api.github.com/repos/fastify/fastify-postgres/subscription","commits_url":"https://api.github.com/repos/fastify/fastify-postgres/commits{/sha}","git_commits_url":"https://api.github.com/repos/fastify/fastify-postgres/git/commits{/sha}","comments_url":"https://api.github.com/repos/fastify/fastify-postgres/comments{/number}","issue_comment_url":"https://api.github.com/repos/fastify/fastify-postgres/issues/comments{/number}","contents_url":"https://api.github.com/repos/fastify/fastify-postgres/contents/{+path}","compare_url":"https://api.github.com/repos/fastify/fastify-postgres/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fastify/fastify-postgres/merges","archive_url":"https://api.github.com/repos/fastify/fastify-postgres/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fastify/fastify-postgres/downloads","issues_url":"https://api.github.com/repos/fastify/fastify-postgres/issues{/number}","pulls_url":"https://api.github.com/repos/fastify/fastify-postgres/pulls{/number}","milestones_url":"https://api.github.com/repos/fastify/fastify-postgres/milestones{/number}","notifications_url":"https://api.github.com/repos/fastify/fastify-postgres/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fastify/fastify-postgres/labels{/name}","releases_url":"https://api.github.com/repos/fastify/fastify-postgres/releases{/id}","deployments_url":"https://api.github.com/repos/fastify/fastify-postgres/deployments","created_at":"2017-10-11T12:36:23Z","updated_at":"2018-10-11T17:53:17Z","pushed_at":"2018-10-11T17:53:15Z","git_url":"git://github.com/fastify/fastify-postgres.git","ssh_url":"git@github.com:fastify/fastify-postgres.git","clone_url":"https://github.com/fastify/fastify-postgres.git","svn_url":"https://github.com/fastify/fastify-postgres","homepage":null,"size":44,"stargazers_count":17,"watchers_count":17,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":8,"open_issues":0,"watchers":17,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fastify/fastify-postgres/pulls/30"},"html":{"href":"https://github.com/fastify/fastify-postgres/pull/30"},"issue":{"href":"https://api.github.com/repos/fastify/fastify-postgres/issues/30"},"comments":{"href":"https://api.github.com/repos/fastify/fastify-postgres/issues/30/comments"},"review_comments":{"href":"https://api.github.com/repos/fastify/fastify-postgres/pulls/30/comments"},"review_comment":{"href":"https://api.github.com/repos/fastify/fastify-postgres/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fastify/fastify-postgres/pulls/30/commits"},"statuses":{"href":"https://api.github.com/repos/fastify/fastify-postgres/statuses/9af5886bfbf9ae2aec404658984192bd152885cf"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"salmanm"}}