{"action":"created","issue":{"url":"https://api.github.com/repos/jinzhu/gorm/issues/295","repository_url":"https://api.github.com/repos/jinzhu/gorm","labels_url":"https://api.github.com/repos/jinzhu/gorm/issues/295/labels{/name}","comments_url":"https://api.github.com/repos/jinzhu/gorm/issues/295/comments","events_url":"https://api.github.com/repos/jinzhu/gorm/issues/295/events","html_url":"https://github.com/jinzhu/gorm/pull/295","id":49802271,"number":295,"title":"Allow .Open to reuse existing database connections.","user":{"login":"jnfeinstein","id":1378419,"avatar_url":"https://avatars.githubusercontent.com/u/1378419?v=3","gravatar_id":"","url":"https://api.github.com/users/jnfeinstein","html_url":"https://github.com/jnfeinstein","followers_url":"https://api.github.com/users/jnfeinstein/followers","following_url":"https://api.github.com/users/jnfeinstein/following{/other_user}","gists_url":"https://api.github.com/users/jnfeinstein/gists{/gist_id}","starred_url":"https://api.github.com/users/jnfeinstein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jnfeinstein/subscriptions","organizations_url":"https://api.github.com/users/jnfeinstein/orgs","repos_url":"https://api.github.com/users/jnfeinstein/repos","events_url":"https://api.github.com/users/jnfeinstein/events{/privacy}","received_events_url":"https://api.github.com/users/jnfeinstein/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2014-11-22T19:36:44Z","updated_at":"2016-04-07T19:22:36Z","closed_at":"2014-11-25T07:32:16Z","pull_request":{"url":"https://api.github.com/repos/jinzhu/gorm/pulls/295","html_url":"https://github.com/jinzhu/gorm/pull/295","diff_url":"https://github.com/jinzhu/gorm/pull/295.diff","patch_url":"https://github.com/jinzhu/gorm/pull/295.patch"},"body":"This commit allows you to pass a string or an existing database\r\nconnection as the source for gorm. The dialect is still required\r\nbecause a) there is no common reference to it as far as i know, and\r\nb) gorm allows the dialect to differ from the driver. So, for the sake\r\nof simplicity, you still have to specity the dialect.\r\n\r\nThis is useful if you have an existing transaction, but still\r\nwant to use gorm to format your queries.\r\n\r\nThis is dependent on the defintion of DB in pkg database/sql having\r\nthe field 'dsn', which is the database source, obtained via reflect.\r\n\r\nThis is a better implementation than #277."},"comment":{"url":"https://api.github.com/repos/jinzhu/gorm/issues/comments/207056641","html_url":"https://github.com/jinzhu/gorm/pull/295#issuecomment-207056641","issue_url":"https://api.github.com/repos/jinzhu/gorm/issues/295","id":207056641,"user":{"login":"bigokro","id":72254,"avatar_url":"https://avatars.githubusercontent.com/u/72254?v=3","gravatar_id":"","url":"https://api.github.com/users/bigokro","html_url":"https://github.com/bigokro","followers_url":"https://api.github.com/users/bigokro/followers","following_url":"https://api.github.com/users/bigokro/following{/other_user}","gists_url":"https://api.github.com/users/bigokro/gists{/gist_id}","starred_url":"https://api.github.com/users/bigokro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bigokro/subscriptions","organizations_url":"https://api.github.com/users/bigokro/orgs","repos_url":"https://api.github.com/users/bigokro/repos","events_url":"https://api.github.com/users/bigokro/events{/privacy}","received_events_url":"https://api.github.com/users/bigokro/received_events","type":"User","site_admin":false},"created_at":"2016-04-07T19:22:36Z","updated_at":"2016-04-07T19:22:36Z","body":"Ok, thanks for the tip @pjebs . @j4zz, looks like I'll have to get used to that, too :)"}}