{"action":"created","issue":{"url":"https://api.github.com/repos/go-pg/pg/issues/712","repository_url":"https://api.github.com/repos/go-pg/pg","labels_url":"https://api.github.com/repos/go-pg/pg/issues/712/labels{/name}","comments_url":"https://api.github.com/repos/go-pg/pg/issues/712/comments","events_url":"https://api.github.com/repos/go-pg/pg/issues/712/events","html_url":"https://github.com/go-pg/pg/issues/712","id":283493547,"number":712,"title":"Add custom scanner","user":{"login":"pahanini","id":898663,"avatar_url":"https://avatars2.githubusercontent.com/u/898663?v=4","gravatar_id":"","url":"https://api.github.com/users/pahanini","html_url":"https://github.com/pahanini","followers_url":"https://api.github.com/users/pahanini/followers","following_url":"https://api.github.com/users/pahanini/following{/other_user}","gists_url":"https://api.github.com/users/pahanini/gists{/gist_id}","starred_url":"https://api.github.com/users/pahanini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pahanini/subscriptions","organizations_url":"https://api.github.com/users/pahanini/orgs","repos_url":"https://api.github.com/users/pahanini/repos","events_url":"https://api.github.com/users/pahanini/events{/privacy}","received_events_url":"https://api.github.com/users/pahanini/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-12-20T09:07:36Z","updated_at":"2017-12-20T09:10:49Z","closed_at":null,"author_association":"NONE","body":"I need to fetch millions rows from database, but I do not want to store this data into variable. I just want send it into network.\r\n\r\nI see`pg.Scan()` returns `orm.ColumnScanner` interface and I tried to implement my own:\r\n\r\n```go\r\ntype MyScanner struct {\r\n}\r\n\r\nfunc (s *MyScanner) ScanColumn(colIdx int, colName string, b []byte) error {\r\n\t// send data to network here\r\n\treturn nil\r\n}\r\n```\r\n\r\nAnd then I used this struct in Query\r\n\r\n```go\r\n   s := MyScanner{}\r\n   db.Query(&s, ```SELECT name FROM foo```)\r\n```\r\n\r\nBut I've got this error:\r\n\r\n```go\r\npanic: pg: can't find column=name in model=MyScanner [recovered]\r\n```\r\n\r\nIs it possible to implement custom scanner or may be another way to process millions or rows without storing it in variable exists?\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n "},"comment":{"url":"https://api.github.com/repos/go-pg/pg/issues/comments/353006877","html_url":"https://github.com/go-pg/pg/issues/712#issuecomment-353006877","issue_url":"https://api.github.com/repos/go-pg/pg/issues/712","id":353006877,"user":{"login":"vmihailenco","id":290976,"avatar_url":"https://avatars2.githubusercontent.com/u/290976?v=4","gravatar_id":"","url":"https://api.github.com/users/vmihailenco","html_url":"https://github.com/vmihailenco","followers_url":"https://api.github.com/users/vmihailenco/followers","following_url":"https://api.github.com/users/vmihailenco/following{/other_user}","gists_url":"https://api.github.com/users/vmihailenco/gists{/gist_id}","starred_url":"https://api.github.com/users/vmihailenco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vmihailenco/subscriptions","organizations_url":"https://api.github.com/users/vmihailenco/orgs","repos_url":"https://api.github.com/users/vmihailenco/repos","events_url":"https://api.github.com/users/vmihailenco/events{/privacy}","received_events_url":"https://api.github.com/users/vmihailenco/received_events","type":"User","site_admin":false},"created_at":"2017-12-20T09:10:49Z","updated_at":"2017-12-20T09:10:49Z","author_association":"CONTRIBUTOR","body":"`MyScanner` must implement `orm.Model` interface. For example see `pg.Strings` - https://github.com/go-pg/pg/blob/master/pg.go#L85-L153"}}
{"actor":{"display_login":"vmihailenco"}}