{"action":"created","comment":{"url":"https://api.github.com/repos/EBIvariation/vcf-validator/pulls/comments/65676737","id":65676737,"diff_hunk":"@@ -0,0 +1,120 @@\n+//\n+// Created by jmmut on 25/05/16.\n+//\n+\n+#include \"vcf/report_writer.hpp\"\n+\n+namespace ebi\n+{\n+  namespace vcf\n+  {\n+    SqliteReportWriter::SqliteReportWriter(std::string db_name) : db_name{db_name}, current_transaction_size{0},\n+                                                      transaction_size{1000000}, sleep_time{500}\n+    {\n+        int rc = sqlite3_open(db_name.c_str(), &db);\n+        if (rc != SQLITE_OK) {\n+            sqlite3_close(db);\n+            throw std::runtime_error(std::string(\"Can't open database: \") + sqlite3_errmsg(db));\n+        }\n+\n+        char *zErrMsg = NULL;\n+        rc = sqlite3_exec(db, \"CREATE TABLE if not exists Errors (line int, message varchar(255));\", NULL, 0,\n+                          &zErrMsg);","path":"src/vcf/report_writer.cpp","position":22,"original_position":22,"commit_id":"f5b73f645d12337a8dfdd66d84424cd291881a8f","original_commit_id":"f5b73f645d12337a8dfdd66d84424cd291881a8f","user":{"login":"jmmut","id":4750555,"avatar_url":"https://avatars.githubusercontent.com/u/4750555?v=3","gravatar_id":"","url":"https://api.github.com/users/jmmut","html_url":"https://github.com/jmmut","followers_url":"https://api.github.com/users/jmmut/followers","following_url":"https://api.github.com/users/jmmut/following{/other_user}","gists_url":"https://api.github.com/users/jmmut/gists{/gist_id}","starred_url":"https://api.github.com/users/jmmut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmmut/subscriptions","organizations_url":"https://api.github.com/users/jmmut/orgs","repos_url":"https://api.github.com/users/jmmut/repos","events_url":"https://api.github.com/users/jmmut/events{/privacy}","received_events_url":"https://api.github.com/users/jmmut/received_events","type":"User","site_admin":false},"body":"fixed in next commit","created_at":"2016-06-03T09:01:39Z","updated_at":"2016-06-03T09:01:39Z","html_url":"https://github.com/EBIvariation/vcf-validator/pull/24#discussion_r65676737","pull_request_url":"https://api.github.com/repos/EBIvariation/vcf-validator/pulls/24","_links":{"self":{"href":"https://api.github.com/repos/EBIvariation/vcf-validator/pulls/comments/65676737"},"html":{"href":"https://github.com/EBIvariation/vcf-validator/pull/24#discussion_r65676737"},"pull_request":{"href":"https://api.github.com/repos/EBIvariation/vcf-validator/pulls/24"}}},"pull_request":{"url":"https://api.github.com/repos/EBIvariation/vcf-validator/pulls/24","id":72041750,"html_url":"https://github.com/EBIvariation/vcf-validator/pull/24","diff_url":"https://github.com/EBIvariation/vcf-validator/pull/24.diff","patch_url":"https://github.com/EBIvariation/vcf-validator/pull/24.patch","issue_url":"https://api.github.com/repos/EBIvariation/vcf-validator/issues/24","number":24,"state":"open","locked":false,"title":"Adding SQLite3 ReportWriter","user":{"login":"jmmut","id":4750555,"avatar_url":"https://avatars.githubusercontent.com/u/4750555?v=3","gravatar_id":"","url":"https://api.github.com/users/jmmut","html_url":"https://github.com/jmmut","followers_url":"https://api.github.com/users/jmmut/followers","following_url":"https://api.github.com/users/jmmut/following{/other_user}","gists_url":"https://api.github.com/users/jmmut/gists{/gist_id}","starred_url":"https://api.github.com/users/jmmut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmmut/subscriptions","organizations_url":"https://api.github.com/users/jmmut/orgs","repos_url":"https://api.github.com/users/jmmut/repos","events_url":"https://api.github.com/users/jmmut/events{/privacy}","received_events_url":"https://api.github.com/users/jmmut/received_events","type":"User","site_admin":false},"body":"First version that allows to write reports other than in stdout.\r\nthings to note:\r\n- Updated CMakeLists.txt. `-DBUILD_STATIC=0` affects only to boost. SQLite will always be linked statically. \r\n-  `Error`s are now thrown as pointers, not as references to allow easy copy (exiting the `catch (Error &e)` block was destroying the reference, and no idea how to copy a reference without losing its dynamic type).\r\n- There are `SqliteReportWriter` and `StdoutReportWriter`, both inheriting `ReportWriter`. You can choose any number from 1 to `2` output types from CLI with `-o` option: `-o sqlite,stdout`. I'm not sure about a 3rd output type \"silent\" that outputs no errors.\r\n- `ParsingState` holds the current line (recored) and now holds as well errors and warnings of the current record.\r\n- To be able to iterate the errors from `main.cpp`, getters had to be added to `Parser` and `ParserImpl`: `errors()` and `warnings()`\r\n- There are a couple of example usage/benchmarks for SQLite.\r\n- There is a minimal test that reads the sqlite ouput","created_at":"2016-05-31T16:00:22Z","updated_at":"2016-06-03T09:01:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5a0f3185ba3655a52b5a83e81c49cb85150f732b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/EBIvariation/vcf-validator/pulls/24/commits","review_comments_url":"https://api.github.com/repos/EBIvariation/vcf-validator/pulls/24/comments","review_comment_url":"https://api.github.com/repos/EBIvariation/vcf-validator/pulls/comments{/number}","comments_url":"https://api.github.com/repos/EBIvariation/vcf-validator/issues/24/comments","statuses_url":"https://api.github.com/repos/EBIvariation/vcf-validator/statuses/f5b73f645d12337a8dfdd66d84424cd291881a8f","head":{"label":"jmmut:feature/db","ref":"feature/db","sha":"f5b73f645d12337a8dfdd66d84424cd291881a8f","user":{"login":"jmmut","id":4750555,"avatar_url":"https://avatars.githubusercontent.com/u/4750555?v=3","gravatar_id":"","url":"https://api.github.com/users/jmmut","html_url":"https://github.com/jmmut","followers_url":"https://api.github.com/users/jmmut/followers","following_url":"https://api.github.com/users/jmmut/following{/other_user}","gists_url":"https://api.github.com/users/jmmut/gists{/gist_id}","starred_url":"https://api.github.com/users/jmmut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmmut/subscriptions","organizations_url":"https://api.github.com/users/jmmut/orgs","repos_url":"https://api.github.com/users/jmmut/repos","events_url":"https://api.github.com/users/jmmut/events{/privacy}","received_events_url":"https://api.github.com/users/jmmut/received_events","type":"User","site_admin":false},"repo":{"id":57974971,"name":"vcf-validator","full_name":"jmmut/vcf-validator","owner":{"login":"jmmut","id":4750555,"avatar_url":"https://avatars.githubusercontent.com/u/4750555?v=3","gravatar_id":"","url":"https://api.github.com/users/jmmut","html_url":"https://github.com/jmmut","followers_url":"https://api.github.com/users/jmmut/followers","following_url":"https://api.github.com/users/jmmut/following{/other_user}","gists_url":"https://api.github.com/users/jmmut/gists{/gist_id}","starred_url":"https://api.github.com/users/jmmut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmmut/subscriptions","organizations_url":"https://api.github.com/users/jmmut/orgs","repos_url":"https://api.github.com/users/jmmut/repos","events_url":"https://api.github.com/users/jmmut/events{/privacy}","received_events_url":"https://api.github.com/users/jmmut/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jmmut/vcf-validator","description":"Validator for VCF implemented using C++11","fork":true,"url":"https://api.github.com/repos/jmmut/vcf-validator","forks_url":"https://api.github.com/repos/jmmut/vcf-validator/forks","keys_url":"https://api.github.com/repos/jmmut/vcf-validator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jmmut/vcf-validator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jmmut/vcf-validator/teams","hooks_url":"https://api.github.com/repos/jmmut/vcf-validator/hooks","issue_events_url":"https://api.github.com/repos/jmmut/vcf-validator/issues/events{/number}","events_url":"https://api.github.com/repos/jmmut/vcf-validator/events","assignees_url":"https://api.github.com/repos/jmmut/vcf-validator/assignees{/user}","branches_url":"https://api.github.com/repos/jmmut/vcf-validator/branches{/branch}","tags_url":"https://api.github.com/repos/jmmut/vcf-validator/tags","blobs_url":"https://api.github.com/repos/jmmut/vcf-validator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jmmut/vcf-validator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jmmut/vcf-validator/git/refs{/sha}","trees_url":"https://api.github.com/repos/jmmut/vcf-validator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jmmut/vcf-validator/statuses/{sha}","languages_url":"https://api.github.com/repos/jmmut/vcf-validator/languages","stargazers_url":"https://api.github.com/repos/jmmut/vcf-validator/stargazers","contributors_url":"https://api.github.com/repos/jmmut/vcf-validator/contributors","subscribers_url":"https://api.github.com/repos/jmmut/vcf-validator/subscribers","subscription_url":"https://api.github.com/repos/jmmut/vcf-validator/subscription","commits_url":"https://api.github.com/repos/jmmut/vcf-validator/commits{/sha}","git_commits_url":"https://api.github.com/repos/jmmut/vcf-validator/git/commits{/sha}","comments_url":"https://api.github.com/repos/jmmut/vcf-validator/comments{/number}","issue_comment_url":"https://api.github.com/repos/jmmut/vcf-validator/issues/comments{/number}","contents_url":"https://api.github.com/repos/jmmut/vcf-validator/contents/{+path}","compare_url":"https://api.github.com/repos/jmmut/vcf-validator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jmmut/vcf-validator/merges","archive_url":"https://api.github.com/repos/jmmut/vcf-validator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jmmut/vcf-validator/downloads","issues_url":"https://api.github.com/repos/jmmut/vcf-validator/issues{/number}","pulls_url":"https://api.github.com/repos/jmmut/vcf-validator/pulls{/number}","milestones_url":"https://api.github.com/repos/jmmut/vcf-validator/milestones{/number}","notifications_url":"https://api.github.com/repos/jmmut/vcf-validator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jmmut/vcf-validator/labels{/name}","releases_url":"https://api.github.com/repos/jmmut/vcf-validator/releases{/id}","deployments_url":"https://api.github.com/repos/jmmut/vcf-validator/deployments","created_at":"2016-05-03T14:20:13Z","updated_at":"2016-05-03T14:20:14Z","pushed_at":"2016-06-02T15:21:32Z","git_url":"git://github.com/jmmut/vcf-validator.git","ssh_url":"git@github.com:jmmut/vcf-validator.git","clone_url":"https://github.com/jmmut/vcf-validator.git","svn_url":"https://github.com/jmmut/vcf-validator","homepage":null,"size":3967,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"EBIvariation:develop","ref":"develop","sha":"7e51bc5710af403730192a97919c58dc765613af","user":{"login":"EBIvariation","id":6419333,"avatar_url":"https://avatars.githubusercontent.com/u/6419333?v=3","gravatar_id":"","url":"https://api.github.com/users/EBIvariation","html_url":"https://github.com/EBIvariation","followers_url":"https://api.github.com/users/EBIvariation/followers","following_url":"https://api.github.com/users/EBIvariation/following{/other_user}","gists_url":"https://api.github.com/users/EBIvariation/gists{/gist_id}","starred_url":"https://api.github.com/users/EBIvariation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EBIvariation/subscriptions","organizations_url":"https://api.github.com/users/EBIvariation/orgs","repos_url":"https://api.github.com/users/EBIvariation/repos","events_url":"https://api.github.com/users/EBIvariation/events{/privacy}","received_events_url":"https://api.github.com/users/EBIvariation/received_events","type":"Organization","site_admin":false},"repo":{"id":36810447,"name":"vcf-validator","full_name":"EBIvariation/vcf-validator","owner":{"login":"EBIvariation","id":6419333,"avatar_url":"https://avatars.githubusercontent.com/u/6419333?v=3","gravatar_id":"","url":"https://api.github.com/users/EBIvariation","html_url":"https://github.com/EBIvariation","followers_url":"https://api.github.com/users/EBIvariation/followers","following_url":"https://api.github.com/users/EBIvariation/following{/other_user}","gists_url":"https://api.github.com/users/EBIvariation/gists{/gist_id}","starred_url":"https://api.github.com/users/EBIvariation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EBIvariation/subscriptions","organizations_url":"https://api.github.com/users/EBIvariation/orgs","repos_url":"https://api.github.com/users/EBIvariation/repos","events_url":"https://api.github.com/users/EBIvariation/events{/privacy}","received_events_url":"https://api.github.com/users/EBIvariation/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/EBIvariation/vcf-validator","description":"Validator for VCF implemented using C++11","fork":false,"url":"https://api.github.com/repos/EBIvariation/vcf-validator","forks_url":"https://api.github.com/repos/EBIvariation/vcf-validator/forks","keys_url":"https://api.github.com/repos/EBIvariation/vcf-validator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/EBIvariation/vcf-validator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/EBIvariation/vcf-validator/teams","hooks_url":"https://api.github.com/repos/EBIvariation/vcf-validator/hooks","issue_events_url":"https://api.github.com/repos/EBIvariation/vcf-validator/issues/events{/number}","events_url":"https://api.github.com/repos/EBIvariation/vcf-validator/events","assignees_url":"https://api.github.com/repos/EBIvariation/vcf-validator/assignees{/user}","branches_url":"https://api.github.com/repos/EBIvariation/vcf-validator/branches{/branch}","tags_url":"https://api.github.com/repos/EBIvariation/vcf-validator/tags","blobs_url":"https://api.github.com/repos/EBIvariation/vcf-validator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/EBIvariation/vcf-validator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/EBIvariation/vcf-validator/git/refs{/sha}","trees_url":"https://api.github.com/repos/EBIvariation/vcf-validator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/EBIvariation/vcf-validator/statuses/{sha}","languages_url":"https://api.github.com/repos/EBIvariation/vcf-validator/languages","stargazers_url":"https://api.github.com/repos/EBIvariation/vcf-validator/stargazers","contributors_url":"https://api.github.com/repos/EBIvariation/vcf-validator/contributors","subscribers_url":"https://api.github.com/repos/EBIvariation/vcf-validator/subscribers","subscription_url":"https://api.github.com/repos/EBIvariation/vcf-validator/subscription","commits_url":"https://api.github.com/repos/EBIvariation/vcf-validator/commits{/sha}","git_commits_url":"https://api.github.com/repos/EBIvariation/vcf-validator/git/commits{/sha}","comments_url":"https://api.github.com/repos/EBIvariation/vcf-validator/comments{/number}","issue_comment_url":"https://api.github.com/repos/EBIvariation/vcf-validator/issues/comments{/number}","contents_url":"https://api.github.com/repos/EBIvariation/vcf-validator/contents/{+path}","compare_url":"https://api.github.com/repos/EBIvariation/vcf-validator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/EBIvariation/vcf-validator/merges","archive_url":"https://api.github.com/repos/EBIvariation/vcf-validator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/EBIvariation/vcf-validator/downloads","issues_url":"https://api.github.com/repos/EBIvariation/vcf-validator/issues{/number}","pulls_url":"https://api.github.com/repos/EBIvariation/vcf-validator/pulls{/number}","milestones_url":"https://api.github.com/repos/EBIvariation/vcf-validator/milestones{/number}","notifications_url":"https://api.github.com/repos/EBIvariation/vcf-validator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/EBIvariation/vcf-validator/labels{/name}","releases_url":"https://api.github.com/repos/EBIvariation/vcf-validator/releases{/id}","deployments_url":"https://api.github.com/repos/EBIvariation/vcf-validator/deployments","created_at":"2015-06-03T14:51:49Z","updated_at":"2016-05-08T01:03:39Z","pushed_at":"2016-06-01T12:45:10Z","git_url":"git://github.com/EBIvariation/vcf-validator.git","ssh_url":"git@github.com:EBIvariation/vcf-validator.git","clone_url":"https://github.com/EBIvariation/vcf-validator.git","svn_url":"https://github.com/EBIvariation/vcf-validator","homepage":null,"size":2173,"stargazers_count":16,"watchers_count":16,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":12,"forks":4,"open_issues":12,"watchers":16,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/EBIvariation/vcf-validator/pulls/24"},"html":{"href":"https://github.com/EBIvariation/vcf-validator/pull/24"},"issue":{"href":"https://api.github.com/repos/EBIvariation/vcf-validator/issues/24"},"comments":{"href":"https://api.github.com/repos/EBIvariation/vcf-validator/issues/24/comments"},"review_comments":{"href":"https://api.github.com/repos/EBIvariation/vcf-validator/pulls/24/comments"},"review_comment":{"href":"https://api.github.com/repos/EBIvariation/vcf-validator/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/EBIvariation/vcf-validator/pulls/24/commits"},"statuses":{"href":"https://api.github.com/repos/EBIvariation/vcf-validator/statuses/f5b73f645d12337a8dfdd66d84424cd291881a8f"}}}}
{"actor":{"display_login":"jmmut"}}