{"action":"opened","issue":{"url":"https://api.github.com/repos/vitaly-t/pg-promise/issues/554","repository_url":"https://api.github.com/repos/vitaly-t/pg-promise","labels_url":"https://api.github.com/repos/vitaly-t/pg-promise/issues/554/labels{/name}","comments_url":"https://api.github.com/repos/vitaly-t/pg-promise/issues/554/comments","events_url":"https://api.github.com/repos/vitaly-t/pg-promise/issues/554/events","html_url":"https://github.com/vitaly-t/pg-promise/issues/554","id":364592791,"node_id":"MDU6SXNzdWUzNjQ1OTI3OTE=","number":554,"title":"Rollback question","user":{"login":"akhchan99","id":30240186,"node_id":"MDQ6VXNlcjMwMjQwMTg2","avatar_url":"https://avatars0.githubusercontent.com/u/30240186?v=4","gravatar_id":"","url":"https://api.github.com/users/akhchan99","html_url":"https://github.com/akhchan99","followers_url":"https://api.github.com/users/akhchan99/followers","following_url":"https://api.github.com/users/akhchan99/following{/other_user}","gists_url":"https://api.github.com/users/akhchan99/gists{/gist_id}","starred_url":"https://api.github.com/users/akhchan99/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akhchan99/subscriptions","organizations_url":"https://api.github.com/users/akhchan99/orgs","repos_url":"https://api.github.com/users/akhchan99/repos","events_url":"https://api.github.com/users/akhchan99/events{/privacy}","received_events_url":"https://api.github.com/users/akhchan99/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-27T18:08:39Z","updated_at":"2018-09-27T18:08:39Z","closed_at":null,"author_association":"NONE","body":"I have a simple test code\r\nLets say user table only have 1 user (id = 1) with first_name 'X', last_name 'Y'\r\n\r\nlet tasks = [];\r\ntasks.push(db.none('UPDATE userTable SET first_name = $2 WHERE user_id = $1', [1, 'A']))\r\ntasks.push(db.none('UPDATE userTable SET last_name = $2 WHERE user_id = $1', [1, 'B']))\r\ntasks.push(db.none('UPDATE userTable SET first_name = $2 WHERE user_id = $1', ['XXX', 'C']))\r\n\r\n      db.tx(t => {\r\n        return t.batch(tasks);\r\n      })\r\n      .then(data => {\r\n        console.log(data)\r\n      })\r\n      .catch(error => {\r\n        console.log(error)\r\n      })\r\n\r\nSo the 3rd query will fail because 'XXX' doesn't the type of id field, so it throw an error.\r\nBut when I check the table, first_name is now 'A' and last_name is now 'B' instead of rolled back to 'X' and 'Y' respectively.\r\n\r\nAm I missing anything?"}}
{"actor":{"display_login":"akhchan99"}}