{"action":"created","issue":{"url":"https://api.github.com/repos/ericmj/mongodb/issues/34","labels_url":"https://api.github.com/repos/ericmj/mongodb/issues/34/labels{/name}","comments_url":"https://api.github.com/repos/ericmj/mongodb/issues/34/comments","events_url":"https://api.github.com/repos/ericmj/mongodb/issues/34/events","html_url":"https://github.com/ericmj/mongodb/issues/34","id":118968670,"number":34,"title":"Add ability to specify database on the use Mongo.Pool options","user":{"login":"fairbairn","id":5289625,"avatar_url":"https://avatars.githubusercontent.com/u/5289625?v=3","gravatar_id":"","url":"https://api.github.com/users/fairbairn","html_url":"https://github.com/fairbairn","followers_url":"https://api.github.com/users/fairbairn/followers","following_url":"https://api.github.com/users/fairbairn/following{/other_user}","gists_url":"https://api.github.com/users/fairbairn/gists{/gist_id}","starred_url":"https://api.github.com/users/fairbairn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fairbairn/subscriptions","organizations_url":"https://api.github.com/users/fairbairn/orgs","repos_url":"https://api.github.com/users/fairbairn/repos","events_url":"https://api.github.com/users/fairbairn/events{/privacy}","received_events_url":"https://api.github.com/users/fairbairn/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-26T04:13:55Z","updated_at":"2015-11-26T07:56:22Z","closed_at":null,"body":"Would like the ability to also define the database when defining the pool definition itself, instead of specifying the database on start_link.  Since the pool is directly tied to the database, this keeps it cleaner.\r\n\r\nThe existing approach is:\r\n\r\ndefmodule DatabasePool do\r\n  use Mongo.Pool, name: __MODULE__, adapter: Mongo.Pool.Poolboy\r\nend\r\n\r\nbut then elsewhere having to perform a DatabasePool.start_link(database: \"my_database\").\r\n\r\nWould also like the ability to do this instead...\r\n\r\ndefmodule DatabasePool do\r\n  use Mongo.Pool, name: __MODULE__, adapter: Mongo.Pool.Poolboy, database: \"my_database\"\r\nend\r\n\r\nDatabasePool.start_link\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/ericmj/mongodb/issues/comments/159840628","html_url":"https://github.com/ericmj/mongodb/issues/34#issuecomment-159840628","issue_url":"https://api.github.com/repos/ericmj/mongodb/issues/34","id":159840628,"user":{"login":"michalmuskala","id":477062,"avatar_url":"https://avatars.githubusercontent.com/u/477062?v=3","gravatar_id":"","url":"https://api.github.com/users/michalmuskala","html_url":"https://github.com/michalmuskala","followers_url":"https://api.github.com/users/michalmuskala/followers","following_url":"https://api.github.com/users/michalmuskala/following{/other_user}","gists_url":"https://api.github.com/users/michalmuskala/gists{/gist_id}","starred_url":"https://api.github.com/users/michalmuskala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michalmuskala/subscriptions","organizations_url":"https://api.github.com/users/michalmuskala/orgs","repos_url":"https://api.github.com/users/michalmuskala/repos","events_url":"https://api.github.com/users/michalmuskala/events{/privacy}","received_events_url":"https://api.github.com/users/michalmuskala/received_events","type":"User","site_admin":false},"created_at":"2015-11-26T07:56:22Z","updated_at":"2015-11-26T07:56:22Z","body":"You can always define a 0-artiy additional `start_link` function on your pool that would merge default arguments:\r\n\r\n```\r\ndef start_link\r\n  start_link(database: \"default_database\")\r\nend\r\n```"}}