{"action":"created","comment":{"url":"https://api.github.com/repos/sjhitchner/graphql-resolver/pulls/comments/221451134","pull_request_review_id":160106225,"id":221451134,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMTQ1MTEzNA==","diff_hunk":"@@ -0,0 +1,188 @@\n+package sqlite\n+\n+import (\n+\t\"context\"\n+\t\"database/sql\"\n+\t\"strings\"\n+\n+\t\"github.com/jmoiron/sqlx\"\n+\t_ \"github.com/mattn/go-sqlite3\"\n+)\n+\n+type SQLiteHandler struct {\n+\tconn     *sqlx.DB\n+\tfilepath string\n+}\n+\n+// Postgres Connection Object.  Wraps a sqlx.DB and provides a DBConnection() method to access the\n+// DB Connection\n+func NewSQLiteDBHandler(filepath string) (*SQLiteHandler, error) {\n+\tconn, err := sqlx.Connect(\"sqlite3\", filepath)\n+\tif err != nil {\n+\t\treturn nil, err\n+\t}\n+\tconn.SetMaxOpenConns(20)\n+\n+\ts := &SQLiteHandler{\n+\t\tconn:     conn,\n+\t\tfilepath: filepath,\n+\t}\n+\n+\terr = s.Ping()\n+\tif err != nil {\n+\t\treturn nil, err\n+\t}\n+\n+\treturn s, nil\n+}\n+\n+func (t *SQLiteHandler) DB() *sqlx.DB {\n+\treturn t.conn\n+}\n+\n+func (t *SQLiteHandler) Host() string {\n+\treturn t.filepath\n+}\n+\n+func (t *SQLiteHandler) Name() string {\n+\treturn \"sqlite\"\n+}\n+\n+func (t *SQLiteHandler) Port() string {\n+\treturn \"0\"\n+}\n+\n+func (t *SQLiteHandler) Ping() error {\n+\treturn t.conn.Ping()\n+}\n+\n+func (t *SQLiteHandler) Close() {\n+\tif err := t.conn.Close(); err != nil {\n+\t\tpanic(err)\n+\t}\n+}\n+\n+func IsDuplicateKey(err error) bool {\n+\treturn strings.Contains(err.Error(), \"duplicate key\")\n+}\n+\n+func (t *SQLiteHandler) GetById(ctx context.Context, result interface{}, query string, id interface{}) error {\n+\n+\ttx, err := t.conn.Beginx()\n+\tif err != nil {\n+\t\treturn err\n+\t}\n+\n+\tif err := tx.Get(result, query, id); err != nil {\n+\t\tif sql.ErrNoRows == err {\n+\t\t\treturn Commit(ctx, tx, nil)\n+\t\t}\n+\t\treturn Rollback(ctx, tx, err)\n+\t}\n+\n+\treturn Commit(ctx, tx, err)\n+}\n+\n+func (t *SQLiteHandler) Select(ctx context.Context, results interface{}, query string, params ...interface{}) error {\n+\n+\ttx, err := t.conn.Beginx()\n+\tif err != nil {\n+\t\treturn err\n+\t}\n+\n+\tif err := tx.Select(results, query, params...); err != nil {\n+\t\tif sql.ErrNoRows == err {\n+\t\t\treturn Commit(ctx, tx, nil)\n+\t\t}\n+\t\treturn Rollback(ctx, tx, err)\n+\t}\n+\n+\treturn Commit(ctx, tx, err)\n+}\n+\n+func (t *SQLiteHandler) InsertWithId(ctx context.Context, query string, params ...interface{}) (int64, error) {\n+\n+\t/*\n+\t\tif !strings.Contains(strings.ToUpper(query), \"RETURNING\") {\n+\t\t\tpanic(fmt.Sprintf(\"Query (%s) needs to contain a 'RETURNING id' expression\", query))\n+\t\t}\n+\t*/\n+\n+\ttx, err := t.conn.Beginx()\n+\tif err != nil {\n+\t\treturn 0, Rollback(ctx, tx, err)\n+\t}\n+\n+\tresult, err := tx.Exec(query, params...)\n+\tif sql.ErrNoRows == err {\n+\t\treturn 0, Rollback(ctx, tx, err)\n+\t}\n+\n+\tif err != nil {\n+\t\treturn 0, Rollback(ctx, tx, err)\n+\t}\n+\n+\tlastId, err := result.LastInsertId()\n+\tif err != nil {\n+\t\treturn 0, Rollback(ctx, tx, err)\n+\t}\n+\n+\treturn lastId, Commit(ctx, tx, err)\n+}\n+\n+func (t *SQLiteHandler) Insert(ctx context.Context, query string, params ...interface{}) error {","path":"lib/db/sqlite/sqlite.go","position":133,"original_position":133,"commit_id":"3b0d3dbeaec3c892f5fffc9b9e48bb9738098876","original_commit_id":"3b0d3dbeaec3c892f5fffc9b9e48bb9738098876","user":{"login":"hound[bot]","id":30008653,"node_id":"MDM6Qm90MzAwMDg2NTM=","avatar_url":"https://avatars1.githubusercontent.com/in/3598?v=4","gravatar_id":"","url":"https://api.github.com/users/hound%5Bbot%5D","html_url":"https://github.com/apps/hound","followers_url":"https://api.github.com/users/hound%5Bbot%5D/followers","following_url":"https://api.github.com/users/hound%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/hound%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/hound%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hound%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/hound%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/hound%5Bbot%5D/repos","events_url":"https://api.github.com/users/hound%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/hound%5Bbot%5D/received_events","type":"Bot","site_admin":false},"body":"exported method SQLiteHandler.Insert should have comment or be unexported","created_at":"2018-09-30T08:09:40Z","updated_at":"2018-09-30T08:09:41Z","html_url":"https://github.com/sjhitchner/graphql-resolver/pull/2#discussion_r221451134","pull_request_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/pulls/2","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/sjhitchner/graphql-resolver/pulls/comments/221451134"},"html":{"href":"https://github.com/sjhitchner/graphql-resolver/pull/2#discussion_r221451134"},"pull_request":{"href":"https://api.github.com/repos/sjhitchner/graphql-resolver/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/sjhitchner/graphql-resolver/pulls/2","id":219192010,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE5MTkyMDEw","html_url":"https://github.com/sjhitchner/graphql-resolver/pull/2","diff_url":"https://github.com/sjhitchner/graphql-resolver/pull/2.diff","patch_url":"https://github.com/sjhitchner/graphql-resolver/pull/2.patch","issue_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/issues/2","number":2,"state":"open","locked":false,"title":"Generate v5","user":{"login":"sjhitchner","id":1323624,"node_id":"MDQ6VXNlcjEzMjM2MjQ=","avatar_url":"https://avatars0.githubusercontent.com/u/1323624?v=4","gravatar_id":"","url":"https://api.github.com/users/sjhitchner","html_url":"https://github.com/sjhitchner","followers_url":"https://api.github.com/users/sjhitchner/followers","following_url":"https://api.github.com/users/sjhitchner/following{/other_user}","gists_url":"https://api.github.com/users/sjhitchner/gists{/gist_id}","starred_url":"https://api.github.com/users/sjhitchner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sjhitchner/subscriptions","organizations_url":"https://api.github.com/users/sjhitchner/orgs","repos_url":"https://api.github.com/users/sjhitchner/repos","events_url":"https://api.github.com/users/sjhitchner/events{/privacy}","received_events_url":"https://api.github.com/users/sjhitchner/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-09-30T08:09:19Z","updated_at":"2018-09-30T08:09:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9d37d95d32655a28d1ad7b7a05011bd2318b9791","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/pulls/2/commits","review_comments_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/pulls/2/comments","review_comment_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/issues/2/comments","statuses_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/statuses/3b0d3dbeaec3c892f5fffc9b9e48bb9738098876","head":{"label":"sjhitchner:generate-v5","ref":"generate-v5","sha":"3b0d3dbeaec3c892f5fffc9b9e48bb9738098876","user":{"login":"sjhitchner","id":1323624,"node_id":"MDQ6VXNlcjEzMjM2MjQ=","avatar_url":"https://avatars0.githubusercontent.com/u/1323624?v=4","gravatar_id":"","url":"https://api.github.com/users/sjhitchner","html_url":"https://github.com/sjhitchner","followers_url":"https://api.github.com/users/sjhitchner/followers","following_url":"https://api.github.com/users/sjhitchner/following{/other_user}","gists_url":"https://api.github.com/users/sjhitchner/gists{/gist_id}","starred_url":"https://api.github.com/users/sjhitchner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sjhitchner/subscriptions","organizations_url":"https://api.github.com/users/sjhitchner/orgs","repos_url":"https://api.github.com/users/sjhitchner/repos","events_url":"https://api.github.com/users/sjhitchner/events{/privacy}","received_events_url":"https://api.github.com/users/sjhitchner/received_events","type":"User","site_admin":false},"repo":{"id":142084366,"node_id":"MDEwOlJlcG9zaXRvcnkxNDIwODQzNjY=","name":"graphql-resolver","full_name":"sjhitchner/graphql-resolver","private":false,"owner":{"login":"sjhitchner","id":1323624,"node_id":"MDQ6VXNlcjEzMjM2MjQ=","avatar_url":"https://avatars0.githubusercontent.com/u/1323624?v=4","gravatar_id":"","url":"https://api.github.com/users/sjhitchner","html_url":"https://github.com/sjhitchner","followers_url":"https://api.github.com/users/sjhitchner/followers","following_url":"https://api.github.com/users/sjhitchner/following{/other_user}","gists_url":"https://api.github.com/users/sjhitchner/gists{/gist_id}","starred_url":"https://api.github.com/users/sjhitchner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sjhitchner/subscriptions","organizations_url":"https://api.github.com/users/sjhitchner/orgs","repos_url":"https://api.github.com/users/sjhitchner/repos","events_url":"https://api.github.com/users/sjhitchner/events{/privacy}","received_events_url":"https://api.github.com/users/sjhitchner/received_events","type":"User","site_admin":false},"html_url":"https://github.com/sjhitchner/graphql-resolver","description":"Utilities to generate glue code for GraphQL","fork":false,"url":"https://api.github.com/repos/sjhitchner/graphql-resolver","forks_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/forks","keys_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/teams","hooks_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/hooks","issue_events_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/issues/events{/number}","events_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/events","assignees_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/assignees{/user}","branches_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/branches{/branch}","tags_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/tags","blobs_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/git/refs{/sha}","trees_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/statuses/{sha}","languages_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/languages","stargazers_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/stargazers","contributors_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/contributors","subscribers_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/subscribers","subscription_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/subscription","commits_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/commits{/sha}","git_commits_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/git/commits{/sha}","comments_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/comments{/number}","issue_comment_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/issues/comments{/number}","contents_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/contents/{+path}","compare_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/merges","archive_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/downloads","issues_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/issues{/number}","pulls_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/pulls{/number}","milestones_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/milestones{/number}","notifications_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/labels{/name}","releases_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/releases{/id}","deployments_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/deployments","created_at":"2018-07-24T00:40:55Z","updated_at":"2018-07-26T23:01:41Z","pushed_at":"2018-09-30T08:09:19Z","git_url":"git://github.com/sjhitchner/graphql-resolver.git","ssh_url":"git@github.com:sjhitchner/graphql-resolver.git","clone_url":"https://github.com/sjhitchner/graphql-resolver.git","svn_url":"https://github.com/sjhitchner/graphql-resolver","homepage":null,"size":121,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"sjhitchner:master","ref":"master","sha":"b9dba199a0233eebd8d58887e6a8cae1c16806a1","user":{"login":"sjhitchner","id":1323624,"node_id":"MDQ6VXNlcjEzMjM2MjQ=","avatar_url":"https://avatars0.githubusercontent.com/u/1323624?v=4","gravatar_id":"","url":"https://api.github.com/users/sjhitchner","html_url":"https://github.com/sjhitchner","followers_url":"https://api.github.com/users/sjhitchner/followers","following_url":"https://api.github.com/users/sjhitchner/following{/other_user}","gists_url":"https://api.github.com/users/sjhitchner/gists{/gist_id}","starred_url":"https://api.github.com/users/sjhitchner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sjhitchner/subscriptions","organizations_url":"https://api.github.com/users/sjhitchner/orgs","repos_url":"https://api.github.com/users/sjhitchner/repos","events_url":"https://api.github.com/users/sjhitchner/events{/privacy}","received_events_url":"https://api.github.com/users/sjhitchner/received_events","type":"User","site_admin":false},"repo":{"id":142084366,"node_id":"MDEwOlJlcG9zaXRvcnkxNDIwODQzNjY=","name":"graphql-resolver","full_name":"sjhitchner/graphql-resolver","private":false,"owner":{"login":"sjhitchner","id":1323624,"node_id":"MDQ6VXNlcjEzMjM2MjQ=","avatar_url":"https://avatars0.githubusercontent.com/u/1323624?v=4","gravatar_id":"","url":"https://api.github.com/users/sjhitchner","html_url":"https://github.com/sjhitchner","followers_url":"https://api.github.com/users/sjhitchner/followers","following_url":"https://api.github.com/users/sjhitchner/following{/other_user}","gists_url":"https://api.github.com/users/sjhitchner/gists{/gist_id}","starred_url":"https://api.github.com/users/sjhitchner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sjhitchner/subscriptions","organizations_url":"https://api.github.com/users/sjhitchner/orgs","repos_url":"https://api.github.com/users/sjhitchner/repos","events_url":"https://api.github.com/users/sjhitchner/events{/privacy}","received_events_url":"https://api.github.com/users/sjhitchner/received_events","type":"User","site_admin":false},"html_url":"https://github.com/sjhitchner/graphql-resolver","description":"Utilities to generate glue code for GraphQL","fork":false,"url":"https://api.github.com/repos/sjhitchner/graphql-resolver","forks_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/forks","keys_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/teams","hooks_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/hooks","issue_events_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/issues/events{/number}","events_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/events","assignees_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/assignees{/user}","branches_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/branches{/branch}","tags_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/tags","blobs_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/git/refs{/sha}","trees_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/statuses/{sha}","languages_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/languages","stargazers_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/stargazers","contributors_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/contributors","subscribers_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/subscribers","subscription_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/subscription","commits_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/commits{/sha}","git_commits_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/git/commits{/sha}","comments_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/comments{/number}","issue_comment_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/issues/comments{/number}","contents_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/contents/{+path}","compare_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/merges","archive_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/downloads","issues_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/issues{/number}","pulls_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/pulls{/number}","milestones_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/milestones{/number}","notifications_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/labels{/name}","releases_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/releases{/id}","deployments_url":"https://api.github.com/repos/sjhitchner/graphql-resolver/deployments","created_at":"2018-07-24T00:40:55Z","updated_at":"2018-07-26T23:01:41Z","pushed_at":"2018-09-30T08:09:19Z","git_url":"git://github.com/sjhitchner/graphql-resolver.git","ssh_url":"git@github.com:sjhitchner/graphql-resolver.git","clone_url":"https://github.com/sjhitchner/graphql-resolver.git","svn_url":"https://github.com/sjhitchner/graphql-resolver","homepage":null,"size":121,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sjhitchner/graphql-resolver/pulls/2"},"html":{"href":"https://github.com/sjhitchner/graphql-resolver/pull/2"},"issue":{"href":"https://api.github.com/repos/sjhitchner/graphql-resolver/issues/2"},"comments":{"href":"https://api.github.com/repos/sjhitchner/graphql-resolver/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/sjhitchner/graphql-resolver/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/sjhitchner/graphql-resolver/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sjhitchner/graphql-resolver/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/sjhitchner/graphql-resolver/statuses/3b0d3dbeaec3c892f5fffc9b9e48bb9738098876"}},"author_association":"OWNER"}}
{"actor":{"display_login":"hound"}}