{"action":"created","issue":{"url":"https://api.github.com/repos/golang/go/issues/14674","repository_url":"https://api.github.com/repos/golang/go","labels_url":"https://api.github.com/repos/golang/go/issues/14674/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/14674/comments","events_url":"https://api.github.com/repos/golang/go/issues/14674/events","html_url":"https://github.com/golang/go/issues/14674","id":138831960,"number":14674,"title":"database/sql: add Queryer interface","user":{"login":"james-lawrence","id":2835871,"avatar_url":"https://avatars.githubusercontent.com/u/2835871?v=3","gravatar_id":"","url":"https://api.github.com/users/james-lawrence","html_url":"https://github.com/james-lawrence","followers_url":"https://api.github.com/users/james-lawrence/followers","following_url":"https://api.github.com/users/james-lawrence/following{/other_user}","gists_url":"https://api.github.com/users/james-lawrence/gists{/gist_id}","starred_url":"https://api.github.com/users/james-lawrence/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/james-lawrence/subscriptions","organizations_url":"https://api.github.com/users/james-lawrence/orgs","repos_url":"https://api.github.com/users/james-lawrence/repos","events_url":"https://api.github.com/users/james-lawrence/events{/privacy}","received_events_url":"https://api.github.com/users/james-lawrence/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-03-06T20:11:10Z","updated_at":"2016-04-10T03:13:32Z","closed_at":"2016-04-10T00:16:26Z","body":"seems like 90% of the time I'm interacting with a database most of my DB code doesn't care if i'm within a TX or not. often there are queries I'm executing in various places with different contexts, some of which require a transaction, some which don't. But I can't share the code without writing my own Queryer style interface. now granted its only a few lines, but it seems like this is something that should just be in the sql package itself.\r\n\r\nI'm happy to do the work, submit the PR etc. just curious if there is any object to adding it and why."},"comment":{"url":"https://api.github.com/repos/golang/go/issues/comments/207904595","html_url":"https://github.com/golang/go/issues/14674#issuecomment-207904595","issue_url":"https://api.github.com/repos/golang/go/issues/14674","id":207904595,"user":{"login":"bradfitz","id":2621,"avatar_url":"https://avatars.githubusercontent.com/u/2621?v=3","gravatar_id":"","url":"https://api.github.com/users/bradfitz","html_url":"https://github.com/bradfitz","followers_url":"https://api.github.com/users/bradfitz/followers","following_url":"https://api.github.com/users/bradfitz/following{/other_user}","gists_url":"https://api.github.com/users/bradfitz/gists{/gist_id}","starred_url":"https://api.github.com/users/bradfitz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bradfitz/subscriptions","organizations_url":"https://api.github.com/users/bradfitz/orgs","repos_url":"https://api.github.com/users/bradfitz/repos","events_url":"https://api.github.com/users/bradfitz/events{/privacy}","received_events_url":"https://api.github.com/users/bradfitz/received_events","type":"User","site_admin":false},"created_at":"2016-04-10T03:13:31Z","updated_at":"2016-04-10T03:13:31Z","body":"All those interfaces look different, though. It doesn't look like there's necessarily consensus.\r\n\r\nI think it's fine if people writing funcs like QueryRowWith (https://github.com/Masterminds/squirrel/blob/master/squirrel.go#L110) define the exact interface they want.\r\n"}}