{"action":"created","comment":{"url":"https://api.github.com/repos/upper/bond/pulls/comments/37825695","id":37825695,"diff_hunk":"@@ -9,16 +8,16 @@ import (\n )\n \n type Session interface {\n-\tdb.Database\n+\tdb.Tx","path":"session.go","position":13,"original_position":13,"commit_id":"0bc592e6b1f64c611a73b75146ce944e2f9d8119","original_commit_id":"0bc592e6b1f64c611a73b75146ce944e2f9d8119","user":{"login":"xiam","id":385670,"avatar_url":"https://avatars.githubusercontent.com/u/385670?v=3","gravatar_id":"","url":"https://api.github.com/users/xiam","html_url":"https://github.com/xiam","followers_url":"https://api.github.com/users/xiam/followers","following_url":"https://api.github.com/users/xiam/following{/other_user}","gists_url":"https://api.github.com/users/xiam/gists{/gist_id}","starred_url":"https://api.github.com/users/xiam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xiam/subscriptions","organizations_url":"https://api.github.com/users/xiam/orgs","repos_url":"https://api.github.com/users/xiam/repos","events_url":"https://api.github.com/users/xiam/events{/privacy}","received_events_url":"https://api.github.com/users/xiam/received_events","type":"User","site_admin":false},"body":"Same methods as Database, plus Commit() and Rollback().","created_at":"2015-08-25T01:51:55Z","updated_at":"2015-08-25T01:51:55Z","html_url":"https://github.com/upper/bond/pull/5#discussion_r37825695","pull_request_url":"https://api.github.com/repos/upper/bond/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/upper/bond/pulls/comments/37825695"},"html":{"href":"https://github.com/upper/bond/pull/5#discussion_r37825695"},"pull_request":{"href":"https://api.github.com/repos/upper/bond/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/upper/bond/pulls/5","id":43241892,"html_url":"https://github.com/upper/bond/pull/5","diff_url":"https://github.com/upper/bond/pull/5.diff","patch_url":"https://github.com/upper/bond/pull/5.patch","issue_url":"https://api.github.com/repos/upper/bond/issues/5","number":5,"state":"open","locked":false,"title":"Transaction support","user":{"login":"xiam","id":385670,"avatar_url":"https://avatars.githubusercontent.com/u/385670?v=3","gravatar_id":"","url":"https://api.github.com/users/xiam","html_url":"https://github.com/xiam","followers_url":"https://api.github.com/users/xiam/followers","following_url":"https://api.github.com/users/xiam/following{/other_user}","gists_url":"https://api.github.com/users/xiam/gists{/gist_id}","starred_url":"https://api.github.com/users/xiam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xiam/subscriptions","organizations_url":"https://api.github.com/users/xiam/orgs","repos_url":"https://api.github.com/users/xiam/repos","events_url":"https://api.github.com/users/xiam/events{/privacy}","received_events_url":"https://api.github.com/users/xiam/received_events","type":"User","site_admin":false},"body":"This PR adds transaction support in bond using a new `NewTransaction()` method thats creates a `bond.Session` session that runs within a transaction context. The user can then use `Commit()` and `Rollback()` methods to save or discard the changes introduces in such session.\r\n\r\nThis may be a small PR but it actually took me a while to simplify the required changes :).","created_at":"2015-08-25T01:51:10Z","updated_at":"2015-08-25T01:51:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"92e52e916d1d3eb1c9f1a4a733467df89651d788","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/upper/bond/pulls/5/commits","review_comments_url":"https://api.github.com/repos/upper/bond/pulls/5/comments","review_comment_url":"https://api.github.com/repos/upper/bond/pulls/comments{/number}","comments_url":"https://api.github.com/repos/upper/bond/issues/5/comments","statuses_url":"https://api.github.com/repos/upper/bond/statuses/0bc592e6b1f64c611a73b75146ce944e2f9d8119","head":{"label":"upper:issue-4","ref":"issue-4","sha":"0bc592e6b1f64c611a73b75146ce944e2f9d8119","user":{"login":"upper","id":5751296,"avatar_url":"https://avatars.githubusercontent.com/u/5751296?v=3","gravatar_id":"","url":"https://api.github.com/users/upper","html_url":"https://github.com/upper","followers_url":"https://api.github.com/users/upper/followers","following_url":"https://api.github.com/users/upper/following{/other_user}","gists_url":"https://api.github.com/users/upper/gists{/gist_id}","starred_url":"https://api.github.com/users/upper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/upper/subscriptions","organizations_url":"https://api.github.com/users/upper/orgs","repos_url":"https://api.github.com/users/upper/repos","events_url":"https://api.github.com/users/upper/events{/privacy}","received_events_url":"https://api.github.com/users/upper/received_events","type":"Organization","site_admin":false},"repo":{"id":36471864,"name":"bond","full_name":"upper/bond","owner":{"login":"upper","id":5751296,"avatar_url":"https://avatars.githubusercontent.com/u/5751296?v=3","gravatar_id":"","url":"https://api.github.com/users/upper","html_url":"https://github.com/upper","followers_url":"https://api.github.com/users/upper/followers","following_url":"https://api.github.com/users/upper/following{/other_user}","gists_url":"https://api.github.com/users/upper/gists{/gist_id}","starred_url":"https://api.github.com/users/upper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/upper/subscriptions","organizations_url":"https://api.github.com/users/upper/orgs","repos_url":"https://api.github.com/users/upper/repos","events_url":"https://api.github.com/users/upper/events{/privacy}","received_events_url":"https://api.github.com/users/upper/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/upper/bond","description":"Simple database model layer for upper.io/db","fork":false,"url":"https://api.github.com/repos/upper/bond","forks_url":"https://api.github.com/repos/upper/bond/forks","keys_url":"https://api.github.com/repos/upper/bond/keys{/key_id}","collaborators_url":"https://api.github.com/repos/upper/bond/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/upper/bond/teams","hooks_url":"https://api.github.com/repos/upper/bond/hooks","issue_events_url":"https://api.github.com/repos/upper/bond/issues/events{/number}","events_url":"https://api.github.com/repos/upper/bond/events","assignees_url":"https://api.github.com/repos/upper/bond/assignees{/user}","branches_url":"https://api.github.com/repos/upper/bond/branches{/branch}","tags_url":"https://api.github.com/repos/upper/bond/tags","blobs_url":"https://api.github.com/repos/upper/bond/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/upper/bond/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/upper/bond/git/refs{/sha}","trees_url":"https://api.github.com/repos/upper/bond/git/trees{/sha}","statuses_url":"https://api.github.com/repos/upper/bond/statuses/{sha}","languages_url":"https://api.github.com/repos/upper/bond/languages","stargazers_url":"https://api.github.com/repos/upper/bond/stargazers","contributors_url":"https://api.github.com/repos/upper/bond/contributors","subscribers_url":"https://api.github.com/repos/upper/bond/subscribers","subscription_url":"https://api.github.com/repos/upper/bond/subscription","commits_url":"https://api.github.com/repos/upper/bond/commits{/sha}","git_commits_url":"https://api.github.com/repos/upper/bond/git/commits{/sha}","comments_url":"https://api.github.com/repos/upper/bond/comments{/number}","issue_comment_url":"https://api.github.com/repos/upper/bond/issues/comments{/number}","contents_url":"https://api.github.com/repos/upper/bond/contents/{+path}","compare_url":"https://api.github.com/repos/upper/bond/compare/{base}...{head}","merges_url":"https://api.github.com/repos/upper/bond/merges","archive_url":"https://api.github.com/repos/upper/bond/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/upper/bond/downloads","issues_url":"https://api.github.com/repos/upper/bond/issues{/number}","pulls_url":"https://api.github.com/repos/upper/bond/pulls{/number}","milestones_url":"https://api.github.com/repos/upper/bond/milestones{/number}","notifications_url":"https://api.github.com/repos/upper/bond/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/upper/bond/labels{/name}","releases_url":"https://api.github.com/repos/upper/bond/releases{/id}","created_at":"2015-05-28T23:30:43Z","updated_at":"2015-07-21T19:48:17Z","pushed_at":"2015-08-25T01:51:11Z","git_url":"git://github.com/upper/bond.git","ssh_url":"git@github.com:upper/bond.git","clone_url":"https://github.com/upper/bond.git","svn_url":"https://github.com/upper/bond","homepage":"","size":152,"stargazers_count":2,"watchers_count":2,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":5,"forks":0,"open_issues":5,"watchers":2,"default_branch":"master"}},"base":{"label":"upper:master","ref":"master","sha":"2c15c1bfdb6756f8d31e1c705373b9d4d876dc5b","user":{"login":"upper","id":5751296,"avatar_url":"https://avatars.githubusercontent.com/u/5751296?v=3","gravatar_id":"","url":"https://api.github.com/users/upper","html_url":"https://github.com/upper","followers_url":"https://api.github.com/users/upper/followers","following_url":"https://api.github.com/users/upper/following{/other_user}","gists_url":"https://api.github.com/users/upper/gists{/gist_id}","starred_url":"https://api.github.com/users/upper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/upper/subscriptions","organizations_url":"https://api.github.com/users/upper/orgs","repos_url":"https://api.github.com/users/upper/repos","events_url":"https://api.github.com/users/upper/events{/privacy}","received_events_url":"https://api.github.com/users/upper/received_events","type":"Organization","site_admin":false},"repo":{"id":36471864,"name":"bond","full_name":"upper/bond","owner":{"login":"upper","id":5751296,"avatar_url":"https://avatars.githubusercontent.com/u/5751296?v=3","gravatar_id":"","url":"https://api.github.com/users/upper","html_url":"https://github.com/upper","followers_url":"https://api.github.com/users/upper/followers","following_url":"https://api.github.com/users/upper/following{/other_user}","gists_url":"https://api.github.com/users/upper/gists{/gist_id}","starred_url":"https://api.github.com/users/upper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/upper/subscriptions","organizations_url":"https://api.github.com/users/upper/orgs","repos_url":"https://api.github.com/users/upper/repos","events_url":"https://api.github.com/users/upper/events{/privacy}","received_events_url":"https://api.github.com/users/upper/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/upper/bond","description":"Simple database model layer for upper.io/db","fork":false,"url":"https://api.github.com/repos/upper/bond","forks_url":"https://api.github.com/repos/upper/bond/forks","keys_url":"https://api.github.com/repos/upper/bond/keys{/key_id}","collaborators_url":"https://api.github.com/repos/upper/bond/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/upper/bond/teams","hooks_url":"https://api.github.com/repos/upper/bond/hooks","issue_events_url":"https://api.github.com/repos/upper/bond/issues/events{/number}","events_url":"https://api.github.com/repos/upper/bond/events","assignees_url":"https://api.github.com/repos/upper/bond/assignees{/user}","branches_url":"https://api.github.com/repos/upper/bond/branches{/branch}","tags_url":"https://api.github.com/repos/upper/bond/tags","blobs_url":"https://api.github.com/repos/upper/bond/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/upper/bond/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/upper/bond/git/refs{/sha}","trees_url":"https://api.github.com/repos/upper/bond/git/trees{/sha}","statuses_url":"https://api.github.com/repos/upper/bond/statuses/{sha}","languages_url":"https://api.github.com/repos/upper/bond/languages","stargazers_url":"https://api.github.com/repos/upper/bond/stargazers","contributors_url":"https://api.github.com/repos/upper/bond/contributors","subscribers_url":"https://api.github.com/repos/upper/bond/subscribers","subscription_url":"https://api.github.com/repos/upper/bond/subscription","commits_url":"https://api.github.com/repos/upper/bond/commits{/sha}","git_commits_url":"https://api.github.com/repos/upper/bond/git/commits{/sha}","comments_url":"https://api.github.com/repos/upper/bond/comments{/number}","issue_comment_url":"https://api.github.com/repos/upper/bond/issues/comments{/number}","contents_url":"https://api.github.com/repos/upper/bond/contents/{+path}","compare_url":"https://api.github.com/repos/upper/bond/compare/{base}...{head}","merges_url":"https://api.github.com/repos/upper/bond/merges","archive_url":"https://api.github.com/repos/upper/bond/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/upper/bond/downloads","issues_url":"https://api.github.com/repos/upper/bond/issues{/number}","pulls_url":"https://api.github.com/repos/upper/bond/pulls{/number}","milestones_url":"https://api.github.com/repos/upper/bond/milestones{/number}","notifications_url":"https://api.github.com/repos/upper/bond/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/upper/bond/labels{/name}","releases_url":"https://api.github.com/repos/upper/bond/releases{/id}","created_at":"2015-05-28T23:30:43Z","updated_at":"2015-07-21T19:48:17Z","pushed_at":"2015-08-25T01:51:11Z","git_url":"git://github.com/upper/bond.git","ssh_url":"git@github.com:upper/bond.git","clone_url":"https://github.com/upper/bond.git","svn_url":"https://github.com/upper/bond","homepage":"","size":152,"stargazers_count":2,"watchers_count":2,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":5,"forks":0,"open_issues":5,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/upper/bond/pulls/5"},"html":{"href":"https://github.com/upper/bond/pull/5"},"issue":{"href":"https://api.github.com/repos/upper/bond/issues/5"},"comments":{"href":"https://api.github.com/repos/upper/bond/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/upper/bond/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/upper/bond/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/upper/bond/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/upper/bond/statuses/0bc592e6b1f64c611a73b75146ce944e2f9d8119"}}}}