Add "date" to decltypes parsed as a unix time

This commit is contained in:
Peter Waller 2014-09-02 16:36:34 +01:00
parent ff0960b999
commit 764e046d89
1 changed files with 1 additions and 1 deletions

View File

@ -474,7 +474,7 @@ func (rc *SQLiteRows) Next(dest []driver.Value) error {
case C.SQLITE_INTEGER: case C.SQLITE_INTEGER:
val := int64(C.sqlite3_column_int64(rc.s.s, C.int(i))) val := int64(C.sqlite3_column_int64(rc.s.s, C.int(i)))
switch rc.decltype[i] { switch rc.decltype[i] {
case "timestamp", "datetime": case "timestamp", "datetime", "date":
dest[i] = time.Unix(val, 0) dest[i] = time.Unix(val, 0)
case "boolean": case "boolean":
dest[i] = val > 0 dest[i] = val > 0