{"action":"created","comment":{"url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/pulls/comments/101162610","pull_request_review_id":21883770,"id":101162610,"diff_hunk":"@@ -0,0 +1,43 @@\n+const pgp = require('pg-promise')()\n+const connectionString = 'postgres://localhost:5432/sweethornbillbookstore'\n+const db = pgp(connectionString)\n+\n+\n+\n+const getAllBooks = () => db.any( 'SELECT * FROM books' )\n+\n+const getSingleBook = ( request, response ) => {\n+  const id = request.params.id\n+  return db.one('SELECT * FROM books WHERE id = $1', id)\n+}\n+\n+const getSingleAuthor = ( request, response ) => {\n+  const author = request.params.author.toLowerCase()\n+    console.log(author)\n+    return db.one('SELECT * FROM books WHERE LOWER(author) = $1', author)\n+}\n+\n+const getSingleGenre = ( request, response ) => {\n+  const genre = request.params.genre\n+    return db.one('SELECT * FROM books WHERE genre = $1', genre)\n+}\n+\n+const addBook = ( request, response ) => {\n+  return db.any('SELECT * FROM books')","path":"queries.js","position":26,"original_position":26,"commit_id":"1ad77778053003dccef3780ad159a7eab0e35f1f","original_commit_id":"1ad77778053003dccef3780ad159a7eab0e35f1f","user":{"login":"shakalee14","id":16676323,"avatar_url":"https://avatars.githubusercontent.com/u/16676323?v=3","gravatar_id":"","url":"https://api.github.com/users/shakalee14","html_url":"https://github.com/shakalee14","followers_url":"https://api.github.com/users/shakalee14/followers","following_url":"https://api.github.com/users/shakalee14/following{/other_user}","gists_url":"https://api.github.com/users/shakalee14/gists{/gist_id}","starred_url":"https://api.github.com/users/shakalee14/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shakalee14/subscriptions","organizations_url":"https://api.github.com/users/shakalee14/orgs","repos_url":"https://api.github.com/users/shakalee14/repos","events_url":"https://api.github.com/users/shakalee14/events{/privacy}","received_events_url":"https://api.github.com/users/shakalee14/received_events","type":"User","site_admin":false},"body":"how does this query add a book? from your naming convention, i would expect to see an INSERT sql statement here.","created_at":"2017-02-14T22:42:52Z","updated_at":"2017-02-14T22:48:54Z","html_url":"https://github.com/GeneralMeow/sweet-hornbill-bookstore/pull/2#discussion_r101162610","pull_request_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/pulls/comments/101162610"},"html":{"href":"https://github.com/GeneralMeow/sweet-hornbill-bookstore/pull/2#discussion_r101162610"},"pull_request":{"href":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/pulls/2","id":106184376,"html_url":"https://github.com/GeneralMeow/sweet-hornbill-bookstore/pull/2","diff_url":"https://github.com/GeneralMeow/sweet-hornbill-bookstore/pull/2.diff","patch_url":"https://github.com/GeneralMeow/sweet-hornbill-bookstore/pull/2.patch","issue_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/issues/2","number":2,"state":"open","locked":false,"title":"Backend","user":{"login":"GeneralMeow","id":12767801,"avatar_url":"https://avatars.githubusercontent.com/u/12767801?v=3","gravatar_id":"","url":"https://api.github.com/users/GeneralMeow","html_url":"https://github.com/GeneralMeow","followers_url":"https://api.github.com/users/GeneralMeow/followers","following_url":"https://api.github.com/users/GeneralMeow/following{/other_user}","gists_url":"https://api.github.com/users/GeneralMeow/gists{/gist_id}","starred_url":"https://api.github.com/users/GeneralMeow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GeneralMeow/subscriptions","organizations_url":"https://api.github.com/users/GeneralMeow/orgs","repos_url":"https://api.github.com/users/GeneralMeow/repos","events_url":"https://api.github.com/users/GeneralMeow/events{/privacy}","received_events_url":"https://api.github.com/users/GeneralMeow/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-02-14T20:21:02Z","updated_at":"2017-02-14T22:48:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b3e5ab9fba92fc88059e02fd1891cfde4bc27dc2","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/pulls/2/commits","review_comments_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/pulls/2/comments","review_comment_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/pulls/comments{/number}","comments_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/issues/2/comments","statuses_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/statuses/1ad77778053003dccef3780ad159a7eab0e35f1f","head":{"label":"GeneralMeow:backend","ref":"backend","sha":"1ad77778053003dccef3780ad159a7eab0e35f1f","user":{"login":"GeneralMeow","id":12767801,"avatar_url":"https://avatars.githubusercontent.com/u/12767801?v=3","gravatar_id":"","url":"https://api.github.com/users/GeneralMeow","html_url":"https://github.com/GeneralMeow","followers_url":"https://api.github.com/users/GeneralMeow/followers","following_url":"https://api.github.com/users/GeneralMeow/following{/other_user}","gists_url":"https://api.github.com/users/GeneralMeow/gists{/gist_id}","starred_url":"https://api.github.com/users/GeneralMeow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GeneralMeow/subscriptions","organizations_url":"https://api.github.com/users/GeneralMeow/orgs","repos_url":"https://api.github.com/users/GeneralMeow/repos","events_url":"https://api.github.com/users/GeneralMeow/events{/privacy}","received_events_url":"https://api.github.com/users/GeneralMeow/received_events","type":"User","site_admin":false},"repo":{"id":81862725,"name":"sweet-hornbill-bookstore","full_name":"GeneralMeow/sweet-hornbill-bookstore","owner":{"login":"GeneralMeow","id":12767801,"avatar_url":"https://avatars.githubusercontent.com/u/12767801?v=3","gravatar_id":"","url":"https://api.github.com/users/GeneralMeow","html_url":"https://github.com/GeneralMeow","followers_url":"https://api.github.com/users/GeneralMeow/followers","following_url":"https://api.github.com/users/GeneralMeow/following{/other_user}","gists_url":"https://api.github.com/users/GeneralMeow/gists{/gist_id}","starred_url":"https://api.github.com/users/GeneralMeow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GeneralMeow/subscriptions","organizations_url":"https://api.github.com/users/GeneralMeow/orgs","repos_url":"https://api.github.com/users/GeneralMeow/repos","events_url":"https://api.github.com/users/GeneralMeow/events{/privacy}","received_events_url":"https://api.github.com/users/GeneralMeow/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/GeneralMeow/sweet-hornbill-bookstore","description":null,"fork":false,"url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore","forks_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/forks","keys_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/teams","hooks_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/hooks","issue_events_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/issues/events{/number}","events_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/events","assignees_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/assignees{/user}","branches_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/branches{/branch}","tags_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/tags","blobs_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/git/refs{/sha}","trees_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/statuses/{sha}","languages_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/languages","stargazers_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/stargazers","contributors_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/contributors","subscribers_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/subscribers","subscription_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/subscription","commits_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/commits{/sha}","git_commits_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/git/commits{/sha}","comments_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/comments{/number}","issue_comment_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/issues/comments{/number}","contents_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/contents/{+path}","compare_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/merges","archive_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/downloads","issues_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/issues{/number}","pulls_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/pulls{/number}","milestones_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/milestones{/number}","notifications_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/labels{/name}","releases_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/releases{/id}","deployments_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/deployments","created_at":"2017-02-13T19:30:05Z","updated_at":"2017-02-13T23:24:56Z","pushed_at":"2017-02-14T21:10:44Z","git_url":"git://github.com/GeneralMeow/sweet-hornbill-bookstore.git","ssh_url":"git@github.com:GeneralMeow/sweet-hornbill-bookstore.git","clone_url":"https://github.com/GeneralMeow/sweet-hornbill-bookstore.git","svn_url":"https://github.com/GeneralMeow/sweet-hornbill-bookstore","homepage":null,"size":24,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"GeneralMeow:master","ref":"master","sha":"f59d718363f5eb6fa5c02b9375882e4733c18cb0","user":{"login":"GeneralMeow","id":12767801,"avatar_url":"https://avatars.githubusercontent.com/u/12767801?v=3","gravatar_id":"","url":"https://api.github.com/users/GeneralMeow","html_url":"https://github.com/GeneralMeow","followers_url":"https://api.github.com/users/GeneralMeow/followers","following_url":"https://api.github.com/users/GeneralMeow/following{/other_user}","gists_url":"https://api.github.com/users/GeneralMeow/gists{/gist_id}","starred_url":"https://api.github.com/users/GeneralMeow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GeneralMeow/subscriptions","organizations_url":"https://api.github.com/users/GeneralMeow/orgs","repos_url":"https://api.github.com/users/GeneralMeow/repos","events_url":"https://api.github.com/users/GeneralMeow/events{/privacy}","received_events_url":"https://api.github.com/users/GeneralMeow/received_events","type":"User","site_admin":false},"repo":{"id":81862725,"name":"sweet-hornbill-bookstore","full_name":"GeneralMeow/sweet-hornbill-bookstore","owner":{"login":"GeneralMeow","id":12767801,"avatar_url":"https://avatars.githubusercontent.com/u/12767801?v=3","gravatar_id":"","url":"https://api.github.com/users/GeneralMeow","html_url":"https://github.com/GeneralMeow","followers_url":"https://api.github.com/users/GeneralMeow/followers","following_url":"https://api.github.com/users/GeneralMeow/following{/other_user}","gists_url":"https://api.github.com/users/GeneralMeow/gists{/gist_id}","starred_url":"https://api.github.com/users/GeneralMeow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GeneralMeow/subscriptions","organizations_url":"https://api.github.com/users/GeneralMeow/orgs","repos_url":"https://api.github.com/users/GeneralMeow/repos","events_url":"https://api.github.com/users/GeneralMeow/events{/privacy}","received_events_url":"https://api.github.com/users/GeneralMeow/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/GeneralMeow/sweet-hornbill-bookstore","description":null,"fork":false,"url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore","forks_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/forks","keys_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/teams","hooks_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/hooks","issue_events_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/issues/events{/number}","events_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/events","assignees_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/assignees{/user}","branches_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/branches{/branch}","tags_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/tags","blobs_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/git/refs{/sha}","trees_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/statuses/{sha}","languages_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/languages","stargazers_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/stargazers","contributors_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/contributors","subscribers_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/subscribers","subscription_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/subscription","commits_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/commits{/sha}","git_commits_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/git/commits{/sha}","comments_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/comments{/number}","issue_comment_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/issues/comments{/number}","contents_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/contents/{+path}","compare_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/merges","archive_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/downloads","issues_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/issues{/number}","pulls_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/pulls{/number}","milestones_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/milestones{/number}","notifications_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/labels{/name}","releases_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/releases{/id}","deployments_url":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/deployments","created_at":"2017-02-13T19:30:05Z","updated_at":"2017-02-13T23:24:56Z","pushed_at":"2017-02-14T21:10:44Z","git_url":"git://github.com/GeneralMeow/sweet-hornbill-bookstore.git","ssh_url":"git@github.com:GeneralMeow/sweet-hornbill-bookstore.git","clone_url":"https://github.com/GeneralMeow/sweet-hornbill-bookstore.git","svn_url":"https://github.com/GeneralMeow/sweet-hornbill-bookstore","homepage":null,"size":24,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/pulls/2"},"html":{"href":"https://github.com/GeneralMeow/sweet-hornbill-bookstore/pull/2"},"issue":{"href":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/issues/2"},"comments":{"href":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/GeneralMeow/sweet-hornbill-bookstore/statuses/1ad77778053003dccef3780ad159a7eab0e35f1f"}}}}
{"actor":{"display_login":"shakalee14"}}