{"action":"created","comment":{"url":"https://api.github.com/repos/doximity/mpn/pulls/comments/35474761","id":35474761,"diff_hunk":"@@ -54,7 +54,15 @@ func (sr SettingsRecord) GetSchedule() domain.Schedule {\n \n func (db SettingsDb) GetSettings(endpointId int64, pushNotieType string) (*domain.PushNotificationSettings, error) {\n \tvar record SettingsRecord\n-\terr := db.db.Get(&record, \"SELECT * FROM push_notification_settings WHERE endpoint_id = ? AND push_notification_type = ?\", endpointId, pushNotieType)\n+\n+\tq := Query{}.\n+\t\tSelect(\"*\").\n+\t\tFrom(\"push_notification_settings\").\n+\t\tWhere(\"endpoint_id = ? AND push_notification_type = ?\", endpointId, pushNotieType).\n+\t\tOrder(\"created_at DESC\").\n+\t\tLimit(1)\n+\n+\terr := Exec(db.db, q).Get(&record)","path":"mysql/settingsdb.go","position":13,"original_position":13,"commit_id":"a40da24474e1dc05a7c7e33fd8d3232147cfd8aa","original_commit_id":"a40da24474e1dc05a7c7e33fd8d3232147cfd8aa","user":{"login":"rafaelbandeira3","id":11786,"avatar_url":"https://avatars.githubusercontent.com/u/11786?v=3","gravatar_id":"","url":"https://api.github.com/users/rafaelbandeira3","html_url":"https://github.com/rafaelbandeira3","followers_url":"https://api.github.com/users/rafaelbandeira3/followers","following_url":"https://api.github.com/users/rafaelbandeira3/following{/other_user}","gists_url":"https://api.github.com/users/rafaelbandeira3/gists{/gist_id}","starred_url":"https://api.github.com/users/rafaelbandeira3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rafaelbandeira3/subscriptions","organizations_url":"https://api.github.com/users/rafaelbandeira3/orgs","repos_url":"https://api.github.com/users/rafaelbandeira3/repos","events_url":"https://api.github.com/users/rafaelbandeira3/events{/privacy}","received_events_url":"https://api.github.com/users/rafaelbandeira3/received_events","type":"User","site_admin":false},"body":"I am thinking about the use of `.Limit(1)`, one other way to do it is by encapsulating that inside `QueryExecutor.Get`, as we'll always want to limit the return there.","created_at":"2015-07-24T23:28:21Z","updated_at":"2015-07-24T23:28:21Z","html_url":"https://github.com/doximity/mpn/pull/39#discussion_r35474761","pull_request_url":"https://api.github.com/repos/doximity/mpn/pulls/39","_links":{"self":{"href":"https://api.github.com/repos/doximity/mpn/pulls/comments/35474761"},"html":{"href":"https://github.com/doximity/mpn/pull/39#discussion_r35474761"},"pull_request":{"href":"https://api.github.com/repos/doximity/mpn/pulls/39"}}},"pull_request":{"url":"https://api.github.com/repos/doximity/mpn/pulls/39","id":40808507,"html_url":"https://github.com/doximity/mpn/pull/39","diff_url":"https://github.com/doximity/mpn/pull/39.diff","patch_url":"https://github.com/doximity/mpn/pull/39.patch","issue_url":"https://api.github.com/repos/doximity/mpn/issues/39","number":39,"state":"open","locked":false,"title":"Log push settings.","user":{"login":"benmanns","id":27628,"avatar_url":"https://avatars.githubusercontent.com/u/27628?v=3","gravatar_id":"","url":"https://api.github.com/users/benmanns","html_url":"https://github.com/benmanns","followers_url":"https://api.github.com/users/benmanns/followers","following_url":"https://api.github.com/users/benmanns/following{/other_user}","gists_url":"https://api.github.com/users/benmanns/gists{/gist_id}","starred_url":"https://api.github.com/users/benmanns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benmanns/subscriptions","organizations_url":"https://api.github.com/users/benmanns/orgs","repos_url":"https://api.github.com/users/benmanns/repos","events_url":"https://api.github.com/users/benmanns/events{/privacy}","received_events_url":"https://api.github.com/users/benmanns/received_events","type":"User","site_admin":false},"body":"https://www.pivotaltracker.com/story/show/95075492","created_at":"2015-07-24T19:38:56Z","updated_at":"2015-07-24T23:28:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3d4625f3dcd3d82792832b232ecd03ea7bb92750","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/doximity/mpn/pulls/39/commits","review_comments_url":"https://api.github.com/repos/doximity/mpn/pulls/39/comments","review_comment_url":"https://api.github.com/repos/doximity/mpn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/doximity/mpn/issues/39/comments","statuses_url":"https://api.github.com/repos/doximity/mpn/statuses/a40da24474e1dc05a7c7e33fd8d3232147cfd8aa","head":{"label":"doximity:log-push-settings","ref":"log-push-settings","sha":"a40da24474e1dc05a7c7e33fd8d3232147cfd8aa","user":{"login":"doximity","id":181836,"avatar_url":"https://avatars.githubusercontent.com/u/181836?v=3","gravatar_id":"","url":"https://api.github.com/users/doximity","html_url":"https://github.com/doximity","followers_url":"https://api.github.com/users/doximity/followers","following_url":"https://api.github.com/users/doximity/following{/other_user}","gists_url":"https://api.github.com/users/doximity/gists{/gist_id}","starred_url":"https://api.github.com/users/doximity/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doximity/subscriptions","organizations_url":"https://api.github.com/users/doximity/orgs","repos_url":"https://api.github.com/users/doximity/repos","events_url":"https://api.github.com/users/doximity/events{/privacy}","received_events_url":"https://api.github.com/users/doximity/received_events","type":"Organization","site_admin":false},"repo":{"id":29880610,"name":"mpn","full_name":"doximity/mpn","owner":{"login":"doximity","id":181836,"avatar_url":"https://avatars.githubusercontent.com/u/181836?v=3","gravatar_id":"","url":"https://api.github.com/users/doximity","html_url":"https://github.com/doximity","followers_url":"https://api.github.com/users/doximity/followers","following_url":"https://api.github.com/users/doximity/following{/other_user}","gists_url":"https://api.github.com/users/doximity/gists{/gist_id}","starred_url":"https://api.github.com/users/doximity/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doximity/subscriptions","organizations_url":"https://api.github.com/users/doximity/orgs","repos_url":"https://api.github.com/users/doximity/repos","events_url":"https://api.github.com/users/doximity/events{/privacy}","received_events_url":"https://api.github.com/users/doximity/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/doximity/mpn","description":"Mobile Push Notification server infrastructure written in Golang","fork":false,"url":"https://api.github.com/repos/doximity/mpn","forks_url":"https://api.github.com/repos/doximity/mpn/forks","keys_url":"https://api.github.com/repos/doximity/mpn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/doximity/mpn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/doximity/mpn/teams","hooks_url":"https://api.github.com/repos/doximity/mpn/hooks","issue_events_url":"https://api.github.com/repos/doximity/mpn/issues/events{/number}","events_url":"https://api.github.com/repos/doximity/mpn/events","assignees_url":"https://api.github.com/repos/doximity/mpn/assignees{/user}","branches_url":"https://api.github.com/repos/doximity/mpn/branches{/branch}","tags_url":"https://api.github.com/repos/doximity/mpn/tags","blobs_url":"https://api.github.com/repos/doximity/mpn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/doximity/mpn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/doximity/mpn/git/refs{/sha}","trees_url":"https://api.github.com/repos/doximity/mpn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/doximity/mpn/statuses/{sha}","languages_url":"https://api.github.com/repos/doximity/mpn/languages","stargazers_url":"https://api.github.com/repos/doximity/mpn/stargazers","contributors_url":"https://api.github.com/repos/doximity/mpn/contributors","subscribers_url":"https://api.github.com/repos/doximity/mpn/subscribers","subscription_url":"https://api.github.com/repos/doximity/mpn/subscription","commits_url":"https://api.github.com/repos/doximity/mpn/commits{/sha}","git_commits_url":"https://api.github.com/repos/doximity/mpn/git/commits{/sha}","comments_url":"https://api.github.com/repos/doximity/mpn/comments{/number}","issue_comment_url":"https://api.github.com/repos/doximity/mpn/issues/comments{/number}","contents_url":"https://api.github.com/repos/doximity/mpn/contents/{+path}","compare_url":"https://api.github.com/repos/doximity/mpn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/doximity/mpn/merges","archive_url":"https://api.github.com/repos/doximity/mpn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/doximity/mpn/downloads","issues_url":"https://api.github.com/repos/doximity/mpn/issues{/number}","pulls_url":"https://api.github.com/repos/doximity/mpn/pulls{/number}","milestones_url":"https://api.github.com/repos/doximity/mpn/milestones{/number}","notifications_url":"https://api.github.com/repos/doximity/mpn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/doximity/mpn/labels{/name}","releases_url":"https://api.github.com/repos/doximity/mpn/releases{/id}","created_at":"2015-01-26T20:41:51Z","updated_at":"2015-05-29T10:24:26Z","pushed_at":"2015-07-24T20:24:25Z","git_url":"git://github.com/doximity/mpn.git","ssh_url":"git@github.com:doximity/mpn.git","clone_url":"https://github.com/doximity/mpn.git","svn_url":"https://github.com/doximity/mpn","homepage":null,"size":3096,"stargazers_count":2,"watchers_count":2,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":4,"forks":1,"open_issues":4,"watchers":2,"default_branch":"master"}},"base":{"label":"doximity:master","ref":"master","sha":"238e08390b0457d3b954432d033ad18b85d5b835","user":{"login":"doximity","id":181836,"avatar_url":"https://avatars.githubusercontent.com/u/181836?v=3","gravatar_id":"","url":"https://api.github.com/users/doximity","html_url":"https://github.com/doximity","followers_url":"https://api.github.com/users/doximity/followers","following_url":"https://api.github.com/users/doximity/following{/other_user}","gists_url":"https://api.github.com/users/doximity/gists{/gist_id}","starred_url":"https://api.github.com/users/doximity/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doximity/subscriptions","organizations_url":"https://api.github.com/users/doximity/orgs","repos_url":"https://api.github.com/users/doximity/repos","events_url":"https://api.github.com/users/doximity/events{/privacy}","received_events_url":"https://api.github.com/users/doximity/received_events","type":"Organization","site_admin":false},"repo":{"id":29880610,"name":"mpn","full_name":"doximity/mpn","owner":{"login":"doximity","id":181836,"avatar_url":"https://avatars.githubusercontent.com/u/181836?v=3","gravatar_id":"","url":"https://api.github.com/users/doximity","html_url":"https://github.com/doximity","followers_url":"https://api.github.com/users/doximity/followers","following_url":"https://api.github.com/users/doximity/following{/other_user}","gists_url":"https://api.github.com/users/doximity/gists{/gist_id}","starred_url":"https://api.github.com/users/doximity/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doximity/subscriptions","organizations_url":"https://api.github.com/users/doximity/orgs","repos_url":"https://api.github.com/users/doximity/repos","events_url":"https://api.github.com/users/doximity/events{/privacy}","received_events_url":"https://api.github.com/users/doximity/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/doximity/mpn","description":"Mobile Push Notification server infrastructure written in Golang","fork":false,"url":"https://api.github.com/repos/doximity/mpn","forks_url":"https://api.github.com/repos/doximity/mpn/forks","keys_url":"https://api.github.com/repos/doximity/mpn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/doximity/mpn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/doximity/mpn/teams","hooks_url":"https://api.github.com/repos/doximity/mpn/hooks","issue_events_url":"https://api.github.com/repos/doximity/mpn/issues/events{/number}","events_url":"https://api.github.com/repos/doximity/mpn/events","assignees_url":"https://api.github.com/repos/doximity/mpn/assignees{/user}","branches_url":"https://api.github.com/repos/doximity/mpn/branches{/branch}","tags_url":"https://api.github.com/repos/doximity/mpn/tags","blobs_url":"https://api.github.com/repos/doximity/mpn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/doximity/mpn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/doximity/mpn/git/refs{/sha}","trees_url":"https://api.github.com/repos/doximity/mpn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/doximity/mpn/statuses/{sha}","languages_url":"https://api.github.com/repos/doximity/mpn/languages","stargazers_url":"https://api.github.com/repos/doximity/mpn/stargazers","contributors_url":"https://api.github.com/repos/doximity/mpn/contributors","subscribers_url":"https://api.github.com/repos/doximity/mpn/subscribers","subscription_url":"https://api.github.com/repos/doximity/mpn/subscription","commits_url":"https://api.github.com/repos/doximity/mpn/commits{/sha}","git_commits_url":"https://api.github.com/repos/doximity/mpn/git/commits{/sha}","comments_url":"https://api.github.com/repos/doximity/mpn/comments{/number}","issue_comment_url":"https://api.github.com/repos/doximity/mpn/issues/comments{/number}","contents_url":"https://api.github.com/repos/doximity/mpn/contents/{+path}","compare_url":"https://api.github.com/repos/doximity/mpn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/doximity/mpn/merges","archive_url":"https://api.github.com/repos/doximity/mpn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/doximity/mpn/downloads","issues_url":"https://api.github.com/repos/doximity/mpn/issues{/number}","pulls_url":"https://api.github.com/repos/doximity/mpn/pulls{/number}","milestones_url":"https://api.github.com/repos/doximity/mpn/milestones{/number}","notifications_url":"https://api.github.com/repos/doximity/mpn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/doximity/mpn/labels{/name}","releases_url":"https://api.github.com/repos/doximity/mpn/releases{/id}","created_at":"2015-01-26T20:41:51Z","updated_at":"2015-05-29T10:24:26Z","pushed_at":"2015-07-24T20:24:25Z","git_url":"git://github.com/doximity/mpn.git","ssh_url":"git@github.com:doximity/mpn.git","clone_url":"https://github.com/doximity/mpn.git","svn_url":"https://github.com/doximity/mpn","homepage":null,"size":3096,"stargazers_count":2,"watchers_count":2,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":4,"forks":1,"open_issues":4,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/doximity/mpn/pulls/39"},"html":{"href":"https://github.com/doximity/mpn/pull/39"},"issue":{"href":"https://api.github.com/repos/doximity/mpn/issues/39"},"comments":{"href":"https://api.github.com/repos/doximity/mpn/issues/39/comments"},"review_comments":{"href":"https://api.github.com/repos/doximity/mpn/pulls/39/comments"},"review_comment":{"href":"https://api.github.com/repos/doximity/mpn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/doximity/mpn/pulls/39/commits"},"statuses":{"href":"https://api.github.com/repos/doximity/mpn/statuses/a40da24474e1dc05a7c7e33fd8d3232147cfd8aa"}}}}