{"action":"created","issue":{"url":"https://api.github.com/repos/herenow/go-crate/issues/15","repository_url":"https://api.github.com/repos/herenow/go-crate","labels_url":"https://api.github.com/repos/herenow/go-crate/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/herenow/go-crate/issues/15/comments","events_url":"https://api.github.com/repos/herenow/go-crate/issues/15/events","html_url":"https://github.com/herenow/go-crate/pull/15","id":227361999,"number":15,"title":"Handle TimeStamp columns by converting int64 to time.Time and vice versa","user":{"login":"echarlus","id":7509875,"avatar_url":"https://avatars3.githubusercontent.com/u/7509875?v=3","gravatar_id":"","url":"https://api.github.com/users/echarlus","html_url":"https://github.com/echarlus","followers_url":"https://api.github.com/users/echarlus/followers","following_url":"https://api.github.com/users/echarlus/following{/other_user}","gists_url":"https://api.github.com/users/echarlus/gists{/gist_id}","starred_url":"https://api.github.com/users/echarlus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/echarlus/subscriptions","organizations_url":"https://api.github.com/users/echarlus/orgs","repos_url":"https://api.github.com/users/echarlus/repos","events_url":"https://api.github.com/users/echarlus/events{/privacy}","received_events_url":"https://api.github.com/users/echarlus/received_events","type":"User","site_admin":false},"labels":[{"id":118272934,"url":"https://api.github.com/repos/herenow/go-crate/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2017-05-09T13:11:47Z","updated_at":"2017-05-10T13:56:13Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/herenow/go-crate/pulls/15","html_url":"https://github.com/herenow/go-crate/pull/15","diff_url":"https://github.com/herenow/go-crate/pull/15.diff","patch_url":"https://github.com/herenow/go-crate/pull/15.patch"},"body":"Since one cannot yet replace the driver.DefaultParameterConverter to properly handle type conversions (see https://github.com/golang/go/issues/18415)\r\nI've made a quick patch to automatically handle TimeStamp (int64) columns conversion to time.Time by using the column type provided by Crate within the query’s results and to convert back to int64 any time."},"comment":{"url":"https://api.github.com/repos/herenow/go-crate/issues/comments/300489603","html_url":"https://github.com/herenow/go-crate/pull/15#issuecomment-300489603","issue_url":"https://api.github.com/repos/herenow/go-crate/issues/15","id":300489603,"user":{"login":"herenow","id":2773294,"avatar_url":"https://avatars3.githubusercontent.com/u/2773294?v=3","gravatar_id":"","url":"https://api.github.com/users/herenow","html_url":"https://github.com/herenow","followers_url":"https://api.github.com/users/herenow/followers","following_url":"https://api.github.com/users/herenow/following{/other_user}","gists_url":"https://api.github.com/users/herenow/gists{/gist_id}","starred_url":"https://api.github.com/users/herenow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/herenow/subscriptions","organizations_url":"https://api.github.com/users/herenow/orgs","repos_url":"https://api.github.com/users/herenow/repos","events_url":"https://api.github.com/users/herenow/events{/privacy}","received_events_url":"https://api.github.com/users/herenow/received_events","type":"User","site_admin":false},"created_at":"2017-05-10T13:56:13Z","updated_at":"2017-05-10T13:56:13Z","body":"Wouldn't this change the value we are assigning to each row column?\r\n\r\nhttps://golang.org/pkg/database/sql/#Rows.Scan\r\n\r\nSo if we did:\r\n\r\n```golang\r\n// create table users ( created_at timestmap );\r\nrows, err := db.Query(\"select created_at from users limit 1\")\r\nfor rows.Next() {\r\n\tvar created_at time.Time\r\n\r\n\trows.Scan(&created_at)\r\n}\r\n``\r\n\r\nFrom what I understood, this PR changes what we are scanning into the destination we pass into `rows.Scan()`, so if the destination is an `int64`, it would fail when we tried to assign a `time.Time` into it, wouldn't it?\r\n\r\nMaybe I'm confused, and got this all wrong, I haven't worked on this for a while.\r\n\r\nI'll give this code a test.\r\n\r\n"}}
{"actor":{"display_login":"herenow"}}