{"action":"created","issue":{"url":"https://api.github.com/repos/go-panton/mcre/issues/35","repository_url":"https://api.github.com/repos/go-panton/mcre","labels_url":"https://api.github.com/repos/go-panton/mcre/issues/35/labels{/name}","comments_url":"https://api.github.com/repos/go-panton/mcre/issues/35/comments","events_url":"https://api.github.com/repos/go-panton/mcre/issues/35/events","html_url":"https://github.com/go-panton/mcre/issues/35","id":149950648,"number":35,"title":"Setting up a test database to test sql query","user":{"login":"Rlexsu","id":13164382,"avatar_url":"https://avatars.githubusercontent.com/u/13164382?v=3","gravatar_id":"","url":"https://api.github.com/users/Rlexsu","html_url":"https://github.com/Rlexsu","followers_url":"https://api.github.com/users/Rlexsu/followers","following_url":"https://api.github.com/users/Rlexsu/following{/other_user}","gists_url":"https://api.github.com/users/Rlexsu/gists{/gist_id}","starred_url":"https://api.github.com/users/Rlexsu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rlexsu/subscriptions","organizations_url":"https://api.github.com/users/Rlexsu/orgs","repos_url":"https://api.github.com/users/Rlexsu/repos","events_url":"https://api.github.com/users/Rlexsu/events{/privacy}","received_events_url":"https://api.github.com/users/Rlexsu/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/go-panton/mcre/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":{"login":"Rlexsu","id":13164382,"avatar_url":"https://avatars.githubusercontent.com/u/13164382?v=3","gravatar_id":"","url":"https://api.github.com/users/Rlexsu","html_url":"https://github.com/Rlexsu","followers_url":"https://api.github.com/users/Rlexsu/followers","following_url":"https://api.github.com/users/Rlexsu/following{/other_user}","gists_url":"https://api.github.com/users/Rlexsu/gists{/gist_id}","starred_url":"https://api.github.com/users/Rlexsu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rlexsu/subscriptions","organizations_url":"https://api.github.com/users/Rlexsu/orgs","repos_url":"https://api.github.com/users/Rlexsu/repos","events_url":"https://api.github.com/users/Rlexsu/events{/privacy}","received_events_url":"https://api.github.com/users/Rlexsu/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2016-04-21T03:19:14Z","updated_at":"2016-05-11T10:13:09Z","closed_at":null,"body":"What good to have a sql query without being able to test whether it work\r\n\r\nWhy I want to test :- \r\n- Check whether data inserted correctly (data type mapping[int->???], data in correct column etc...)\r\n- Check if the column->struct mapping is correct since we are relying on sqlx auto column mapping to map the returned data into struct automatically\r\n- In future if we suddenly decide to use a decent ORM or anything, it would be good to be able to test the accuracy of the methods provided by ORM, example column mapping, multi-insert and such\r\n- To make sure transaction work as intended, you will never know if a transaction will rollback as intended if you did not test it"},"comment":{"url":"https://api.github.com/repos/go-panton/mcre/issues/comments/218418102","html_url":"https://github.com/go-panton/mcre/issues/35#issuecomment-218418102","issue_url":"https://api.github.com/repos/go-panton/mcre/issues/35","id":218418102,"user":{"login":"Rlexsu","id":13164382,"avatar_url":"https://avatars.githubusercontent.com/u/13164382?v=3","gravatar_id":"","url":"https://api.github.com/users/Rlexsu","html_url":"https://github.com/Rlexsu","followers_url":"https://api.github.com/users/Rlexsu/followers","following_url":"https://api.github.com/users/Rlexsu/following{/other_user}","gists_url":"https://api.github.com/users/Rlexsu/gists{/gist_id}","starred_url":"https://api.github.com/users/Rlexsu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rlexsu/subscriptions","organizations_url":"https://api.github.com/users/Rlexsu/orgs","repos_url":"https://api.github.com/users/Rlexsu/repos","events_url":"https://api.github.com/users/Rlexsu/events{/privacy}","received_events_url":"https://api.github.com/users/Rlexsu/received_events","type":"User","site_admin":false},"created_at":"2016-05-11T10:13:09Z","updated_at":"2016-05-11T10:13:09Z","body":"WIP: Done the following parts:-\r\n- Create a test database if it does not exist\r\n- Create table if it does not exist\r\n- Insert dummy data before start testing\r\n- Close DB connection\r\n- Drop database entirely\r\n- execute statement that accept statement and it's arguments"}}