{"action":"created","comment":{"url":"https://api.github.com/repos/Gnucash/gnucash/pulls/comments/85646778","pull_request_review_id":6352833,"id":85646778,"diff_hunk":"@@ -211,39 +213,82 @@ struct GncSqlConnection\n  * SQL backends must provide a structure which implements all of the functions.\n  */\n \n-class GncSqlRow\n+class GncSqlRow;\n+/**\n+ * Pure virtual class to iterate over a query result set.\n+ */\n+class GncSqlResult\n {\n public:\n-    virtual ~GncSqlRow() = default;\n-    virtual int64_t get_int_at_col (const char* col) = 0;\n-    virtual float get_float_at_col (const char* col) = 0;\n-    virtual double get_double_at_col (const char* col) = 0;\n-    virtual std::string get_string_at_col (const char* col) = 0;\n-    virtual time64 get_time64_at_col (const char* col) = 0;\n-    virtual bool is_col_null (const char* col) const noexcept = 0;\n+    virtual ~GncSqlResult() = default;\n+    virtual uint64_t size() const noexcept = 0;\n+    virtual GncSqlRow& begin() = 0;\n+    virtual GncSqlRow& end() = 0;\n+    friend GncSqlRow;\n+protected:\n+    class IteratorImpl {\n+    public:\n+        virtual ~IteratorImpl() = default;\n+        virtual GncSqlRow& operator++() = 0;\n+        virtual GncSqlResult* operator*() = 0;\n+        virtual int64_t get_int_at_col (const char* col) const = 0;\n+        virtual float get_float_at_col (const char* col) const = 0;\n+        virtual double get_double_at_col (const char* col) const = 0;\n+        virtual std::string get_string_at_col (const char* col) const = 0;\n+        virtual time64 get_time64_at_col (const char* col) const = 0;\n+        virtual bool is_col_null (const char* col) const noexcept = 0;\n+    };\n };\n \n /**\n- * @struct GncSqlResult\n+ * Row of SQL Query results.\n  *\n- * Struct used to represent the result of an SQL SELECT statement.  SQL\n- * backends must provide a structure which implements all of the functions.\n+ * This is a \"pointer\" class of a pimpl pattern, the implementation being\n+ * GncSqlResul::IteratorImpl. It's designed to present a std::forward_iterator\n+ * like interface for use with range-for while allowing for wrapping a C API.","path":"src/backend/sql/gnc-backend-sql.h","position":null,"original_position":67,"commit_id":"00880cd8f505e80479fc97bc673db0e6050ed109","original_commit_id":"a0ae59a96a27b22d80f3da8bdfec7b555f23f2d1","user":{"login":"jralls","id":58910,"avatar_url":"https://avatars.githubusercontent.com/u/58910?v=3","gravatar_id":"","url":"https://api.github.com/users/jralls","html_url":"https://github.com/jralls","followers_url":"https://api.github.com/users/jralls/followers","following_url":"https://api.github.com/users/jralls/following{/other_user}","gists_url":"https://api.github.com/users/jralls/gists{/gist_id}","starred_url":"https://api.github.com/users/jralls/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jralls/subscriptions","organizations_url":"https://api.github.com/users/jralls/orgs","repos_url":"https://api.github.com/users/jralls/repos","events_url":"https://api.github.com/users/jralls/events{/privacy}","received_events_url":"https://api.github.com/users/jralls/received_events","type":"User","site_admin":false},"body":"Thanks, fixed.","created_at":"2016-10-29T19:40:23Z","updated_at":"2016-10-29T19:40:23Z","html_url":"https://github.com/Gnucash/gnucash/pull/110#discussion_r85646778","pull_request_url":"https://api.github.com/repos/Gnucash/gnucash/pulls/110","_links":{"self":{"href":"https://api.github.com/repos/Gnucash/gnucash/pulls/comments/85646778"},"html":{"href":"https://github.com/Gnucash/gnucash/pull/110#discussion_r85646778"},"pull_request":{"href":"https://api.github.com/repos/Gnucash/gnucash/pulls/110"}}},"pull_request":{"url":"https://api.github.com/repos/Gnucash/gnucash/pulls/110","id":91424768,"html_url":"https://github.com/Gnucash/gnucash/pull/110","diff_url":"https://github.com/Gnucash/gnucash/pull/110.diff","patch_url":"https://github.com/Gnucash/gnucash/pull/110.patch","issue_url":"https://api.github.com/repos/Gnucash/gnucash/issues/110","number":110,"state":"open","locked":false,"title":"C++ backend","user":{"login":"jralls","id":58910,"avatar_url":"https://avatars.githubusercontent.com/u/58910?v=3","gravatar_id":"","url":"https://api.github.com/users/jralls","html_url":"https://github.com/jralls","followers_url":"https://api.github.com/users/jralls/followers","following_url":"https://api.github.com/users/jralls/following{/other_user}","gists_url":"https://api.github.com/users/jralls/gists{/gist_id}","starred_url":"https://api.github.com/users/jralls/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jralls/subscriptions","organizations_url":"https://api.github.com/users/jralls/orgs","repos_url":"https://api.github.com/users/jralls/repos","events_url":"https://api.github.com/users/jralls/events{/privacy}","received_events_url":"https://api.github.com/users/jralls/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-10-28T18:00:31Z","updated_at":"2016-10-29T19:40:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f1814616fa247f9600bb195f48e8f40046d704d7","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Gnucash/gnucash/pulls/110/commits","review_comments_url":"https://api.github.com/repos/Gnucash/gnucash/pulls/110/comments","review_comment_url":"https://api.github.com/repos/Gnucash/gnucash/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Gnucash/gnucash/issues/110/comments","statuses_url":"https://api.github.com/repos/Gnucash/gnucash/statuses/00880cd8f505e80479fc97bc673db0e6050ed109","head":{"label":"jralls:c++-backend","ref":"c++-backend","sha":"00880cd8f505e80479fc97bc673db0e6050ed109","user":{"login":"jralls","id":58910,"avatar_url":"https://avatars.githubusercontent.com/u/58910?v=3","gravatar_id":"","url":"https://api.github.com/users/jralls","html_url":"https://github.com/jralls","followers_url":"https://api.github.com/users/jralls/followers","following_url":"https://api.github.com/users/jralls/following{/other_user}","gists_url":"https://api.github.com/users/jralls/gists{/gist_id}","starred_url":"https://api.github.com/users/jralls/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jralls/subscriptions","organizations_url":"https://api.github.com/users/jralls/orgs","repos_url":"https://api.github.com/users/jralls/repos","events_url":"https://api.github.com/users/jralls/events{/privacy}","received_events_url":"https://api.github.com/users/jralls/received_events","type":"User","site_admin":false},"repo":{"id":8019728,"name":"gnucash","full_name":"jralls/gnucash","owner":{"login":"jralls","id":58910,"avatar_url":"https://avatars.githubusercontent.com/u/58910?v=3","gravatar_id":"","url":"https://api.github.com/users/jralls","html_url":"https://github.com/jralls","followers_url":"https://api.github.com/users/jralls/followers","following_url":"https://api.github.com/users/jralls/following{/other_user}","gists_url":"https://api.github.com/users/jralls/gists{/gist_id}","starred_url":"https://api.github.com/users/jralls/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jralls/subscriptions","organizations_url":"https://api.github.com/users/jralls/orgs","repos_url":"https://api.github.com/users/jralls/repos","events_url":"https://api.github.com/users/jralls/events{/privacy}","received_events_url":"https://api.github.com/users/jralls/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jralls/gnucash","description":"Git Mirror of svn.gnucash.org/repo/gnucash","fork":true,"url":"https://api.github.com/repos/jralls/gnucash","forks_url":"https://api.github.com/repos/jralls/gnucash/forks","keys_url":"https://api.github.com/repos/jralls/gnucash/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jralls/gnucash/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jralls/gnucash/teams","hooks_url":"https://api.github.com/repos/jralls/gnucash/hooks","issue_events_url":"https://api.github.com/repos/jralls/gnucash/issues/events{/number}","events_url":"https://api.github.com/repos/jralls/gnucash/events","assignees_url":"https://api.github.com/repos/jralls/gnucash/assignees{/user}","branches_url":"https://api.github.com/repos/jralls/gnucash/branches{/branch}","tags_url":"https://api.github.com/repos/jralls/gnucash/tags","blobs_url":"https://api.github.com/repos/jralls/gnucash/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jralls/gnucash/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jralls/gnucash/git/refs{/sha}","trees_url":"https://api.github.com/repos/jralls/gnucash/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jralls/gnucash/statuses/{sha}","languages_url":"https://api.github.com/repos/jralls/gnucash/languages","stargazers_url":"https://api.github.com/repos/jralls/gnucash/stargazers","contributors_url":"https://api.github.com/repos/jralls/gnucash/contributors","subscribers_url":"https://api.github.com/repos/jralls/gnucash/subscribers","subscription_url":"https://api.github.com/repos/jralls/gnucash/subscription","commits_url":"https://api.github.com/repos/jralls/gnucash/commits{/sha}","git_commits_url":"https://api.github.com/repos/jralls/gnucash/git/commits{/sha}","comments_url":"https://api.github.com/repos/jralls/gnucash/comments{/number}","issue_comment_url":"https://api.github.com/repos/jralls/gnucash/issues/comments{/number}","contents_url":"https://api.github.com/repos/jralls/gnucash/contents/{+path}","compare_url":"https://api.github.com/repos/jralls/gnucash/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jralls/gnucash/merges","archive_url":"https://api.github.com/repos/jralls/gnucash/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jralls/gnucash/downloads","issues_url":"https://api.github.com/repos/jralls/gnucash/issues{/number}","pulls_url":"https://api.github.com/repos/jralls/gnucash/pulls{/number}","milestones_url":"https://api.github.com/repos/jralls/gnucash/milestones{/number}","notifications_url":"https://api.github.com/repos/jralls/gnucash/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jralls/gnucash/labels{/name}","releases_url":"https://api.github.com/repos/jralls/gnucash/releases{/id}","deployments_url":"https://api.github.com/repos/jralls/gnucash/deployments","created_at":"2013-02-05T00:51:32Z","updated_at":"2015-05-04T22:56:21Z","pushed_at":"2016-10-29T19:05:53Z","git_url":"git://github.com/jralls/gnucash.git","ssh_url":"git@github.com:jralls/gnucash.git","clone_url":"https://github.com/jralls/gnucash.git","svn_url":"https://github.com/jralls/gnucash","homepage":null,"size":146274,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Gnucash:master","ref":"master","sha":"a808525d05f615ce9c9b2810c618cfe4bf7bda7f","user":{"login":"Gnucash","id":544952,"avatar_url":"https://avatars.githubusercontent.com/u/544952?v=3","gravatar_id":"","url":"https://api.github.com/users/Gnucash","html_url":"https://github.com/Gnucash","followers_url":"https://api.github.com/users/Gnucash/followers","following_url":"https://api.github.com/users/Gnucash/following{/other_user}","gists_url":"https://api.github.com/users/Gnucash/gists{/gist_id}","starred_url":"https://api.github.com/users/Gnucash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gnucash/subscriptions","organizations_url":"https://api.github.com/users/Gnucash/orgs","repos_url":"https://api.github.com/users/Gnucash/repos","events_url":"https://api.github.com/users/Gnucash/events{/privacy}","received_events_url":"https://api.github.com/users/Gnucash/received_events","type":"Organization","site_admin":false},"repo":{"id":7966650,"name":"gnucash","full_name":"Gnucash/gnucash","owner":{"login":"Gnucash","id":544952,"avatar_url":"https://avatars.githubusercontent.com/u/544952?v=3","gravatar_id":"","url":"https://api.github.com/users/Gnucash","html_url":"https://github.com/Gnucash","followers_url":"https://api.github.com/users/Gnucash/followers","following_url":"https://api.github.com/users/Gnucash/following{/other_user}","gists_url":"https://api.github.com/users/Gnucash/gists{/gist_id}","starred_url":"https://api.github.com/users/Gnucash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gnucash/subscriptions","organizations_url":"https://api.github.com/users/Gnucash/orgs","repos_url":"https://api.github.com/users/Gnucash/repos","events_url":"https://api.github.com/users/Gnucash/events{/privacy}","received_events_url":"https://api.github.com/users/Gnucash/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Gnucash/gnucash","description":"GnuCash Double-Entry Accounting Program.","fork":false,"url":"https://api.github.com/repos/Gnucash/gnucash","forks_url":"https://api.github.com/repos/Gnucash/gnucash/forks","keys_url":"https://api.github.com/repos/Gnucash/gnucash/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Gnucash/gnucash/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Gnucash/gnucash/teams","hooks_url":"https://api.github.com/repos/Gnucash/gnucash/hooks","issue_events_url":"https://api.github.com/repos/Gnucash/gnucash/issues/events{/number}","events_url":"https://api.github.com/repos/Gnucash/gnucash/events","assignees_url":"https://api.github.com/repos/Gnucash/gnucash/assignees{/user}","branches_url":"https://api.github.com/repos/Gnucash/gnucash/branches{/branch}","tags_url":"https://api.github.com/repos/Gnucash/gnucash/tags","blobs_url":"https://api.github.com/repos/Gnucash/gnucash/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Gnucash/gnucash/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Gnucash/gnucash/git/refs{/sha}","trees_url":"https://api.github.com/repos/Gnucash/gnucash/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Gnucash/gnucash/statuses/{sha}","languages_url":"https://api.github.com/repos/Gnucash/gnucash/languages","stargazers_url":"https://api.github.com/repos/Gnucash/gnucash/stargazers","contributors_url":"https://api.github.com/repos/Gnucash/gnucash/contributors","subscribers_url":"https://api.github.com/repos/Gnucash/gnucash/subscribers","subscription_url":"https://api.github.com/repos/Gnucash/gnucash/subscription","commits_url":"https://api.github.com/repos/Gnucash/gnucash/commits{/sha}","git_commits_url":"https://api.github.com/repos/Gnucash/gnucash/git/commits{/sha}","comments_url":"https://api.github.com/repos/Gnucash/gnucash/comments{/number}","issue_comment_url":"https://api.github.com/repos/Gnucash/gnucash/issues/comments{/number}","contents_url":"https://api.github.com/repos/Gnucash/gnucash/contents/{+path}","compare_url":"https://api.github.com/repos/Gnucash/gnucash/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Gnucash/gnucash/merges","archive_url":"https://api.github.com/repos/Gnucash/gnucash/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Gnucash/gnucash/downloads","issues_url":"https://api.github.com/repos/Gnucash/gnucash/issues{/number}","pulls_url":"https://api.github.com/repos/Gnucash/gnucash/pulls{/number}","milestones_url":"https://api.github.com/repos/Gnucash/gnucash/milestones{/number}","notifications_url":"https://api.github.com/repos/Gnucash/gnucash/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Gnucash/gnucash/labels{/name}","releases_url":"https://api.github.com/repos/Gnucash/gnucash/releases{/id}","deployments_url":"https://api.github.com/repos/Gnucash/gnucash/deployments","created_at":"2013-02-01T21:22:29Z","updated_at":"2016-10-29T17:21:17Z","pushed_at":"2016-10-29T19:17:07Z","git_url":"git://github.com/Gnucash/gnucash.git","ssh_url":"git@github.com:Gnucash/gnucash.git","clone_url":"https://github.com/Gnucash/gnucash.git","svn_url":"https://github.com/Gnucash/gnucash","homepage":"http://www.gnucash.org","size":186920,"stargazers_count":482,"watchers_count":482,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":240,"mirror_url":null,"open_issues_count":4,"forks":240,"open_issues":4,"watchers":482,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Gnucash/gnucash/pulls/110"},"html":{"href":"https://github.com/Gnucash/gnucash/pull/110"},"issue":{"href":"https://api.github.com/repos/Gnucash/gnucash/issues/110"},"comments":{"href":"https://api.github.com/repos/Gnucash/gnucash/issues/110/comments"},"review_comments":{"href":"https://api.github.com/repos/Gnucash/gnucash/pulls/110/comments"},"review_comment":{"href":"https://api.github.com/repos/Gnucash/gnucash/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Gnucash/gnucash/pulls/110/commits"},"statuses":{"href":"https://api.github.com/repos/Gnucash/gnucash/statuses/00880cd8f505e80479fc97bc673db0e6050ed109"}}}}
{"actor":{"display_login":"jralls"}}