{"action":"created","issue":{"url":"https://api.github.com/repos/mattn/go-sqlite3/issues/190","labels_url":"https://api.github.com/repos/mattn/go-sqlite3/issues/190/labels{/name}","comments_url":"https://api.github.com/repos/mattn/go-sqlite3/issues/190/comments","events_url":"https://api.github.com/repos/mattn/go-sqlite3/issues/190/events","html_url":"https://github.com/mattn/go-sqlite3/issues/190","id":64319273,"number":190,"title":"'sql: Scan error on column index 0: unsupported driver -> Scan pair: []uint8 -> *time.Time' with datetime('now')","user":{"login":"brunoqc","id":24027,"avatar_url":"https://avatars.githubusercontent.com/u/24027?v=3","gravatar_id":"","url":"https://api.github.com/users/brunoqc","html_url":"https://github.com/brunoqc","followers_url":"https://api.github.com/users/brunoqc/followers","following_url":"https://api.github.com/users/brunoqc/following{/other_user}","gists_url":"https://api.github.com/users/brunoqc/gists{/gist_id}","starred_url":"https://api.github.com/users/brunoqc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brunoqc/subscriptions","organizations_url":"https://api.github.com/users/brunoqc/orgs","repos_url":"https://api.github.com/users/brunoqc/repos","events_url":"https://api.github.com/users/brunoqc/events{/privacy}","received_events_url":"https://api.github.com/users/brunoqc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-03-25T16:54:22Z","updated_at":"2015-03-28T04:26:11Z","closed_at":null,"body":"[sqlite3_column_decltype()](https://www.sqlite.org/c3ref/column_decltype.html) returns NULL when it's an expression.\r\n\r\nI'm not sure it's a bug.\r\n\r\nI was thinking that maybe go-sqlite3 could guess that the string is a datetime but that could cause problem when someone want a text timestamp on purpose.\r\n\r\nIt could be easier to do the work on the user side since we know if we expect a string or a datetime/date/timestamp.\r\n\r\n```go\r\nfunc TestDateTimeNow(t *testing.T) {\r\n\ttempFilename := TempFilename()\r\n\tdb, err := sql.Open(\"sqlite3\", tempFilename)\r\n\tif err != nil {\r\n\t\tt.Fatal(\"Failed to open database:\", err)\r\n\t}\r\n\tdefer db.Close()\r\n\r\n\tvar d time.Time\r\n\terr = db.QueryRow(\"select datetime('now')\").Scan(&d)\r\n\tif err != nil {\r\n\t\tt.Fatal(\"Failed to scan datetime:\", err)\r\n\t}\r\n}\r\n```\r\n\r\n```\r\n--- FAIL: TestDateTimeNow (0.02s)\r\n        sqlite3_test.go:917: Failed to scan datetime: sql: Scan error on column index 0: unsupported driver -> Scan pair: []uint8 -> *time.Time\r\nFAIL\r\n```"},"comment":{"url":"https://api.github.com/repos/mattn/go-sqlite3/issues/comments/87159461","html_url":"https://github.com/mattn/go-sqlite3/issues/190#issuecomment-87159461","issue_url":"https://api.github.com/repos/mattn/go-sqlite3/issues/190","id":87159461,"user":{"login":"gwenn","id":45554,"avatar_url":"https://avatars.githubusercontent.com/u/45554?v=3","gravatar_id":"","url":"https://api.github.com/users/gwenn","html_url":"https://github.com/gwenn","followers_url":"https://api.github.com/users/gwenn/followers","following_url":"https://api.github.com/users/gwenn/following{/other_user}","gists_url":"https://api.github.com/users/gwenn/gists{/gist_id}","starred_url":"https://api.github.com/users/gwenn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gwenn/subscriptions","organizations_url":"https://api.github.com/users/gwenn/orgs","repos_url":"https://api.github.com/users/gwenn/repos","events_url":"https://api.github.com/users/gwenn/events{/privacy}","received_events_url":"https://api.github.com/users/gwenn/received_events","type":"User","site_admin":false},"created_at":"2015-03-28T04:26:10Z","updated_at":"2015-03-28T04:26:10Z","body":"https://groups.google.com/forum/#!topic/golang-nuts/P6Wrm_uVvJ0"}}