{"action":"created","comment":{"url":"https://api.github.com/repos/ory-am/hydra/pulls/comments/52844220","id":52844220,"diff_hunk":"@@ -192,7 +192,8 @@ The CLI currently requires two environment variables:\n | PORT                 | Which port to listen on   | number                                        | 443       |\n | HOST                 | Which host to listen on   | ip or hostname                                | empty (all) |\n | HOST_URL             | Hydra's host URL          | url                                           | \"https://localhost:4443\" |\n-| DATABASE_URL         | PostgreSQL Database URL   | `postgres://user:password@host:port/database` | empty     |\n+| DATABASE_URL         | Database URL   | e.g: `postgres://user:password@host:port/database` | empty     |\n+| DATABASE             | Database Technology   | string e.g: `postgres` or `rethinkdb` | postgres     |","path":"README.md","position":24,"original_position":24,"commit_id":"cb9c2f488c85fa1d34342817bc1ba28caf8d2a5e","original_commit_id":"cb9c2f488c85fa1d34342817bc1ba28caf8d2a5e","user":{"login":"arekkas","id":3372410,"avatar_url":"https://avatars.githubusercontent.com/u/3372410?v=3","gravatar_id":"","url":"https://api.github.com/users/arekkas","html_url":"https://github.com/arekkas","followers_url":"https://api.github.com/users/arekkas/followers","following_url":"https://api.github.com/users/arekkas/following{/other_user}","gists_url":"https://api.github.com/users/arekkas/gists{/gist_id}","starred_url":"https://api.github.com/users/arekkas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arekkas/subscriptions","organizations_url":"https://api.github.com/users/arekkas/orgs","repos_url":"https://api.github.com/users/arekkas/repos","events_url":"https://api.github.com/users/arekkas/events{/privacy}","received_events_url":"https://api.github.com/users/arekkas/received_events","type":"User","site_admin":false},"body":"couldn't this be done via:\r\n\r\n* `postgres://user:password@host:port/database` - postgres\r\n* `rethinkdb://...` - rethinkdb\r\n* `mysql://...`","created_at":"2016-02-14T15:24:11Z","updated_at":"2016-02-14T15:24:11Z","html_url":"https://github.com/ory-am/hydra/pull/53#discussion_r52844220","pull_request_url":"https://api.github.com/repos/ory-am/hydra/pulls/53","_links":{"self":{"href":"https://api.github.com/repos/ory-am/hydra/pulls/comments/52844220"},"html":{"href":"https://github.com/ory-am/hydra/pull/53#discussion_r52844220"},"pull_request":{"href":"https://api.github.com/repos/ory-am/hydra/pulls/53"}}},"pull_request":{"url":"https://api.github.com/repos/ory-am/hydra/pulls/53","id":59029643,"html_url":"https://github.com/ory-am/hydra/pull/53","diff_url":"https://github.com/ory-am/hydra/pull/53.diff","patch_url":"https://github.com/ory-am/hydra/pull/53.patch","issue_url":"https://api.github.com/repos/ory-am/hydra/issues/53","number":53,"state":"open","locked":false,"title":"RethinkDB","user":{"login":"leetal","id":1221839,"avatar_url":"https://avatars.githubusercontent.com/u/1221839?v=3","gravatar_id":"","url":"https://api.github.com/users/leetal","html_url":"https://github.com/leetal","followers_url":"https://api.github.com/users/leetal/followers","following_url":"https://api.github.com/users/leetal/following{/other_user}","gists_url":"https://api.github.com/users/leetal/gists{/gist_id}","starred_url":"https://api.github.com/users/leetal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leetal/subscriptions","organizations_url":"https://api.github.com/users/leetal/orgs","repos_url":"https://api.github.com/users/leetal/repos","events_url":"https://api.github.com/users/leetal/events{/privacy}","received_events_url":"https://api.github.com/users/leetal/received_events","type":"User","site_admin":false},"body":"So, i have finally added RethinkDB. All tests pass (_1._ see below) locally and some changes have been made to the base implementation of Hydra (no BC Breaks?). I have for example introduced the new `Context` interface that makes it easier to extend Hydra in the future by adding more storage contexts. I also added the ability to select which storage backend to use via the new `DATABASE` environment variable (defaults to postgres). There is so much to write, but i think that a code review would definitely be in place now!  \r\n\r\nSince dockertest does not support rethinkdb, all rethinkdb tests require the environment variable RETHINKDB_URL to be set prior to testing (and obviously a rethinkdb instance up and running).\r\n\r\nThere are probably lots of improvements that can be made, but at least this is as far as I have gone.\r\nTo mention a few:\r\n- For example, i don't know if travis tests work at all right now since the code isn't merged to ory-am/hydra.\r\n- The Close() function in the Contexts is never called right now. We need to find a way to intercept shutdown and interrupt signals and call Close() from there. \r\n\r\n_1._ Sadly i could not test the postgres version at all due to limitations on my macbook. So all Postgres-tests fails for me, but everything else passes. BUT, I have not touched the postgres parts at all, so they should probably work. So neither vagrant (won't work until after merge) nor postgres versions tested. (But hey as i said, they should work ;) )\r\n\r\nPlease see #39 for more discussions regarding this PR.","created_at":"2016-02-11T13:24:40Z","updated_at":"2016-02-14T15:24:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ad77437d79ef7f17f2b3f0c743d5b58cc1a93490","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ory-am/hydra/pulls/53/commits","review_comments_url":"https://api.github.com/repos/ory-am/hydra/pulls/53/comments","review_comment_url":"https://api.github.com/repos/ory-am/hydra/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ory-am/hydra/issues/53/comments","statuses_url":"https://api.github.com/repos/ory-am/hydra/statuses/cb9c2f488c85fa1d34342817bc1ba28caf8d2a5e","head":{"label":"leetal:master","ref":"master","sha":"cb9c2f488c85fa1d34342817bc1ba28caf8d2a5e","user":{"login":"leetal","id":1221839,"avatar_url":"https://avatars.githubusercontent.com/u/1221839?v=3","gravatar_id":"","url":"https://api.github.com/users/leetal","html_url":"https://github.com/leetal","followers_url":"https://api.github.com/users/leetal/followers","following_url":"https://api.github.com/users/leetal/following{/other_user}","gists_url":"https://api.github.com/users/leetal/gists{/gist_id}","starred_url":"https://api.github.com/users/leetal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leetal/subscriptions","organizations_url":"https://api.github.com/users/leetal/orgs","repos_url":"https://api.github.com/users/leetal/repos","events_url":"https://api.github.com/users/leetal/events{/privacy}","received_events_url":"https://api.github.com/users/leetal/received_events","type":"User","site_admin":false},"repo":{"id":51249295,"name":"hydra","full_name":"leetal/hydra","owner":{"login":"leetal","id":1221839,"avatar_url":"https://avatars.githubusercontent.com/u/1221839?v=3","gravatar_id":"","url":"https://api.github.com/users/leetal","html_url":"https://github.com/leetal","followers_url":"https://api.github.com/users/leetal/followers","following_url":"https://api.github.com/users/leetal/following{/other_user}","gists_url":"https://api.github.com/users/leetal/gists{/gist_id}","starred_url":"https://api.github.com/users/leetal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leetal/subscriptions","organizations_url":"https://api.github.com/users/leetal/orgs","repos_url":"https://api.github.com/users/leetal/repos","events_url":"https://api.github.com/users/leetal/events{/privacy}","received_events_url":"https://api.github.com/users/leetal/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/leetal/hydra","description":"Run your own AWS-like identity & access management (IAM) service with OAuth2 capabilities in less than 2 minutes. Written in Go. Backed by PostgreSQL or RethinkDB. Built transparent and cloud native.","fork":true,"url":"https://api.github.com/repos/leetal/hydra","forks_url":"https://api.github.com/repos/leetal/hydra/forks","keys_url":"https://api.github.com/repos/leetal/hydra/keys{/key_id}","collaborators_url":"https://api.github.com/repos/leetal/hydra/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/leetal/hydra/teams","hooks_url":"https://api.github.com/repos/leetal/hydra/hooks","issue_events_url":"https://api.github.com/repos/leetal/hydra/issues/events{/number}","events_url":"https://api.github.com/repos/leetal/hydra/events","assignees_url":"https://api.github.com/repos/leetal/hydra/assignees{/user}","branches_url":"https://api.github.com/repos/leetal/hydra/branches{/branch}","tags_url":"https://api.github.com/repos/leetal/hydra/tags","blobs_url":"https://api.github.com/repos/leetal/hydra/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/leetal/hydra/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/leetal/hydra/git/refs{/sha}","trees_url":"https://api.github.com/repos/leetal/hydra/git/trees{/sha}","statuses_url":"https://api.github.com/repos/leetal/hydra/statuses/{sha}","languages_url":"https://api.github.com/repos/leetal/hydra/languages","stargazers_url":"https://api.github.com/repos/leetal/hydra/stargazers","contributors_url":"https://api.github.com/repos/leetal/hydra/contributors","subscribers_url":"https://api.github.com/repos/leetal/hydra/subscribers","subscription_url":"https://api.github.com/repos/leetal/hydra/subscription","commits_url":"https://api.github.com/repos/leetal/hydra/commits{/sha}","git_commits_url":"https://api.github.com/repos/leetal/hydra/git/commits{/sha}","comments_url":"https://api.github.com/repos/leetal/hydra/comments{/number}","issue_comment_url":"https://api.github.com/repos/leetal/hydra/issues/comments{/number}","contents_url":"https://api.github.com/repos/leetal/hydra/contents/{+path}","compare_url":"https://api.github.com/repos/leetal/hydra/compare/{base}...{head}","merges_url":"https://api.github.com/repos/leetal/hydra/merges","archive_url":"https://api.github.com/repos/leetal/hydra/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/leetal/hydra/downloads","issues_url":"https://api.github.com/repos/leetal/hydra/issues{/number}","pulls_url":"https://api.github.com/repos/leetal/hydra/pulls{/number}","milestones_url":"https://api.github.com/repos/leetal/hydra/milestones{/number}","notifications_url":"https://api.github.com/repos/leetal/hydra/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/leetal/hydra/labels{/name}","releases_url":"https://api.github.com/repos/leetal/hydra/releases{/id}","deployments_url":"https://api.github.com/repos/leetal/hydra/deployments","created_at":"2016-02-07T13:55:13Z","updated_at":"2016-02-11T12:28:20Z","pushed_at":"2016-02-12T14:28:40Z","git_url":"git://github.com/leetal/hydra.git","ssh_url":"git@github.com:leetal/hydra.git","clone_url":"https://github.com/leetal/hydra.git","svn_url":"https://github.com/leetal/hydra","homepage":"https://ory.am/hydra","size":1158,"stargazers_count":0,"watchers_count":0,"language":"Go","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":"master"}},"base":{"label":"ory-am:master","ref":"master","sha":"300ef6ae991f1f025edcd9afc52e04d62e653601","user":{"login":"ory-am","id":10667373,"avatar_url":"https://avatars.githubusercontent.com/u/10667373?v=3","gravatar_id":"","url":"https://api.github.com/users/ory-am","html_url":"https://github.com/ory-am","followers_url":"https://api.github.com/users/ory-am/followers","following_url":"https://api.github.com/users/ory-am/following{/other_user}","gists_url":"https://api.github.com/users/ory-am/gists{/gist_id}","starred_url":"https://api.github.com/users/ory-am/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ory-am/subscriptions","organizations_url":"https://api.github.com/users/ory-am/orgs","repos_url":"https://api.github.com/users/ory-am/repos","events_url":"https://api.github.com/users/ory-am/events{/privacy}","received_events_url":"https://api.github.com/users/ory-am/received_events","type":"Organization","site_admin":false},"repo":{"id":36071697,"name":"hydra","full_name":"ory-am/hydra","owner":{"login":"ory-am","id":10667373,"avatar_url":"https://avatars.githubusercontent.com/u/10667373?v=3","gravatar_id":"","url":"https://api.github.com/users/ory-am","html_url":"https://github.com/ory-am","followers_url":"https://api.github.com/users/ory-am/followers","following_url":"https://api.github.com/users/ory-am/following{/other_user}","gists_url":"https://api.github.com/users/ory-am/gists{/gist_id}","starred_url":"https://api.github.com/users/ory-am/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ory-am/subscriptions","organizations_url":"https://api.github.com/users/ory-am/orgs","repos_url":"https://api.github.com/users/ory-am/repos","events_url":"https://api.github.com/users/ory-am/events{/privacy}","received_events_url":"https://api.github.com/users/ory-am/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ory-am/hydra","description":"Run your own AWS-like identity & access management (IAM) service with OAuth2 capabilities in less than 2 minutes. Written in Go. Backed by PostgreSQL. Built transparent and cloud native.","fork":false,"url":"https://api.github.com/repos/ory-am/hydra","forks_url":"https://api.github.com/repos/ory-am/hydra/forks","keys_url":"https://api.github.com/repos/ory-am/hydra/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ory-am/hydra/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ory-am/hydra/teams","hooks_url":"https://api.github.com/repos/ory-am/hydra/hooks","issue_events_url":"https://api.github.com/repos/ory-am/hydra/issues/events{/number}","events_url":"https://api.github.com/repos/ory-am/hydra/events","assignees_url":"https://api.github.com/repos/ory-am/hydra/assignees{/user}","branches_url":"https://api.github.com/repos/ory-am/hydra/branches{/branch}","tags_url":"https://api.github.com/repos/ory-am/hydra/tags","blobs_url":"https://api.github.com/repos/ory-am/hydra/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ory-am/hydra/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ory-am/hydra/git/refs{/sha}","trees_url":"https://api.github.com/repos/ory-am/hydra/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ory-am/hydra/statuses/{sha}","languages_url":"https://api.github.com/repos/ory-am/hydra/languages","stargazers_url":"https://api.github.com/repos/ory-am/hydra/stargazers","contributors_url":"https://api.github.com/repos/ory-am/hydra/contributors","subscribers_url":"https://api.github.com/repos/ory-am/hydra/subscribers","subscription_url":"https://api.github.com/repos/ory-am/hydra/subscription","commits_url":"https://api.github.com/repos/ory-am/hydra/commits{/sha}","git_commits_url":"https://api.github.com/repos/ory-am/hydra/git/commits{/sha}","comments_url":"https://api.github.com/repos/ory-am/hydra/comments{/number}","issue_comment_url":"https://api.github.com/repos/ory-am/hydra/issues/comments{/number}","contents_url":"https://api.github.com/repos/ory-am/hydra/contents/{+path}","compare_url":"https://api.github.com/repos/ory-am/hydra/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ory-am/hydra/merges","archive_url":"https://api.github.com/repos/ory-am/hydra/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ory-am/hydra/downloads","issues_url":"https://api.github.com/repos/ory-am/hydra/issues{/number}","pulls_url":"https://api.github.com/repos/ory-am/hydra/pulls{/number}","milestones_url":"https://api.github.com/repos/ory-am/hydra/milestones{/number}","notifications_url":"https://api.github.com/repos/ory-am/hydra/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ory-am/hydra/labels{/name}","releases_url":"https://api.github.com/repos/ory-am/hydra/releases{/id}","deployments_url":"https://api.github.com/repos/ory-am/hydra/deployments","created_at":"2015-05-22T12:42:08Z","updated_at":"2016-02-14T02:06:11Z","pushed_at":"2016-02-12T14:28:41Z","git_url":"git://github.com/ory-am/hydra.git","ssh_url":"git@github.com:ory-am/hydra.git","clone_url":"https://github.com/ory-am/hydra.git","svn_url":"https://github.com/ory-am/hydra","homepage":"https://ory.am/hydra","size":1879,"stargazers_count":582,"watchers_count":582,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":26,"mirror_url":null,"open_issues_count":13,"forks":26,"open_issues":13,"watchers":582,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ory-am/hydra/pulls/53"},"html":{"href":"https://github.com/ory-am/hydra/pull/53"},"issue":{"href":"https://api.github.com/repos/ory-am/hydra/issues/53"},"comments":{"href":"https://api.github.com/repos/ory-am/hydra/issues/53/comments"},"review_comments":{"href":"https://api.github.com/repos/ory-am/hydra/pulls/53/comments"},"review_comment":{"href":"https://api.github.com/repos/ory-am/hydra/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ory-am/hydra/pulls/53/commits"},"statuses":{"href":"https://api.github.com/repos/ory-am/hydra/statuses/cb9c2f488c85fa1d34342817bc1ba28caf8d2a5e"}}}}