{"action":"created","issue":{"url":"https://api.github.com/repos/rstats-db/DBI/issues/42","labels_url":"https://api.github.com/repos/rstats-db/DBI/issues/42/labels{/name}","comments_url":"https://api.github.com/repos/rstats-db/DBI/issues/42/comments","events_url":"https://api.github.com/repos/rstats-db/DBI/issues/42/events","html_url":"https://github.com/rstats-db/DBI/issues/42","id":110842364,"number":42,"title":"Think about return types for date, time and timestamp","user":{"login":"krlmlr","id":1741643,"avatar_url":"https://avatars.githubusercontent.com/u/1741643?v=3","gravatar_id":"","url":"https://api.github.com/users/krlmlr","html_url":"https://github.com/krlmlr","followers_url":"https://api.github.com/users/krlmlr/followers","following_url":"https://api.github.com/users/krlmlr/following{/other_user}","gists_url":"https://api.github.com/users/krlmlr/gists{/gist_id}","starred_url":"https://api.github.com/users/krlmlr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krlmlr/subscriptions","organizations_url":"https://api.github.com/users/krlmlr/orgs","repos_url":"https://api.github.com/users/krlmlr/repos","events_url":"https://api.github.com/users/krlmlr/events{/privacy}","received_events_url":"https://api.github.com/users/krlmlr/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rstats-db/DBI/labels/action:design","name":"action:design","color":"f7c6c7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2015-10-11T08:06:28Z","updated_at":"2015-11-12T21:52:32Z","closed_at":null,"body":"Current situation:\r\n\r\n- Dates are returned as \"Date\" class\r\n- Times are returned character, or integer (number of seconds, MySQL only)\r\n- Timestamps are returned character, or POSIXct (MySQL only)\r\n\r\nIt is unclear if, and how much, the DBI driver should abstract the DB server's understanding of these types. The current MySQL convention looks good for dates and timestamps, and should be adopted by the other backends. The \"time\" type is tricky: It doesn't seem to have a time zone, and probably represents a duration in most cases, but this cannot be relied on. Still, a `lubridate::duration()` might be a good bet here.\r\n\r\nFor now, the test tests for the \"character\" data type.\r\n"},"comment":{"url":"https://api.github.com/repos/rstats-db/DBI/issues/comments/156247472","html_url":"https://github.com/rstats-db/DBI/issues/42#issuecomment-156247472","issue_url":"https://api.github.com/repos/rstats-db/DBI/issues/42","id":156247472,"user":{"login":"imanuelcostigan","id":2107580,"avatar_url":"https://avatars.githubusercontent.com/u/2107580?v=3","gravatar_id":"","url":"https://api.github.com/users/imanuelcostigan","html_url":"https://github.com/imanuelcostigan","followers_url":"https://api.github.com/users/imanuelcostigan/followers","following_url":"https://api.github.com/users/imanuelcostigan/following{/other_user}","gists_url":"https://api.github.com/users/imanuelcostigan/gists{/gist_id}","starred_url":"https://api.github.com/users/imanuelcostigan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imanuelcostigan/subscriptions","organizations_url":"https://api.github.com/users/imanuelcostigan/orgs","repos_url":"https://api.github.com/users/imanuelcostigan/repos","events_url":"https://api.github.com/users/imanuelcostigan/events{/privacy}","received_events_url":"https://api.github.com/users/imanuelcostigan/received_events","type":"User","site_admin":false},"created_at":"2015-11-12T21:52:32Z","updated_at":"2015-11-12T21:52:32Z","body":"RJDBC currently only supports character and numeric return and write values. So dates for example are returned as characters. I've worked around this in my [`RSQLServer` fetch method](https://github.com/imanuelcostigan/RSQLServer/blob/a9396595c4afbbef09da6fcb183d06d8f076bb14/R/dbi-methods.R#L344) and expanded RJDBC's `dbDataType` method to [improve writing out R types to SQLServer](https://github.com/imanuelcostigan/RSQLServer/blob/a9396595c4afbbef09da6fcb183d06d8f076bb14/R/dbi-methods.R#L134). Similarly, I have also [expanded](https://github.com/imanuelcostigan/RSQLServer/blob/a9396595c4afbbef09da6fcb183d06d8f076bb14/R/dbi-methods.R#L164) RJDBC's `.fillStatementParameters` which is used by `dbSendUpdate`. \r\n\r\nMy approach is obviously mostly hackery, and I would love to see better way of mapping DB types to R types (and vice-versa) "}}